feat(code-mode): per-session model + effort, and keep output on nav#632
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two improvements to the Code section.
1. Fix: output lost when navigating away and back
selectedSessionIdlived inCodeViewlocal 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 tolocalStorage(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
/modelshows) via a newcodeMode:listModelOptionsIPC, cached per agent in the main process — nothing hardcoded, so the list tracks whatever the provider currently offers.opus/sonnet/haikualias rows are surfaced explicitly for clarity (deduped against the engine list), matching the interactive/modelpicker. Efforts include whatever the engine reports (e.g.xhigh/max).gpt-5.4[high]), so it shows a single combined model list and no separate effort.CodeSessionand 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/agentEffortonCodeSession;CodeAgentModelOptions;codeMode:listModelOptionsIPC; create/update schemas.core:AcpClient.setModel/setEffort+describeModelOptions(reads engineconfigOptionsand falls back tomodels);CodeModeManager.listModelOptions(cached discovery) + per-turn apply;CodeSessionServicepersists + passes through.renderer: cachedfetchCodeAgentOptionshelper; dialog + header dropdowns.Testing
gpt-5.x[effort]list; selections apply on the next turn.npm run deps+ renderer/maintscall clean.