Repository navigation
Conversation
The /status command and session_status tool only read from agents.defaults when building the status card, ignoring per-agent thinkingDefault/verboseDefault/elevatedDefault overrides from agents.list[] entries. This causes the status to show "Think: off" even when a per-agent thinkingDefault is correctly configured and applied to API calls. Resolve the per-agent config via resolveAgentConfig() and prefer its values over global defaults when passing to buildStatusMessage(). Closes openclaw#53826
Greptile SummaryThis PR fixes the However, the
The fix requires adding Confidence Score: 3/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/auto-reply/reply/commands-status.ts
Line: 230-231
Comment:
**`verboseDefault`/`elevatedDefault` always `undefined` from `agentEntry`**
`resolveAgentConfig()` returns a `ResolvedAgentConfig` object that explicitly omits both `verboseDefault` and `elevatedDefault` — neither field is in the `ResolvedAgentConfig` type definition nor in the constructed return value in `agent-scope.ts`:
```ts
// agent-scope.ts — returned object (lines 130–150)
return {
thinkingDefault: entry.thinkingDefault, // ✅ present
// verboseDefault is never set here
// elevatedDefault is never set here
};
```
As a result, `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` will always be `undefined` at runtime, so both lines always fall through to `agentDefaults.verboseDefault` / `agentDefaults.elevatedDefault`. The per-agent override is silently ignored for these two fields — the same root-cause bug the PR aims to fix for `thinkingDefault`.
To complete the fix, `verboseDefault` and `elevatedDefault` need to be added to the `ResolvedAgentConfig` type and populated in `resolveAgentConfig()`:
```ts
// agent-scope.ts — ResolvedAgentConfig type
type ResolvedAgentConfig = {
// ...existing fields...
thinkingDefault?: AgentEntry["thinkingDefault"];
verboseDefault?: AgentEntry["verboseDefault"]; // add
elevatedDefault?: AgentEntry["elevatedDefault"]; // add
};
// resolveAgentConfig() return object
return {
// ...existing fields...
thinkingDefault: entry.thinkingDefault,
verboseDefault: entry.verboseDefault, // add
elevatedDefault: entry.elevatedDefault, // add
};
```
The same issue exists in `src/agents/tools/session-status-tool.ts` at lines 487–488.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(status): merge per-agent thinkingDef..." | Re-trigger Greptile |
| verboseDefault: agentEntry?.verboseDefault ?? agentDefaults.verboseDefault, | ||
| elevatedDefault: agentEntry?.elevatedDefault ?? agentDefaults.elevatedDefault, |
There was a problem hiding this comment.
verboseDefault/elevatedDefault always undefined from agentEntry
resolveAgentConfig() returns a ResolvedAgentConfig object that explicitly omits both verboseDefault and elevatedDefault — neither field is in the ResolvedAgentConfig type definition nor in the constructed return value in agent-scope.ts:
// agent-scope.ts — returned object (lines 130–150)
return {
thinkingDefault: entry.thinkingDefault, // ✅ present
// verboseDefault is never set here
// elevatedDefault is never set here
};As a result, agentEntry?.verboseDefault and agentEntry?.elevatedDefault will always be undefined at runtime, so both lines always fall through to agentDefaults.verboseDefault / agentDefaults.elevatedDefault. The per-agent override is silently ignored for these two fields — the same root-cause bug the PR aims to fix for thinkingDefault.
To complete the fix, verboseDefault and elevatedDefault need to be added to the ResolvedAgentConfig type and populated in resolveAgentConfig():
// agent-scope.ts — ResolvedAgentConfig type
type ResolvedAgentConfig = {
// ...existing fields...
thinkingDefault?: AgentEntry["thinkingDefault"];
verboseDefault?: AgentEntry["verboseDefault"]; // add
elevatedDefault?: AgentEntry["elevatedDefault"]; // add
};
// resolveAgentConfig() return object
return {
// ...existing fields...
thinkingDefault: entry.thinkingDefault,
verboseDefault: entry.verboseDefault, // add
elevatedDefault: entry.elevatedDefault, // add
};The same issue exists in src/agents/tools/session-status-tool.ts at lines 487–488.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/auto-reply/reply/commands-status.ts
Line: 230-231
Comment:
**`verboseDefault`/`elevatedDefault` always `undefined` from `agentEntry`**
`resolveAgentConfig()` returns a `ResolvedAgentConfig` object that explicitly omits both `verboseDefault` and `elevatedDefault` — neither field is in the `ResolvedAgentConfig` type definition nor in the constructed return value in `agent-scope.ts`:
```ts
// agent-scope.ts — returned object (lines 130–150)
return {
thinkingDefault: entry.thinkingDefault, // ✅ present
// verboseDefault is never set here
// elevatedDefault is never set here
};
```
As a result, `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` will always be `undefined` at runtime, so both lines always fall through to `agentDefaults.verboseDefault` / `agentDefaults.elevatedDefault`. The per-agent override is silently ignored for these two fields — the same root-cause bug the PR aims to fix for `thinkingDefault`.
To complete the fix, `verboseDefault` and `elevatedDefault` need to be added to the `ResolvedAgentConfig` type and populated in `resolveAgentConfig()`:
```ts
// agent-scope.ts — ResolvedAgentConfig type
type ResolvedAgentConfig = {
// ...existing fields...
thinkingDefault?: AgentEntry["thinkingDefault"];
verboseDefault?: AgentEntry["verboseDefault"]; // add
elevatedDefault?: AgentEntry["elevatedDefault"]; // add
};
// resolveAgentConfig() return object
return {
// ...existing fields...
thinkingDefault: entry.thinkingDefault,
verboseDefault: entry.verboseDefault, // add
elevatedDefault: entry.elevatedDefault, // add
};
```
The same issue exists in `src/agents/tools/session-status-tool.ts` at lines 487–488.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b92207b11a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
verboseDefault and elevatedDefault don't exist on per-agent config (AgentConfig type) — they're only on AgentDefaultsConfig. The resolveAgentConfig() return type doesn't include them either, so the override was always a no-op. Keep those on agentDefaults only.
|
CI note: The The actual code changes (2 files: |
|
Thanks for the earlier per-agent I folded the overlapping status-display work from #53850 into #55425 and added I’m consolidating on #55425 so the runtime-model fix and the per-agent thinking fix land together in one path, along with the follow-up review correction on the PR: #55425 |
Summary
/statuscommand andsession_statustool now respect per-agentthinkingDefault,verboseDefault, andelevatedDefaultfromagents.list[]entriesagents.defaults, causing the status to show "Think: off" even when a per-agent override was correctly configured and applied to API callsChange Type
Scope
Linked Issue/PR
Closes #53826
Related: #21097, #28041, #26909
Root Cause
Both
commands-status.tsandsession-status-tool.tsconstruct theagentobject forbuildStatusMessage()using onlycfg.agents?.defaults:Meanwhile the actual reply flow in
model-selection.tscorrectly resolves per-agent config viaresolveAgentConfig()and checksagentEntry?.thinkingDefaultfirst.Fix
Resolve the per-agent config via
resolveAgentConfig()in both callers and prefer per-agent values over global defaults:Files Changed
src/auto-reply/reply/commands-status.ts—/statuscommandsrc/agents/tools/session-status-tool.ts—session_statustoolSecurity Impact
Testing
corepack pnpm exec vitest run src/agents/openclaw-tools.session-status.test.ts— 15/15 passcorepack pnpm exec vitest run src/auto-reply/status.test.ts— 40/42 pass (2 pre-existing failures unrelated to this change)tsc --noEmitreports no errors in either file)Repro + Verification
{ "agents": { "list": [{ "id": "kira", "model": "openai-codex/gpt-5.4", "thinkingDefault": "xhigh" }] } }/statusshows "Think: off"/statusshows "Think: xhigh"Compatibility / Migration