fix(prime-agent): explain why a thread cannot switch to Prime Agent Default - #49
Merged
Conversation
…efault Selecting "Prime Agent Default" for a thread that already ran on a named model sent Pylon's "default" sentinel through as if it were a model id. It reached setModel, where the provider/model selector split rejected it, so the turn failed with "Model must use a provider/model selector." — an internal-sounding message for an ordinary choice in the model picker. The turn cannot succeed either way: "default" means deferring to Prime's own configured model, and the daemon connection exposes no method to hand model choice back to Prime inside a running session. getModelCatalog returns only models and configuredProviders, with no default to re-select, and setModel requires an explicit provider and id. Continuing on the previous model would leave the thread running one model behind a "Prime Agent Default" label. So reject the switch where the other unsupported turn selections are rejected, with a message that names the constraint and the way forward. Naming a different model in an existing thread is unaffected, and a thread that stays on Prime Agent Default still makes no setModel call at all. Model: Claude Opus 5 in Pylon (Claude Code harness)
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
…ession The rejection added in the previous commit is a constraint of the installed harness, not a decision we want to keep. Name the exact upstream capability that would replace it — a session method that restores Prime's own default, or an authoritative default id in the catalog — next to the code that fails, and add the gap to the parity ledger's register of daemon-connection omissions so it is reconsidered when Prime Agent gains either one. Model: Claude Opus 5 in Pylon (Claude Code harness)
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.
Problem
Choosing Prime Agent Default for a thread that had already run on a named model failed the turn with
Model must use a provider/model selector.— an internal-sounding message for an ordinary action in the model picker.Pylon uses
"default"as the sentinel for "let Prime choose". At session start it is handled (model === "default"simply omits the model), but on a later turnapplyTurnSelectioncompares it againstcontext.session.model, sees a difference, and passes it tosetModel, wheresplitModelSelectorrejects it for having no/.Found while adopting 0.7.3 (#48); it is not caused by that release.
How it was fixed
The turn cannot succeed either way.
"default"means deferring to Prime's own configured model, and the daemon connection exposes no way to hand model choice back to Prime inside a running session:AgentConnectionModelCatalogis{ models, configuredProviders }with no default to re-select, andsetModelrequires an explicit provider and id. Silently continuing on the previous model would leave the thread running one model behind a Prime Agent Default label, which is exactly the kind of stale label we try not to ship.So the switch is rejected where the other unsupported turn selections already are, with a message that names the constraint and the way forward. This changes an incomprehensible failure into a comprehensible one rather than turning a working path into a failing one.
Unaffected: naming a different model in an existing thread, and threads that stay on Prime Agent Default (which make no
setModelcall at all — covered by a second test so the guard cannot over-reject).A client-side improvement would be to stop offering Prime Agent Default in the picker once a thread has run on a named model. That spans web and mobile and is a separate concern, so it is not in this PR.
Verification
expected [ 'default' ] to not include 'default'against the unfixed adapter, confirmingsetModel("default")was really being calledvp test run apps/server/src/provider/prime/— 245 passed, 1 skipped (up from 243; the two new tests are the delta)vp run -F t3 typecheck— 0 errorsvp linton both touched source files — cleanNo UI changes, so no before/after images.
Model: Claude Opus 5 in Pylon (Claude Code harness)
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.