Repository navigation
fix(acp): OMP models other than the running one keep a remembered effort in new chats - #33646
Conversation
…n seed an effort An ACP agent without per-model effort metadata (OMP) only reports the running session's thought_level menu. Every other model was recorded with efforts: [], which admission reads as 'offers no effort', so a new chat seeded with that model plus an effort was refused with optionRejected. Mark those rows effortsKnown: false instead.
…s known again A newer listing that marks a model's efforts unknown borrows the older listing's menu; keep that row strict instead of admitting any effort.
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f593cff9-ec99-4347-8de8-1288b6f65a2f
Files selected for processing: 4-
src/main/acp/acp-structured-options.test.tssrc/main/acp/acp-structured-options.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-entry.test.tssrc/main/native-chat/agent-model-catalog/agent-model-catalog-entry.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
| const { defaultEffort: _own, effortsKnown, ...rest } = model | ||
| return { | ||
| ...rest, | ||
| // A menu borrowed from the other listing makes the efforts known again. | ||
| ...(effortsKnown === false && efforts.length === 0 ? { effortsKnown } : {}), |
There was a problem hiding this comment.
Preserve effortsKnown: false for partial menus.
When the newer row has a nonempty partial efforts array, mergedModels removes effortsKnown: false even when olderEfforts is empty. Admission then treats the partial menu as complete, so an unlisted remembered effort can be rejected or remapped.
Suggested fix
-
+ const borrowedEfforts = model.efforts.length === 0 && olderEfforts.length > 0 const efforts = model.efforts.length > 0 ? model.efforts : olderEfforts ... - ...(effortsKnown === false && efforts.length === 0 ? { effortsKnown } : {}), + ...(effortsKnown === false && !borrowedEfforts ? { effortsKnown } : {}),
…cit empty menus OpenCode builds its effort menu from the current model and refuses an effort the selected model lacks, so its other models keep explicit empty menus. Opt in with clampsUnlistedEffort on dialects that clamp (OMP). A newer unknown row no longer overrides an older listing's explicit [].
ELI5
OMP only tells Orca the thinking levels for the model a session is currently running. Orca wrote every other model down as "offers no thinking levels", so a new OMP chat on one of those models with a remembered effort (e.g.
omniroute/coding-max+xhigh) was refused before OMP started (1.4.239). Since #33637 the create goes through, but Orca silently drops the rememberedxhighand the chat runs at OMP's default. Now those models' levels are recorded as unknown, so Orca passes the effort through and OMP decides.Root cause
thought_levelselect built from the current session model only:#buildConfigOptions/#buildThinkingOptionsinoh-my-pi/packages/coding-agent/src/modes/acp/acp-agent.ts:1759-1815(session.getAvailableThinkingLevels()).availableModelscarries no per-model effort metadata, soOMP_ACP_DIALECThas nomodelEfforts.AcpStructuredOptions.read()(src/main/acp/acp-structured-options.ts) recordedefforts: []for every non-current model.agentSessionEffortLevelsreads an explicit[]as "admits none", so:assertAgentSessionOptionsAdmittedrefused the create withoptionRejected(the reporter's analysis);seedOptionsAdmittedOnSavedListingfinds no nearest level in[]and drops the remembered effort; an explicit{model, effort}create is still refused, and an at-rest model switch drops the effort (pickAgentSessionOption).What changed
(@pandudpn's commit from fix(acp): treat other models' effort menus as unknown so new chats can seed an effort #31998, kept as authored, then narrowed) A model other than the current one is recorded as
{ efforts: [], effortsKnown: false }. This applies only when all three hold:clampsUnlistedEffort: trueflag (set onOMP_ACP_DIALECTonly);thought_levelselect;OMP clamps any level to the selected model:
ModelControls.setThinkingLevel→resolveThinkingLevelForModel(clampThinkingLevelToCeiling(...))inoh-my-pi/packages/coding-agent/src/session/model-controls.ts:524-557. The current model, Grok (per-model menus) and every other ACP dialect are unchanged.mergedModels(agent-model-catalog-entry.ts): a row stays "unknown" only if the other listing doesn't know that model's menu either (row missing or also unknown). If the other listing has a real menu, the row borrows it and stays strict. If the other listing has an explicit empty menu (e.g. an OpenCode CLI model with no variants), that empty menu wins.Verification
Real
omp18.10.3, isolatedHOME/PI_CODING_AGENT_DIR, customomnirouteprovider (chat,coding-max, both reasoning models) pointed at a local fake OpenAI server that logsreasoning_effort. Dev Orca ran in the background with an isolatedORCA_DEV_USER_DATA_PATH, a folder workspace, native chat on, and the remembered OMP seedcoding-max+xhigh. The saved catalog was the reporter's state: only the probe listing, wherechatis current.session/newreturns thethought_levelmenu only foromniroute/chat.set_config_option model=omniroute/coding-max, thenthinking=xhigh, then prompt → the fake server getsmodel: coding-max, reasoning_effort: xhigh.reasoning_effort: "high", so the rememberedxhighwas dropped.omniroute/coding-max efforts=[] effortsKnown=false. The new chat creates, the composer shows "Coding Max XHigh", and the request carriedreasoning_effort: "xhigh".configOptions, main vs this branch:{model}(effort dropped) vs{model, effort: xhigh}optionRejectedvs admittedchat→coding-max: effort dropped vs keptacp-structured-options.test.ts: OpenCode keeps an explicit[], OMP gets an unknown row. Tests inagent-model-catalog-entry.test.ts: a borrowed menu stays strict, an older explicit[]wins, and a row stays unknown only when both listings are unknown.pnpm tcand thecheck:code-quality:changedgate pass. Unrelatedsrc/main/acpopencode / write-queue tests also fail on unmodified origin/main locally (AppEnvironment not initialized).Risk
InvalidEffortErrorinopencode/packages/cli/src/acp/config-option.ts:85-89). Treating its other models as unknown would turn main's silent effort drop on a model switch into aneffort not foundfailure on the first send. Its rows keep main's explicit[], covered by the OpenCode-dialect test inacp-structured-options.test.ts.[]rows keep the old behaviour until the next probe or live listing rewrites them.effortsKnownis an existing optional field. Older clients and servers ignore it, and the renderer doesn't read it, so the picker is unchanged.Fixes #31995
Supersedes #31998 (its commit is included here with @pandudpn as author)