Skip to content

fix(acp): OMP models other than the running one keep a remembered effort in new chats - #33646

Merged
nwparker merged 3 commits into
mainfrom
nwparker/agint-31995
Oct 25, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/agint-31995

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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 remembered xhigh and 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

  • OMP's ACP agent sends one thought_level select built from the current session model only: #buildConfigOptions / #buildThinkingOptions in oh-my-pi/packages/coding-agent/src/modes/acp/acp-agent.ts:1759-1815 (session.getAvailableThinkingLevels()). availableModels carries no per-model effort metadata, so OMP_ACP_DIALECT has no modelEfforts.
  • AcpStructuredOptions.read() (src/main/acp/acp-structured-options.ts) recorded efforts: [] for every non-current model. agentSessionEffortLevels reads an explicit [] as "admits none", so:
  • OMP accepts and runs that pair fine (verified below).

What changed

  1. (@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:

    • the dialect opts in with the new clampsUnlistedEffort: true flag (set on OMP_ACP_DIALECT only);
    • the agent reports a thought_level select;
    • the dialect advertises no per-model menu.

    OMP clamps any level to the selected model: ModelControls.setThinkingLevel → resolveThinkingLevelForModel(clampThinkingLevelToCeiling(...)) in oh-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.

  2. 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 omp 18.10.3, isolated HOME / PI_CODING_AGENT_DIR, custom omniroute provider (chat, coding-max, both reasoning models) pointed at a local fake OpenAI server that logs reasoning_effort. Dev Orca ran in the background with an isolated ORCA_DEV_USER_DATA_PATH, a folder workspace, native chat on, and the remembered OMP seed coding-max + xhigh. The saved catalog was the reporter's state: only the probe listing, where chat is current.

  • Raw ACP: session/new returns the thought_level menu only for omniroute/chat. set_config_option model=omniroute/coding-max, then thinking=xhigh, then prompt → the fake server gets model: coding-max, reasoning_effort: xhigh.
  • origin/main (883b768): the new OMP chat creates and the composer shows "Coding Max High". The request carried reasoning_effort: "high", so the remembered xhigh was dropped.
  • This branch: after a fresh probe, the saved row is omniroute/coding-max efforts=[] effortsKnown=false. The new chat creates, the composer shows "Coding Max XHigh", and the request carried reasoning_effort: "xhigh".
  • The same code path checked against the real OMP configOptions, main vs this branch:
    • remembered seed: {model} (effort dropped) vs {model, effort: xhigh}
    • explicit create: refused with optionRejected vs admitted
    • at-rest model switch chat→coding-max: effort dropped vs kept
  • Tests in acp-structured-options.test.ts: OpenCode keeps an explicit [], OMP gets an unknown row. Tests in agent-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 tc and the check:code-quality:changed gate pass. Unrelated src/main/acp opencode / write-queue tests also fail on unmodified origin/main locally (AppEnvironment not initialized).

Risk

  • Scope is OMP only. Admission gets more permissive only for OMP models other than the one the session is running. OMP clamps the level itself, so a mismatch can't refuse the chat before it starts.
  • OpenCode 1.x/2.x is deliberately excluded. OpenCode also builds its menu from the current model only, but it refuses an effort the selected model lacks (InvalidEffortError in opencode/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 an effort not found failure on the first send. Its rows keep main's explicit [], covered by the OpenCode-dialect test in acp-structured-options.test.ts.
  • Existing installs: model catalogs already saved with OMP [] rows keep the old behaviour until the next probe or live listing rewrites them.
  • Mixed versions: effortsKnown is 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)

pandudpn and others added 2 commits October 25, 2026 14:52
…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.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 4cec1a5b-6b9b-48d6-b092-991ac68fd4c2
Commits

Reviewing files that changed from the base of the PR and between e4c4e05 and 0c36f61.

Files selected for processing: 6
  • src/main/acp/acp-dialects/acp-dialect.ts
  • src/main/acp/acp-dialects/omp-dialect.ts
  • src/main/acp/acp-structured-options.test.ts
  • src/main/acp/acp-structured-options.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.test.ts
  • src/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; 3 remain after this review.

Walkthrough

ACP option reading now marks a non-current model’s effort menu as unknown when the session has an effort option but no advertised menu and the dialect clamps unlisted effort. Native-chat model merging uses the older listing’s effort menu when the newer listing’s menu is unknown, and retains the unknown marker only when neither listing provides a known menu.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Low · up to 0c36f

Some partially reported model menus can change or discard a remembered effort. This is a narrow, previously reported risk; the OMP path addressed by this change is not shown to trigger it.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the OMP effort-retention fix for non-running models. It is concise and directly matches the primary change.
Description check Passed The description clearly explains the problem, root cause, implementation, scope, linked issue, verification results, and risks. It omits several template headings, including Visual Proof, Review, Note…
Linked Issues check Passed The change satisfies #31995. OMP_ACP_DIALECT enables clampsUnlistedEffort. AcpStructuredOptions.read() records non-current OMP models as effortsKnown: false when OMP reports one session-wide e…
Out of Scope Changes check Passed The changes stay within #31995. The new dialect capability limits the relaxed behavior to agents that clamp unlisted efforts, and only OMP enables it. The catalog merge change preserves strict menus w…
Full details: Description check

Explanation

The description clearly explains the problem, root cause, implementation, scope, linked issue, verification results, and risks. It omits several template headings, including Visual Proof, Review, Notes, and Checklist, but the critical information is present and the change is well documented.

Full details: Linked Issues check

Explanation

The change satisfies #31995. OMP_ACP_DIALECT enables clampsUnlistedEffort. AcpStructuredOptions.read() records non-current OMP models as effortsKnown: false when OMP reports one session-wide effort menu without per-model menus. This prevents Orca from treating the effort as unsupported before dispatch. The reported OMP verification shows that a new chat keeps xhigh and sends reasoning_effort: "xhigh" to OMP. The added tests cover the OMP unknown row and catalog behavior.

Full details: Out of Scope Changes check

Explanation

The changes stay within #31995. The new dialect capability limits the relaxed behavior to agents that clamp unlisted efforts, and only OMP enables it. The catalog merge change preserves strict menus when another listing knows the menu and preserves explicit empty menus. The added tests support these behaviors. No unrelated product behavior is demonstrated.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Commits

Reviewing files that changed from the base of the PR and between 47d1b31 and e4c4e05.

Files selected for processing: 4
  • src/main/acp/acp-structured-options.test.ts
  • src/main/acp/acp-structured-options.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-entry.test.ts
  • src/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.

Comment on lines +155 to +159
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 } : {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

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 [].
@nwparker
nwparker merged commit 7e8bf3d into main Oct 25, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OMP native chat rejects every message when the saved model differs from OMP's default and no effort is saved

2 participants