feat: scope thinking effort to the current session#1933
Conversation
Selecting a model or thinking mode in the TUI or web UI no longer persists the concrete effort to the config; only the boolean thinking toggle is saved. The web UI now restores and submits each session's own daemon-reported level instead of a browser-wide per-model pick, whose localStorage store is removed.
🦋 Changeset detectedLatest commit: f128c9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a358fdadc1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Only low/medium/high/xhigh are written to the config on a pick; max and unrecognized levels stay session-only with just the boolean toggle saved. A one-shot migration rewrites a previously persisted thinking.effort max to high (recorded in migrations.json, never re-run). The web UI brings back the per-model localStorage pick as the seed for new sessions, while a session's own daemon-reported level keeps winning for existing ones.
The session-only tier is now the last entry of the model's own support_efforts (ordered by strength) instead of a fixed name list, so custom provider-declared levels get the same treatment; anything below the top persists as before, and unknown model metadata keeps the concrete effort.
A raw single-level string left in localStorage by older versions was migrated into a '*' fallback entry applied to every model; stale values (typically max) could silently steer any session. Non-map content is now discarded instead of inherited.
Thinking in the web UI is now sourced only from the daemon: a session's own reported level wins when the model declares it, and everything else falls back to the model's catalog default. The stale localStorage key is cleaned up on startup.
Re-confirming the effort shown when the model/effort picker opened is not an explicit choice: the TUI persists only the model (no effort key, or no write at all when nothing changed), and the web skips the global config write the same way it already did for model switches.
Only the TUI skips the effort write when the picker confirms its initial value; the web behavior stays unchanged until the interaction is reconsidered.
A level picked on the empty composer lived only in rawState.thinking, so selectSession's watcher overwrote it with the catalog default and the first prompt/skill submitted that instead of the pick. createDraftSession now captures the draft level and seeds the new session's own entry.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f73ca43471
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The provider-add default-model flow now resolves support_efforts through effectiveModelForHost (overrides + protocol-profile inference), so a top-tier pick on catalog models without declared efforts no longer persists. The draft thinking level is captured before the session creation awaits, so a concurrent session switch can no longer seed the new session with another session's effort.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa29064ff6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
In the cold window right after a reload or session switch, the session's own level has not landed from /status yet; resolving straight to the catalog default would carry the wrong level to the daemon, which writes it into the session profile. Send, steer, side-chat and skill-activation paths now await the fold when the session entry is missing.
Upstream changes: - feat(cli): replace kimi server command tree with kimi web (MoonshotAI#1826) - Removed daemon/server lifecycle (svc/ layer for launchd/systemd/schtasks) - Multi-server instance registry replaces single-writer lock - /web TUI command uses server picker instead of daemon logic - feat(minidb): switch agent-core-v2 query-store to ClusterDb with 16 shards (MoonshotAI#1907) - Multiple kimi processes can share the read model concurrently - feat: scope thinking effort to current session (MoonshotAI#1933) - feat: add thinking_effort to turn telemetry events (MoonshotAI#1916) - fix(agent-core-v2): host fs stat follows symlinks, add explicit lstat (MoonshotAI#1843) - feat(web): add cache invalidation note to model switcher (MoonshotAI#1940) - ci: release packages (MoonshotAI#1868) Conflicts resolved: - 9 modify/delete conflicts: accepted upstream deletion (server/*, svc/*) - 6 content conflicts: merged while preserving fork's i18n t() calls and fork-specific test suites (config edge cases)
Related Issue
None — the problem is explained below.
Problem
Thinking effort used to be persisted wholesale: any pick in the TUI or the web UI wrote the concrete effort to
thinking.effortin config.toml as the global default for every future session, and the web UI additionally kept the level as a browser-wide per-model pick that leaked across sessions. Pickingmaxonce made every new session run atmaxforever; pickinghighin one session silently changed what an older session displayed and submitted.What changed
support_efforts). The top tier is session-only — only the booleanthinking.enabledtoggle is saved, so the most expensive level never becomes the default for every new session. A manually configuredthinking.effortis still honored.thinking.effort = "max"is rewritten to"high"exactly once per installation (recorded inmigrations-effort.json); amaxwritten by hand afterwards is left alone.KIMI_MODEL_THINKING_EFFORTstays a pure runtime override and can never reach config.toml (covered by existing round-trip tests).Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. (Docs only describe the[thinking]config fields, which remain valid; the persistence policy of UI picks was not documented.)