Repository navigation
fix(native-chat): drop a remembered model option a saved listing no longer admits - #31576
hualong1009 wants to merge 1 commit into
Conversation
…onger admits A new chat seeds the remembered model selection into its create and admits the seed against the saved catalog rows. A remembered value its model's row no longer admits refused the create with agent_session_operation_invalid (optionRejected) before any effect, which the launch wraps as agent_session_operation_unknown: every new chat for that agent then fails after the confirmation budget, shown as a chat that could not connect. A remembered value is now dropped instead — a launch is refused only on options its caller named for it. Values this launch named itself keep their refusal, and the seed's model always stays, since a listed row admits its own id.
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/main/runtime/rpc/methods/structured-agent-session-create-seed-admission.test.ts: 1
79-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the explicit-effort test use the seed model during admission.
The helper omits
atRest, so the preparation path passes only{ effort: 'off' }to admission. For thepiagent, the seed-listing helper returns that value unchanged because it only reads catalogs forclaude. No model row matches, so the test can pass even if explicit keys are not forwarded.Exercise the at-rest path, retain
{ model: 'some/model' }, and provide its required host stubs. Keep the assertion that expliciteffort: 'off'survives the matching row that rejectsoff.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c37e0ef0-9dab-4850-a0ae-d646c7f48001
📒 Files selected for processing: 4
src/main/runtime/agent-session-record-options.test.tssrc/main/runtime/agent-session-record-options.tssrc/main/runtime/rpc/methods/structured-agent-session-create-seed-admission.test.tssrc/main/runtime/rpc/methods/structured-agent-session-create.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Fixes #31493.
Root cause
A new chat seeds its remembered model selection into the create and admits the seed against the saved catalog rows (#30561). When the saved row for the remembered model no longer admits a remembered value (e.g. an effort remembered from a listing that offered it, while the current saved row for that model lists none — seen after a CLI/model-listing change, e.g. upgrading Orca from 1.4.225 to 1.4.237 alongside pi 1.3.0), the create is refused with
agent_session_operation_invalid(reason: optionRejected) before any effect: nothing is created and no process is spawned.The launch executor does not classify that create refusal as failed-without-effects, so it is wrapped as
agent_session_operation_unknown. The Chat UI then waits out its launch confirmation budget and shows "Chat connection could not be confirmed" — with no error surface, and the same result for every retry, so the agent's Chat UI is permanently broken while terminal launches still work.Trace signature: the
agentSession.createspan ends right afterreserve_ownerwith noacquire_ownerphase and no new processes.Fix
A remembered value its model's saved row no longer admits is now dropped from the seed instead of refusing the create — a launch is refused only on options its caller named for it:
seedOptionsAdmittedOnSavedListingfilters the seed against the saved rows, keeping keys the caller named explicitly this launch (their values stay their caller's own picks and keep their refusal).--modellaunches are unchanged: an option the caller named is still admitted strictly.Verification
agent_session_operation_unknownafter the 30s budget with no spawned process, while the same launch from a fresh profile succeeded.A complementary hardening (separate follow-up, not included here):
launchFailureWithoutEffectsCodecould treatAgentLaunchStructuredSessionRefusedErroras failed-without-effects, since a refused create is the launch's first effect — that would surface the typed refusal to the caller instead ofagent_session_operation_unknownfor any remaining admission refusal.