Skip to content

fix(native-chat): keep the launch effort when a terminal agent starts on its default model - #47975

Merged
nwparker merged 1 commit into
stablyai:mainfrom
yohangwak:yohangwak/effort-without-model
Nov 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
yohangwak:yohangwak/effort-without-model

Conversation

@yohangwak

@yohangwak yohangwak commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

If Orca starts a terminal agent on its default model and you only chose a reasoning effort (for example Codex with Effort High), the chat bar's model pill used to show no effort at all. Now it shows the effort right away and keeps it after the agent reports which model it is running.

What Changed

Before: if you launch Codex with Model left on default and Effort High, its command gets -c model_reasoning_effort=high, but the Chat view pill reads Model, then GPT-5.5 once the agent reports its model. No effort is shown at any point. Grok showed the effort at first and then lost it on the first model report.

After: the pill reads Model · High right away and GPT-5.5 · High after the report.

How it works (all in src/shared/native-chat/input/session-options/):

  • The in-memory session-option record has a new valuesWithoutModel slot. It holds the values the session runs while its model is still unknown. seedNativeChatAppliedSessionOptions used to return early when the launch named no model. Now it saves the model-independent options (the catalog's unknownModelOptions, minus anything composed into the model id, like Cursor's) in that slot.
  • The snapshot shows the slot's values through unknownModelOptions, and only the ones that hold a value. A launch with no effort therefore gets no empty Effort row.
  • On the first model report, the record keeps only the slot values the reported model offers, with their original source (applied/dispatched). Then it drops the slot. If the report itself carries a value, that value wins.
  • Picking from a chip or typing /effort before the model is known writes to the same slot. Picking a different model or losing the model discards it. Re-picking the model the session already runs keeps it.
  • getTrackedSessionOption/clearTrackedSessionOption now read the model from the record instead of taking a modelId argument. setTrackedSessionOption drops its fallbackModelId argument, since the slot replaces that Grok-only fallback.
  • A pick that is in flight when the first report adopts the launch value is no longer treated as superseded. That report only names the model the CLI already ran.

Why

A default-model launch was the only path where the effort you chose never showed up, and Claude, Codex and Grok each lost it in a different way. Alternatives that were rejected:

  • A placeholder model key in valuesByModel: it would leak into persisted and draft selections as a model value.
  • Attaching the values to the CLI-default row: Codex and Claude have no row known to be the CLI default, and Grok's row is wiped by the first report.
  • Always showing an Effort row: every session launched without an effort would get an empty row.

Linked Issue

Fixes #47976

Visual Proof

Real app (E2E build, background launch), Codex launched with default model and Effort High through the New workspace composer, pill read before and after a gpt-5.5 model report. These are the original contributor's captures from #47975. The follow-up commits in this squash only harden edge cases (an empty model name in a report, a pick dispatched while the first report arrives, re-picking the same model) and don't change this flow.

Before the model report After the model report
main base before base after
this PR fix before fix after

Accessible names: main Model and effort then Model GPT-5.5 (no Effort control). This PR: Model and effort, Effort High then Model GPT-5.5 · High, Effort High.

Testing

Platform: macOS. The change is shared, platform-independent logic with no paths, shell or IO.

  • New native-chat-session-option-values-without-model.test.ts (4 tests) drives the real seed → PTY surface → status report path for Codex, Claude, Grok and Cursor:

    • an effort the reported model offers survives the first report, and one it doesn't offer is dropped
    • options composed into the model id (Cursor) are excluded
    • a chip pick before the model is known replaces the launch effort and survives the report
    • a pick dispatched while the first report lands is kept (Grok effort and Claude fast-mode toggle)
    • re-picking the default model the session already runs keeps the launch effort

    All 4 fail on main and pass on this branch.

  • vitest run src/shared/native-chat/input/session-options/: 2 files, 11 tests passed.

  • On the touched files: oxlint, oxfmt --check, the anti-slop and code-quality oxlint configs, ast-grep scan, and check-changed-code-quality.mjs. All clean.

  • I manually tested these changes locally (verified with the scripted real-app probe above, not an interactive session with a real Codex, Grok or Claude CLI)

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None measurable. The new work runs only at launch, on a model report, or on an option pick. It adds one small object per terminal tab, with no IO, polling, subprocess or new subscription. On a steady stream of model reports, the extra check returns early when there is no slot. Benchmark below: status report plus getSnapshot(), 20k iterations × 5 rounds, median µs per call, old → new:

Case main this PR
Codex launched with a model 0.27 0.27–0.28
Codex launched on default model + effort 0.22–0.23 0.22
Claude, nothing seeded 0.22 0.22–0.24
Adversarial: model flips on every report 1.48–1.50 1.70–1.71

Worst single call was under 0.12 ms in every case, far below a 16 ms frame. The adversarial case doesn't happen in practice, since real sessions report a stable model.

Risk

Level: Low

  • Grok: while Grok's model is unknown, a pick is now stored in the slot instead of under the default row, and it survives the first report. Before, that report erased it.
  • /model typed in the TUI before the first report: chat cannot see this. The launch effort can be carried onto the new model if that model offers it. It stays marked applied, and any effort in a later report replaces it.
  • Reported model Orca does not list: the stand-in model has no options, so the effort is dropped. This matches the no-guessed-options stance.
  • Remote, mobile and older clients: the state is in memory only, with no saved settings, migration or protocol change. Headless orca serve and the phone use the same shared record. The phone does not seed launch values yet, so there only a pick or typed /effort fills the slot.
  • Back out: a plain revert.

Review

Reviewed in a maintainer bug-bash pass. The follow-up commits squashed in here fix: an empty model name in a report dropping the slot; a pick made before the model is known being lost when the first report lands mid-dispatch; seeding only options a model-less launch actually applies; and some cleanups.

Original fix by @yohangwak in #47975. Their authorship is preserved on the commit.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (targeted checks run locally; CI covers the full suite)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Native chat session options can now be stored before a model is known. Commands and snapshots use those unmodeled values, and values can be adopted when a model is reported or selected. Cache seeding also stores non-model options without a model. New tests cover launch values, pre-report selections, and re-selecting an already-running default model.

Severity of issue fixed: Medium

Merge Risk: Low · up to 69499

Terminal agent chat chips now keep a chosen reasoning effort visible while the model is unknown. A narrow race, where the first model report arrives during an effort dispatch, may still drop the selection. The impact is limited to display state, so merge risk is low.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a chosen reasoning effort stays visible when a terminal agent starts on its default model. It is a fix under the native-chat scope and matches the diff, which adds a v…
Description check Passed The description follows the repository template. It includes ELI5, What Changed (before and after plus mechanism), Why (with alternatives considered), Linked Issue (Fixes #47976), Visual Proof (before…
Linked Issues check Passed Issue #47976 is the only active directly linked issue, so its requirements apply. The supplied whole-PR summary covers each requirement. (1) Launch effort shown as applied: seedNativeChatAppliedSessio…
Out of Scope Changes check Passed All changed files sit under src/shared/native-chat/input/session-options/ and serve the #47976 objective: seed, snapshot, state, commands, apply, pty-session-options, the new helper module, and the ne…
Full details: Title check

Explanation

The title names the main change: a chosen reasoning effort stays visible when a terminal agent starts on its default model. It is a fix under the native-chat scope and matches the diff, which adds a valuesWithoutModel slot that keeps launch values, and the linked issue #47976 describes the same gap. The title is 90 characters, slightly above a typical short title, but it is still one clear sentence.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed (before and after plus mechanism), Why (with alternatives considered), Linked Issue (Fixes #47976), Visual Proof (before and after tables), Testing, Performance, Risk (level Low, with back-out plan), AI Disclosure, Review, and the checklist. The Performance section is filled with a valid 'None, because' sentence. The Risk section names the riskiest parts and the revert path. The Visual Proof section uses before/after images with DOM readings, which meets the UI-change requirement. Minor gaps: the 'Level' field is filled, but the Testing section leaves the manual-testing box unchecked with an explanation. The description is mostly complete and well above the pass threshold.

Full details: Linked Issues check

Explanation

Issue #47976 is the only active directly linked issue, so its requirements apply. The supplied whole-PR summary covers each requirement. (1) Launch effort shown as applied: seedNativeChatAppliedSessionOptions records eligible values in valuesWithoutModel when the launch has no model, and the snapshot exposes catalog unknown-model options that hold a value (nativeChatOptionsWithoutModel). (2) First model report: adoptNativeChatValuesWithoutModel adopts only IDs the reported model offers, keeps the original source (applied or dispatched), lets a value carried by the report win, and deletes the slot. (3) Later pick or typed /effort: setTrackedSessionOption writes the slot while the model is unknown. A different-model pick clears the slot, and re-picking the current model carries it (carryNativeChatValuesWithoutModel). Composed options are excluded. Tests in native-chat-session-option-values-without-model.test.ts cover adoption, unlisted-model drop, pre-report picks, and the Grok re-pick case. Limits: the repository diff tools were unavailable in this review, so I could not read the incremental changes from the previous reviewed heads (03dafb5, 80bc093) to head 694996d. The conclusion relies on the supplied whole-PR summary and the prior helper-file inspection. I did not re-run the tests.

Full details: Out of Scope Changes check

Explanation

All changed files sit under src/shared/native-chat/input/session-options/ and serve the #47976 objective: seed, snapshot, state, commands, apply, pty-session-options, the new helper module, and the new test file. Removing the fallbackModelId argument from setTrackedSessionOption follows from the slot replacing that fallback. The Grok default-row behavior change is part of the linked issue's scope. The PR excludes phone work (#47912, #47913) and issue 25951, and the supplied evidence shows no unrelated change. Limit: the repository diff tools were unavailable, so the incremental changes since the previous reviewed heads were assessed from the supplied summary only.

  • 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

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: 09fb512d-01c0-416a-a80d-5186ceb73455
Commits

Reviewing files that changed from the base of the PR and between 03dafb5 and 694996d.

Files selected for processing: 8

  • src/shared/native-chat/input/session-options/native-chat-pty-session-options.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-apply.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-cache.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-commands.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-snapshot.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-state.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-values-without-model.test.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-values-without-model.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.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Do not discard an effort selection when the first… · native-chat-session-option-apply.ts:262-263

src/shared/native-chat/input/session-options/native-chat-session-option-apply.ts:262-263
Minor · Functional Correctness · Heavy lift

Do not discard an effort selection when the first model report arrives.

Start the new Claude pre-report path with launch effort high. Call setOption('effort', 'low'), then receive a model-only report before dispatchCommand resolves.

The report changes the tracked model from null to claude-opus-5-5. This guard then discards the successful effort completion. The session runs low, but the snapshot retains the adopted launch effort or an unknown value.

Distinguish first-model adoption from a model switch. Preserve the completed effort selection when the first report does not contain a newer effort. Continue to reject completions superseded by an actual model switch or newer option selection.

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: 50e366b5-83e9-45e9-aea0-03c0b146d03a
Commits

Reviewing files that changed from the base of the PR and between 6efc8b5 and 80bc093.

Files selected for processing: 8

  • src/shared/native-chat/input/session-options/native-chat-pty-session-options.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-apply.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-cache.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-commands.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-snapshot.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-state.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-values-without-model.test.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-values-without-model.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.

… on its default model

A terminal agent launched with no model but a chosen reasoning effort
(e.g. Codex with `-c model_reasoning_effort=high`) showed no effort in
the chat model pill, and Grok lost it on the first model report.

The session-option record now holds a `valuesWithoutModel` slot for
values the session runs while its model is unknown. The launch seed
stores values there, the snapshot shows them through the catalog's
unknown-model options, and the first model report adopts only the
values the reported model offers (a value the report carries wins).
Chip picks and typed `/effort` write the same slot; picking a different
model or losing the model discards it, re-picking the running model
keeps it.

Fixes stablyai#47976

Co-authored-by: Neil <[email protected]>
@nwparker
nwparker force-pushed the yohangwak/effort-without-model branch from 03dafb5 to 694996d Compare November 24, 2026 03:56
@nwparker
nwparker merged commit f124b4b into stablyai:main Nov 24, 2026
57 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]: Terminal chat shows no effort when Orca launches the agent with an effort but its default model

2 participants