config: accept per-agent verboseDefault and elevatedDefault overrides (#73680)#74643
config: accept per-agent verboseDefault and elevatedDefault overrides (#73680)#74643lonexreb wants to merge 4 commits intoopenclaw:mainfrom
Conversation
ab3939a to
f24402d
Compare
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Source inspection shows current main still rejects Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land one aligned fix that accepts the per-agent keys, resolves them consistently across reply and direct agent paths, uses valid enum coverage, updates the changelog, and includes real CLI/runtime proof. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main still rejects Is this the best way to solve the issue? No. The schema/docs/reply changes are the right direction, but the proposed patch is incomplete until direct agent command runs consume selected-agent defaults and the tests/changelog/proof are cleaned up. Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a17d4371d101. |
…er (openclaw#73680) Address Codex P3 finding on PR openclaw#74643. The /verbose directive section previously only mentioned session/global defaults; now that agents.list[].verboseDefault is accepted, the directive page lists the full resolution order to match the reasoning section.
…er (openclaw#73680) Address Codex P3 finding on PR openclaw#74643. The /verbose directive section previously only mentioned session/global defaults; now that agents.list[].verboseDefault is accepted, the directive page lists the full resolution order to match the reasoning section.
3135181 to
ec802fe
Compare
…directive resolution Codex review on PR openclaw#74643 found that schema/types/docs accept `verboseDefault` and `elevatedDefault` per-agent (under `agents.list[]`), but the runtime resolver still falls back to global `agentCfg` defaults — `getReply` passes `cfg.agents?.defaults` as `agentCfg`, so per-agent values were stored but never read on actual replies. The reasoning/fastMode paths already consult `agentEntry` first; verbose and elevated did not. Wire the same agentEntry-first precedence for verbose and elevated: - `src/auto-reply/reply/directive-handling.levels.ts`: extend the `agentEntry` parameter type with `verboseDefault`/`elevatedDefault`, and check `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` before falling back to `agentCfg?.*`. - `src/auto-reply/reply/get-reply-directives.ts`: same agentEntry-first fallback for `resolvedVerboseLevel` and `resolvedElevatedLevel`. Session and explicit-directive precedence preserved. Add 6 regression tests in `directive-handling.levels.test.ts`: - per-agent verboseDefault wins over agentCfg verboseDefault - agentCfg verboseDefault still applies when agentEntry is absent - session verboseLevel wins over per-agent verboseDefault - per-agent elevatedDefault wins over agentCfg elevatedDefault - agentCfg elevatedDefault still applies when agentEntry is absent - session elevatedLevel wins over per-agent elevatedDefault Refs openclaw#73680
|
P2 review addressed in 423b321. The bot was right — the schema/types changes alone left the per-agent values stored but ignored at runtime, so #73680 was only partially fixed. Wired
Added 6 regression cases in
Acceptance criteria checked locally:
PTAL. |
…er (openclaw#73680) Address Codex P3 finding on PR openclaw#74643. The /verbose directive section previously only mentioned session/global defaults; now that agents.list[].verboseDefault is accepted, the directive page lists the full resolution order to match the reasoning section.
423b321 to
5fa4c2a
Compare
…directive resolution Codex review on PR openclaw#74643 found that schema/types/docs accept `verboseDefault` and `elevatedDefault` per-agent (under `agents.list[]`), but the runtime resolver still falls back to global `agentCfg` defaults — `getReply` passes `cfg.agents?.defaults` as `agentCfg`, so per-agent values were stored but never read on actual replies. The reasoning/fastMode paths already consult `agentEntry` first; verbose and elevated did not. Wire the same agentEntry-first precedence for verbose and elevated: - `src/auto-reply/reply/directive-handling.levels.ts`: extend the `agentEntry` parameter type with `verboseDefault`/`elevatedDefault`, and check `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` before falling back to `agentCfg?.*`. - `src/auto-reply/reply/get-reply-directives.ts`: same agentEntry-first fallback for `resolvedVerboseLevel` and `resolvedElevatedLevel`. Session and explicit-directive precedence preserved. Add 6 regression tests in `directive-handling.levels.test.ts`: - per-agent verboseDefault wins over agentCfg verboseDefault - agentCfg verboseDefault still applies when agentEntry is absent - session verboseLevel wins over per-agent verboseDefault - per-agent elevatedDefault wins over agentCfg elevatedDefault - agentCfg elevatedDefault still applies when agentEntry is absent - session elevatedLevel wins over per-agent elevatedDefault Refs openclaw#73680
…er (openclaw#73680) Address Codex P3 finding on PR openclaw#74643. The /verbose directive section previously only mentioned session/global defaults; now that agents.list[].verboseDefault is accepted, the directive page lists the full resolution order to match the reasoning section.
…directive resolution Codex review on PR openclaw#74643 found that schema/types/docs accept `verboseDefault` and `elevatedDefault` per-agent (under `agents.list[]`), but the runtime resolver still falls back to global `agentCfg` defaults — `getReply` passes `cfg.agents?.defaults` as `agentCfg`, so per-agent values were stored but never read on actual replies. The reasoning/fastMode paths already consult `agentEntry` first; verbose and elevated did not. Wire the same agentEntry-first precedence for verbose and elevated: - `src/auto-reply/reply/directive-handling.levels.ts`: extend the `agentEntry` parameter type with `verboseDefault`/`elevatedDefault`, and check `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` before falling back to `agentCfg?.*`. - `src/auto-reply/reply/get-reply-directives.ts`: same agentEntry-first fallback for `resolvedVerboseLevel` and `resolvedElevatedLevel`. Session and explicit-directive precedence preserved. Add 6 regression tests in `directive-handling.levels.test.ts`: - per-agent verboseDefault wins over agentCfg verboseDefault - agentCfg verboseDefault still applies when agentEntry is absent - session verboseLevel wins over per-agent verboseDefault - per-agent elevatedDefault wins over agentCfg elevatedDefault - agentCfg elevatedDefault still applies when agentEntry is absent - session elevatedLevel wins over per-agent elevatedDefault Refs openclaw#73680
5fa4c2a to
f0fa64f
Compare
…w#73680) Address Codex review on issue openclaw#73680 follow-ups for the per-agent verbose/elevated defaults schema fix: - Add elevatedDefault to ResolvedAgentConfig and have resolveAgentConfig read entry.elevatedDefault first with fallback to agents.defaults so the resolver actually surfaces the per-agent override. - Document the new per-agent verboseDefault and elevatedDefault keys in agents.list[] config docs and add the per-agent step to the elevated resolution order. - Cover per-agent vs global elevatedDefault precedence in agent-scope unit tests. - Refresh config-baseline.sha256 after the upstream rebase.
…er (openclaw#73680) Address Codex P3 finding on PR openclaw#74643. The /verbose directive section previously only mentioned session/global defaults; now that agents.list[].verboseDefault is accepted, the directive page lists the full resolution order to match the reasoning section.
…directive resolution Codex review on PR openclaw#74643 found that schema/types/docs accept `verboseDefault` and `elevatedDefault` per-agent (under `agents.list[]`), but the runtime resolver still falls back to global `agentCfg` defaults — `getReply` passes `cfg.agents?.defaults` as `agentCfg`, so per-agent values were stored but never read on actual replies. The reasoning/fastMode paths already consult `agentEntry` first; verbose and elevated did not. Wire the same agentEntry-first precedence for verbose and elevated: - `src/auto-reply/reply/directive-handling.levels.ts`: extend the `agentEntry` parameter type with `verboseDefault`/`elevatedDefault`, and check `agentEntry?.verboseDefault` and `agentEntry?.elevatedDefault` before falling back to `agentCfg?.*`. - `src/auto-reply/reply/get-reply-directives.ts`: same agentEntry-first fallback for `resolvedVerboseLevel` and `resolvedElevatedLevel`. Session and explicit-directive precedence preserved. Add 6 regression tests in `directive-handling.levels.test.ts`: - per-agent verboseDefault wins over agentCfg verboseDefault - agentCfg verboseDefault still applies when agentEntry is absent - session verboseLevel wins over per-agent verboseDefault - per-agent elevatedDefault wins over agentCfg elevatedDefault - agentCfg elevatedDefault still applies when agentEntry is absent - session elevatedLevel wins over per-agent elevatedDefault Refs openclaw#73680
f0fa64f to
46380ae
Compare
Summary
AgentEntrySchema(per-agentagents.list[]shape) acceptsthinkingDefault,reasoningDefault, andfastModeDefaultper-agent, but does not declareverboseDefaultorelevatedDefault. The runtime resolver chain already reads both per-agent first and only falls back toagents.defaults.*(see references below). The result:openclaw config set agents.list.0.verboseDefault on(orelevatedDefault) is rejected withUnrecognized key, forcing a global default even when the operator only wants to change one agent.verboseDefault/elevatedDefaultrejected by config schema, despite resolver and SDK types supporting them #73680, the rest of the stack — resolver, plugin-SDK type, status text, command handlers, dispatch fallback — already supports per-agent values; only the strict schema entry blocks them.agents.defaults.*works, but only as a global default.verboseDefaultandelevatedDefaulttoAgentEntrySchemainsrc/config/zod-schema.agent-runtime.tsmirroring the enums already used inAgentDefaultsSchema.elevatedDefaultto theAgentConfigpublic type insrc/config/types.agents.ts(verboseDefaultwas already there).src/config/schema.labels.tsand help text insrc/config/schema.help.ts, mirroring the existing per-agentthinkingDefault/reasoningDefault/fastModeDefaultentries.src/config/schema.base.generated.tsanddocs/.generated/config-baseline.sha256per the repo drift-check workflow.src/config/config.schema-regressions.test.ts(positive case + 2 invalid-enum cases).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
verboseDefault/elevatedDefaultrejected by config schema, despite resolver and SDK types supporting them #73680Root Cause (if applicable)
AgentDefaultsSchemaintoAgentEntrySchema(thinkingDefault,reasoningDefault,fastModeDefault),verboseDefaultandelevatedDefaultwere not promoted. Meanwhile the resolver, status text, dispatch fallback, and SDK type evolved to consume them per-agent, so the schema entry became the only place blocking the durable config path.AgentEntrySchema. This PR adds the most direct kind of regression test for the two specific keys.main):src/agents/agent-scope-config.ts:121—verboseDefault: entry.verboseDefault ?? agentDefaults?.verboseDefaultsrc/auto-reply/reply/dispatch-from-config.ts:375-376—sessionAgentCfg?.verboseDefault ?? cfg.agents?.defaults?.verboseDefaultsrc/auto-reply/reply/get-reply-directives.ts:434,463— readsagentCfg?.verboseDefaultandagentCfg?.elevatedDefaultsrc/auto-reply/reply/directive-handling.persist.ts:145— readsagentCfg?.elevatedDefaultsrc/status/status-message.ts:798,808— readsargs.agent?.verboseDefault/args.agent?.elevatedDefaultsrc/agents/agent-command.ts:602— readsagentCfg?.verboseDefaultRegression Test Plan (if applicable)
src/config/config.schema-regressions.test.tsvalidateConfigObject({ agents: { list: [{ id: "main", verboseDefault: "on", elevatedDefault: "ask" }] } })returns ok.verboseDefault:"loud"is rejected (off|on|full enum).elevatedDefault:"always"is rejected (off|on|ask|full enum).validateConfigObjectcovers both accept and reject paths.Test Plan
pnpm test src/config/config.schema-regressions.test.ts— 21/21 pass (3 new + 18 existing)pnpm check:base-config-schema— clean after regeneratepnpm config:docs:check— clean after regenerate (docs/.generated/config-baseline.sha256updated and committed)pnpm check:changed— clean (typecheck, oxlint, runtime sidecar guard, import-cycle guard, pairing/auth guards)pnpm exec oxfmt --write --threads=1 ...— cleanNotes
AgentDefaultsSchemaexactly (verboseDefault: off|on|full,elevatedDefault: off|on|ask|full), so the per-agent and global surfaces stay aligned.AgentEntrySchemaremains.strict()so unknown per-agent keys continue to fail closed.Real behavior proof