fix(session): CLI session key mismatch — provider 'unknown' vs runtime name#2124
Merged
alexey-pelykh merged 2 commits intomainfrom Apr 8, 2026
Merged
fix(session): CLI session key mismatch — provider 'unknown' vs runtime name#2124alexey-pelykh merged 2 commits intomainfrom
alexey-pelykh merged 2 commits intomainfrom
Conversation
…provider (#2105) The gutted resolveDefaultModel() stub returned defaultProvider: "unknown", which flowed through to providerUsed. Since isCliProvider("unknown") returned false, CLI session IDs were never persisted — preventing --resume from being passed on subsequent messages in the same thread. Three changes fix the pipeline: 1. resolveDefaultModel() now uses resolveAgentRuntime() to return the actual runtime name (e.g. "claude") as the default provider. 2. isCliProvider() recognizes the four agent runtime names (claude, gemini, codex, opencode) as CLI providers, independent of cliBackends config. 3. The cron isolated-agent path uses the same runtime-based provider resolution instead of hardcoded "unknown". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ea94db7 to
5d1d41b
Compare
The upstream #2121 re-enabled these tests which now need the resolveAgentRuntime mock and updated default assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2105.
resolveDefaultModel()now returns the configured agent runtime (e.g."claude") asdefaultProviderinstead of the hardcoded"unknown"— this flows through toproviderUsedin the session usage pipelineisCliProvider()recognizes the four agent runtime names (claude,gemini,codex,opencode) as CLI providers, so CLI session IDs are correctly extracted and persistedRoot cause: The gutted
resolveDefaultModel()stub returned"unknown", causingisCliProvider("unknown")to returnfalse, which meant CLI session IDs were never persisted —--resumewas never passed on subsequent messages in the same thread.Test plan
isCliProvider()runtime name recognitionresolveDefaultModel()runtime-based resolutionresolveAgentRuntimepnpm checkpasses (format + typecheck + lint)🤖 Generated with Claude Code