Skip to content

feat(code-mode): per-session model + effort, and keep output on nav#632

Merged
Gagancreates merged 1 commit into
devfrom
feat/code-mode-model-effort-and-nav-fix
Jun 21, 2026
Merged

feat(code-mode): per-session model + effort, and keep output on nav#632
Gagancreates merged 1 commit into
devfrom
feat/code-mode-model-effort-and-nav-fix

Conversation

@Gagancreates

@Gagancreates Gagancreates commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

What

Two improvements to the Code section.

1. Fix: output lost when navigating away and back

selectedSessionId lived in CodeView local state, which is destroyed when the section unmounts — so returning reset the selection and the right-hand chat pane fell back to the empty state. It's now persisted to localStorage (same pattern as the terminal height) and restored on remount, so the conversation/output re-binds. Survives an app restart too.

2. Feature: pick the coding agent's model + reasoning effort per session

  • Choices are discovered live from the engine (the same list /model shows) via a new codeMode:listModelOptions IPC, cached per agent in the main process — nothing hardcoded, so the list tracks whatever the provider currently offers.
  • Claude: separate Model + Effort axes. Canonical opus/sonnet/haiku alias rows are surfaced explicitly for clarity (deduped against the engine list), matching the interactive /model picker. Efforts include whatever the engine reports (e.g. xhigh/max).
  • Codex: folds reasoning effort into the model id (gpt-5.4[high]), so it shows a single combined model list and no separate effort.
  • Selections persist on the CodeSession and are re-applied to the ACP session each turn (best-effort — an unsupported model/effort logs a warning and falls back to the engine default rather than failing the turn). Editable from both the new-session dialog and the session header.

How it's wired

  • shared: agentModel/agentEffort on CodeSession; CodeAgentModelOptions; codeMode:listModelOptions IPC; create/update schemas.
  • core: AcpClient.setModel/setEffort + describeModelOptions (reads engine configOptions and falls back to models); CodeModeManager.listModelOptions (cached discovery) + per-turn apply; CodeSessionService persists + passes through.
  • renderer: cached fetchCodeAgentOptions helper; dialog + header dropdowns.

Testing

  • Verified live: nav-away/back preserves output; Claude shows Default/Opus/Sonnet/Haiku + effort levels; Codex shows the combined gpt-5.x[effort] list; selections apply on the next turn.
  • npm run deps + renderer/main tsc all clean.

Two improvements to the Code section:

- Fix: leaving the Code section and returning no longer drops the open
  session's output. The selected session id is persisted to localStorage
  (mirroring the terminal-height pattern) and restored on remount, so the
  right-hand chat pane re-binds instead of falling back to the empty state.

- Feature: choose the coding agent's model and reasoning effort per session.
  Choices are discovered live from the engine (the same list `/model` shows)
  via a new `codeMode:listModelOptions` IPC, cached per agent — never
  hardcoded, so they track whatever the provider currently offers. Claude
  exposes model + effort as separate axes (with explicit Opus/Sonnet/Haiku
  alias rows surfaced for clarity); Codex folds effort into the model id and
  reports no separate effort. Selections persist on the CodeSession and are
  re-applied to the ACP session each turn (best-effort), editable from both
  the new-session dialog and the session header.
@Gagancreates Gagancreates merged commit 45188e7 into dev Jun 21, 2026
3 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.

1 participant