Repository navigation
feat(ui): edit an agent's thinking default from its Overview - #198399
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
The agent Overview showed the thinking default as plain text. It is now a select in Model selection with the levels the agent's model accepts and an inherit option; choices save to agents.entries.<id>.thinkingDefault.
2c1e31e to
0dcfb36
Compare
|
Codex review: blocked before merge. What this changesAdds an agent-specific thinking-default selector with supported levels, inheritance, and existing configuration autosave. Example: The coder agent has Medium, its model default is High, and the global default is Low.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it provides a coherent editor still absent from main, with no actionable patch defects found; its placement needs a maintainer product decision. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Gateway resolves model thinking capabilities and inherited defaults into agents.list; Agents Overview presents those facts and writes the existing per-agent setting through the shared configuration owner. flowchart LR
Config[Agent configuration] --> Resolver[Shared thinking resolver]
Resolver --> Roster[Gateway agent roster]
Roster --> Overview[Agents Overview selector]
Overview --> Actions[Existing configuration actions]
Actions --> Config
Technical reviewBest possible solution: If maintainers approve the placement, retain this focused selector using existing configuration ownership and Gateway-resolved thinking capabilities. Do we have a high-confidence way to reproduce the issue? Current main source confirms the missing editor, and the supplied stable screenshot shows the read-only value; no reviewer-run reproduction was performed. Is this the best way to solve the issue? The implementation is appropriately scoped: it reuses configuration actions and the shared resolver, preserves saved unsupported values, and shares label formatting across both consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 281c2bcd554b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +102, Tests +198. Total +300 across 17 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 13, 2026, 10:41 PM ET / November 14, 2026, 03:41 UTC (Revision 4). |
The Inherit default option named agents.defaults.thinkingDefault, but the runtime resolves per-model params before the global default. agents.list rows with an agent-level thinkingDefault now carry thinkingInheritedDefault, resolved by the same Gateway resolver without that override, and the Overview labels the inherit option with it.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
A model-restricted roster drops thinkingInheritedDefault and reports the agent's own override as thinkingDefault, so the Overview read the override as the inherited level. With an override and no inherited level, the inherit option now names no level. The Gateway test covers the real projected restricted roster.
|
Live proof at 1. Upgrade from latest stable (2026.11.3) on the same state and config Stable shows coder's thinking default as a read-only fact: The update then ran
Choosing Inherit default (High) removed 2. Model-restricted operator (the P2 path) Same config on the branch, with
Not covered here: CI on this head is waiting for maintainer approval to run. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Standard levels use the quickSettings.model.thinkingLevels names the Models page uses; the five standard levels without a key gain canonical English. The protocol changelog entry moves to the PR description.
The agent Overview and the Models page each had their own label helper. Both now use thinkingLevelLabel from lib/chat/thinking.ts with their reactive translator, so labels follow locale changes and every standard level uses its translated name.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…lt-editor-clear # Conflicts: # src/gateway/session-utils-store.ts
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…w#198399) * feat(ui): edit an agent's thinking default from its Overview The agent Overview showed the thinking default as plain text. It is now a select in Model selection with the levels the agent's model accepts and an inherit option; choices save to agents.entries.<id>.thinkingDefault. * fix(ui): name the level an agent's thinking override falls back to The Inherit default option named agents.defaults.thinkingDefault, but the runtime resolves per-model params before the global default. agents.list rows with an agent-level thinkingDefault now carry thinkingInheritedDefault, resolved by the same Gateway resolver without that override, and the Overview labels the inherit option with it. * fix(ui): name no inherited thinking level when the roster omits it A model-restricted roster drops thinkingInheritedDefault and reports the agent's own override as thinkingDefault, so the Overview read the override as the inherited level. With an override and no inherited level, the inherit option now names no level. The Gateway test covers the real projected restricted roster. * fix(ui): translate thinking level names on the agent Overview Standard levels use the quickSettings.model.thinkingLevels names the Models page uses; the five standard levels without a key gain canonical English. The protocol changelog entry moves to the PR description. * refactor(ui): share one thinking level label helper The agent Overview and the Models page each had their own label helper. Both now use thinkingLevelLabel from lib/chat/thinking.ts with their reactive translator, so labels follow locale changes and every standard level uses its translated name. * perf(ui): keep the thinking level label helper out of chat boot JS




Closes #198371
What Problem This Solves
The agent Overview page shows an agent's Thinking default as plain text, so setting one agent's level (for example a
coderagent) means using the config editor or the CLI.User Impact
Operators who can edit config can pick an agent's thinking default in Agents → agent → Overview → Model selection. The menu lists only the levels that agent's model accepts, plus Inherit default (level), which removes the agent's own setting. Choices save to
agents.entries.<id>.thinkingDefaultthrough the page's existing autosave and affect only that agent. Message and session thinking overrides still take precedence.Why This Change Was Made
agents.list(thinkingLevels), which the Gateway already resolves for that agent's model and runtime.agents.listagent rows gain an optionalthinkingInheritedDefault. The Gateway sends it only when the agent sets its ownthinkingDefault. It is the level that clearing the override resolves to, using the same resolver as runs: per-agent model params, shared model params, the global default, the model's own default, then clamping to the model's levels. The core resolver gains an option to skip only the agent's ownthinkingDefault. Existing clients can ignore the field; the Swift and Kotlin protocol contracts are unchanged. The protocol changelog is release-owned, so this description records the schema change.thinkingInheritedDefaultalong with the other thinking fields, because it is resolved from the agent's hidden model. TheirthinkingDefaultis the agent's own override, so with an override and no inherited level the option reads plain Inherit default and names no level.thinkingInheritedDefault, or the agent's resolved level when it has no override. Example: global Low, a per-model param of High and an agent override of Medium give "Inherit default (High)", which is what clearing produces.thinkingLevelLabelinui/src/lib/chat/thinking-level-label.ts, which this page and the Models page share. It has its own module so it stays out of chat boot JS (the Control UI performance check counts every byte there). It uses thequickSettings.model.thinkingLevels.*translations through each page's reactive translator. The five standard levels that had no key (Minimal, Extra high, Adaptive, Maximum, Ultra) gain canonical English, and the translation pipeline supplies other locales. Provider-specific levels keep their own label.Known gaps:
Evidence
Live run on an isolated Gateway built from this branch, inside a macOS VM, with made-up config: agent
coderon a stand-in reasoning model. A headless browser drove the Control UI, and the script checked the config file after each step.Before choosing: the menu offers
Inherit default (Medium),Off,Minimal,Low,Medium,High,Ultra.This frame is from the run before the label-only fix; that fix does not change this frame.
Before
After
After choosing High, the config file has
agents.entries.coder.thinkingDefault: "high"andagents.defaultsis unchanged; after a page reload the row still shows High:Choosing Inherit default again removes the key from
agents.entries.coder; after a reload the row reads Inherit default (Medium):Second live run, same VM setup: global Low, a per-model
params.thinkingof High, and coder's own Medium.openclaw doctor --fix --non-interactivewith this build, then starts on the same state. coder's entry and the defaults are unchanged.agents.listreportsthinkingDefault: "medium"andthinkingInheritedDefault: "high", and the inherit option reads "Inherit default (High)". Choosing it removes the override, and after a reload the agent resolves to High.modelPolicy.allow: ["standin/stand-in"]and admin scope. The projected roster carries the override asthinkingDefaultwith no inherited field, and the inherit option reads plain "Inherit default".Tests and checks:
ui/src/pages/agents/panels-overview.test.ts: 21 passed;ui/src/pages/agents/model-config.test.ts: 13 passed; the Models page view, locale and page tests andui/src/lib/chat/thinking.test.tspass with the shared helper. They cover the levels offered, saving and clearing, inherited labels (global Low, per-model High and override Medium labelled "Inherit default (High)"; the same override on a restricted roster labelled plain "Inherit default"), a saved level the model does not offer, a restricted model catalog, and the disabled state without config. The tests that pinned the row as a read-only fact were replaced.src/gateway/session-utils.agent-models.test.ts:agents.listreportsthinkingInheritedDefault: "high"for that case and omits it for an agent without an override; the real restricted projection of that roster drops the field and reportsthinkingDefault: "medium". The UI and Gateway tests each fail without their fix and pass with it.src/gateway/session-utils-model.thinking-default.test.ts,src/gateway/server-methods/agents-list.test.tsandpackages/gateway-protocol/src/schema/agents-models-skills.test.ts: pass.pnpm tsgo:ui,pnpm tsgo:core, the gateway test typecheck, oxlint and format on the touched files,pnpm ui:i18n:verifyandpnpm protocol:check(Swift and Kotlin contracts unchanged): pass. In a German locale the selector reads "Inherit default (Hoch)", "Aus", "Niedrig", "Mittel", "Hoch".