Repository navigation
fix(native-chat): a remembered effort a saved Pi listing lacks no longer refuses new chats (carries #31576) - #33637
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.
… level Pi's live menu offers xhigh where its --list-models probe stops at high, so dropping the remembered effort lost the user's intent; reuse the Claude seed remap's nearest-effort rule instead. Keep one prepare-level regression file. Co-authored-by: 王浩生 <22971846+hualong1009@users.noreply.github.com>
|
No actionable comments were generated in the recent review.
|
ELI5
When you pick an effort for a Pi chat (say XHigh), Orca remembers it for the next chat. Pi's live chat offers XHigh, but the shorter model list Orca saves from
pi --list-modelsstops at High. When you start the next chat, Orca checks the remembered effort against that saved list, sees it's missing, and refuses to create the chat. You then get "Chat connection could not be confirmed." on every new Pi chat, while Pi in a terminal still works.Now a remembered effort that the saved list doesn't have moves to the nearest level it does have (XHigh → High), the same rule the Claude seed remap already uses. If no nearby level exists (e.g. the model lists no efforts), the effort is dropped. Values you pass for this one launch (
--model/--effort) are still checked strictly.Root cause
nativeChatSessionOptions.<agent>.valuesByModel) into the create, andassertAgentSessionOptionsAdmitted(viavalidateAgentSessionReservationInput) checks it against the saved catalog row before anything runs. The refusal (agent_session_operation_invalid/optionRejected) is not classified as failed-without-effects, so the launch reportsagent_session_operation_unknown, and the Chat UI times out with "Chat connection could not be confirmed." The trace showsagentSession.createending afterreserve_ownerwith noacquire_owner.pi --list-models, which prints only athinking yes/nocolumn (pi-monopackages/coding-agent/src/cli/list-models.ts:69). SopiModelCatalogFromListingcan only offeroff..high(src/main/pi/rpc-model-catalog-probe.ts). The live RPCget_available_modelsreportsthinkingLevelMap, so the live picker also offersxhigh/maxwhen the model maps them (src/main/pi/rpc-options.ts). Live picks skip admission for Pi on purpose (pickAgentSessionOption: "Pi's probe stops at high"). The create path had no matching tolerance.mergedModels). After a restart the probe listing is newer than the live one, which is why it works until Orca restarts or updates and then fails on every new chat.packages/coding-agent/src/core/agent-session.ts:2676setThinkingLevel), so the refusal protected nothing.What changed
seedOptionsAdmittedOnSavedListing(from fix(native-chat): drop a remembered model option a saved listing no longer admits #31576): fits only the remembered seed to the saved row. An effort the row lacks moves tonearestAgentEffort(reused fromstructured-launch-seed-listing.ts); other unlisted values drop. It runs only when the caller didn't name a model, and keys the caller named keep strict admission. Unlisted models or no saved rows admit everything, as before.prepareStructuredAgentSessionCreateForWorktree. Two of its cases fail onorigin/main.How verified
Real Orca dev build + real
@earendil-works/pi-coding-agent@1.3.0(the issue's version), isolatedHOME/Pi agent dir/ORCA_DEV_USER_DATA_PATH, scrubbed env, and a local fake OpenAI-compatible model server. The model wasreasoning: true,thinkingLevelMap: { xhigh: "high" }.nativeChatSessionOptions.pi = {model: fake/fake-1, valuesByModel: {fake/fake-1: {effort: xhigh}}}. After restarting Orca, the saved row was the probe'soff..high. New tab → "Start a chat with Pi" showed "Chat connection could not be confirmed." with the picker onXHigh.orca agent launch --agent pi --surface chatreturnedagent_session_operation_unknown. The trace'sagentSession.createhadreserve_ownerand noacquire_owner, the same signature as in the issue.pong from fakeback from the fake server.orca agent launch --agent pi --surface chat→ok: true, "Started a structured chat session". The rememberedxhighsetting is unchanged.pnpm tc:node, targetedpnpm test(new file +src/main/runtime/session-tabs),pnpm run check:code-quality:changed: all pass.Platforms: the report is from Windows, but the cause is platform-independent. It reproduced on macOS and touches no platform-specific code. Remote: the fix runs on whichever host creates the chat, with no wire change. Mobile-created chats go through the same host create path.
Risk
Low. The change only affects create-time seeding of remembered values the saved row would otherwise refuse. Those launches always failed before. Explicit
--model/--effortadmission is unchanged.Trade-off: a Pi user who remembered
xhigh/maxnow starts new chats athighuntil a newer live listing offers more. Before this they got no chat at all. We could instead skip effort admission for Pi creates, since Pi clamps itself, but that would let real typos through for every provider path that shares this check.A follow-up worth considering: classify
AgentLaunchStructuredSessionRefusedErroras failed-without-effects, so any remaining admission refusal shows its typed reason instead ofagent_session_operation_unknown.Credit: carries @hualong1009's #31576 (their commit is kept as-is; the follow-up commit is co-authored).
Fixes #31493