Repository navigation
refactor(config): retire per-agent agentRuntime and compaction from the authored config type - #164586
Conversation
…n from the authored config type AgentConfig still declared agent-level `agentRuntime` and `compaction` after strict schema parsing began rejecting both, so `satisfies OpenClawConfig` kept admitting fixtures and writers that validation refuses. This is the same trap the agents.list/default cutover closed. The authored type now omits both keys. The Doctor-owned legacy types in src/config/legacy.roster.ts carry them instead: one shared set of retired entry fields (default, agentRuntime, compaction) backs both LegacyAgentListEntry and the agents.entries record of OpenClawConfigWithLegacyRoster, which stays structurally assignable to OpenClawConfig. Readers: - resolveAgentConfig no longer projects agentRuntime; validated entries cannot carry it. - The system-agent inference route drops its dead per-agent runtime snapshot; per-model policy already owns that decision. - The retired whole-agent runtime opt-out (#108683) still guards implicit Codex plugin installation for pre-admission source config (update, Doctor repair). It moves from the SDK-reachable agent-runtime-id module into a private openai-routing helper typed with the legacy config, so the Doctor type stays out of the public SDK declaration closure. - Doctor and migration readers already used the legacy type or raw records. Fixtures: the agents_list tool fixture drops a per-agent runtime that its per-model policy already overrode, and the test that fed the runtime a rejected per-agent key is removed. The routing opt-out test now types its legacy input as OpenClawConfigWithLegacyRoster. Plugin SDK impact: type-only. OpenClawConfig agent entries lose the two keys, and the resolveAgentConfig return type (openclaw/plugin-sdk/agent-runtime, agent-scope-runtime) loses agentRuntime. No bundled plugin reads either agent-level key, and validated configs never held a value, so no compatibility record is needed. plugin-sdk:api:diff acknowledgement digest 79f700a9; docs/plugins/sdk-migration/how-to-migrate.md documents the canonical owners.
|
🦞👀 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. |
|
|
Codex review: blocked before merge. Reviewed October 3, 2026, 6:40 PM ET / 22:40 UTC. ClawSweeper reviewWhat this changesThe PR removes retired per-agent runtime and compaction fields from authored configuration types and resolved agent configuration while preserving legacy readers used before admission. Merge readiness⛔ Blocked before merge - 1 item remains This remains useful: current main still permits the rejected fields in its authored types. No blocking correctness or security defect was found, and the documented SDK narrowing has explicit maintainer intent. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw configuration types guide developers and plugins authoring agent settings. Strict validation admits supported settings, while Doctor and update preparation retain separate readers for legacy input. flowchart TD
A[Developer and plugin configuration] --> B[Authored configuration types]
B --> C[Strict configuration validation]
C --> D[Agent runtime settings]
E[Legacy stored configuration] --> F[Doctor and update preparation]
F --> C
F --> G[Runtime plugin installation decision]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests -32, Docs +5. Total -26 across 10 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep authored types aligned with strict validation, with legacy input confined to Doctor and pre-admission preparation. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main's AgentConfig permits two properties absent from the strict agent-entry schema. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes. Removing the invalid authored fields and retaining a private legacy reader matches the existing validation and migration ownership without adding another runtime compatibility path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 67ab6f3104fd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Config compatibility and upgrade impact, confirmed by the maintainer before merge:
|
|
Merged via squash.
|
…n from the authored config type (openclaw#164586) AgentConfig still declared agent-level `agentRuntime` and `compaction` after strict schema parsing began rejecting both, so `satisfies OpenClawConfig` kept admitting fixtures and writers that validation refuses. This is the same trap the agents.list/default cutover closed. The authored type now omits both keys. The Doctor-owned legacy types in src/config/legacy.roster.ts carry them instead: one shared set of retired entry fields (default, agentRuntime, compaction) backs both LegacyAgentListEntry and the agents.entries record of OpenClawConfigWithLegacyRoster, which stays structurally assignable to OpenClawConfig. Readers: - resolveAgentConfig no longer projects agentRuntime; validated entries cannot carry it. - The system-agent inference route drops its dead per-agent runtime snapshot; per-model policy already owns that decision. - The retired whole-agent runtime opt-out (openclaw#108683) still guards implicit Codex plugin installation for pre-admission source config (update, Doctor repair). It moves from the SDK-reachable agent-runtime-id module into a private openai-routing helper typed with the legacy config, so the Doctor type stays out of the public SDK declaration closure. - Doctor and migration readers already used the legacy type or raw records. Fixtures: the agents_list tool fixture drops a per-agent runtime that its per-model policy already overrode, and the test that fed the runtime a rejected per-agent key is removed. The routing opt-out test now types its legacy input as OpenClawConfigWithLegacyRoster. Plugin SDK impact: type-only. OpenClawConfig agent entries lose the two keys, and the resolveAgentConfig return type (openclaw/plugin-sdk/agent-runtime, agent-scope-runtime) loses agentRuntime. No bundled plugin reads either agent-level key, and validated configs never held a value, so no compatibility record is needed. plugin-sdk:api:diff acknowledgement digest 79f700a9; docs/plugins/sdk-migration/how-to-migrate.md documents the canonical owners.
…thored config type (#165014) * refactor(config): remove retired agents.defaults keys from the authored config type AgentDefaultsConfig still declared nine keys that the strict agents.defaults schema rejects (imageGenerationModel, videoGenerationModel, musicGenerationModel, envelopeTimezone, envelopeTimestamp, envelopeElapsed, timeFormat, promptOverlays, agentRuntime), so `satisfies OpenClawConfig` admitted fixtures and writers that validation refuses. This is the same trap the agents.list/default (#164103) and per-agent agentRuntime/compaction (#164586) cutovers closed. The authored type now omits all nine. The Doctor-owned OpenClawConfigWithLegacyRoster in src/config/legacy.roster.ts carries them as retired defaults fields, each naming what Doctor does and the canonical owner. It stays structurally assignable to OpenClawConfig, so Doctor and pre-admission fixtures need no casts. Readers: - The system-agent inference route no longer snapshots a defaults-level agentRuntime; per-model policy already travels in the projected model map. - current-time drops an unused timeFormat field from its local config shape. - The private retired whole-agent runtime opt-out in openai-routing keeps reading agents.defaults.agentRuntime through the legacy type for pre-admission plugin repair. - The WhatsApp test envelope mock honored the retired envelope toggles; it now mirrors resolveEnvelopeFormatOptions (timezone from userTimezone, timestamps and elapsed time always on). - The test-only shim that translated legacy media keys is removed; the image, video, and music tool tests author agents.defaults.mediaModels. Fixtures move to canonical owners: mediaModels.{image,video,music}, userTimezone instead of envelope/time-format toggles, and per-model models[ref].agentRuntime. Runtime-selection tests now configure the per-model runtime they exercise instead of an inert defaults key. Doctor and migration tests keep raw legacy inputs typed as OpenClawConfigWithLegacyRoster; media model migration coverage moves to legacy-config-migrate.media-models.test.ts and two test helpers move to support modules to stay under line caps. dead-config-keys now also asserts that validation rejects agents.defaults.agentRuntime, so all nine keys have runtime rejection coverage. Plugin SDK impact: type-only. OpenClawConfig agents.defaults loses the nine keys; no bundled plugin reads them and validated configs never hold them. plugin-sdk:api:diff confirms legacy.roster stays outside the public declaration closure. docs/plugins/sdk-migration/how-to-migrate.md names the canonical owners. * docs(plugins): route stored agents.defaults.agentRuntime through the intermediate upgrade Doctor refuses a stored agents.defaults.agentRuntime as a retired format (findRetiredConfigUpgradeRequirement), so the blanket doctor --fix guidance in the SDK migration paragraph did not hold for that key. Point it at the existing upgrade-through-2026.9.5 instructions.
…thored config type (openclaw#165014) * refactor(config): remove retired agents.defaults keys from the authored config type AgentDefaultsConfig still declared nine keys that the strict agents.defaults schema rejects (imageGenerationModel, videoGenerationModel, musicGenerationModel, envelopeTimezone, envelopeTimestamp, envelopeElapsed, timeFormat, promptOverlays, agentRuntime), so `satisfies OpenClawConfig` admitted fixtures and writers that validation refuses. This is the same trap the agents.list/default (openclaw#164103) and per-agent agentRuntime/compaction (openclaw#164586) cutovers closed. The authored type now omits all nine. The Doctor-owned OpenClawConfigWithLegacyRoster in src/config/legacy.roster.ts carries them as retired defaults fields, each naming what Doctor does and the canonical owner. It stays structurally assignable to OpenClawConfig, so Doctor and pre-admission fixtures need no casts. Readers: - The system-agent inference route no longer snapshots a defaults-level agentRuntime; per-model policy already travels in the projected model map. - current-time drops an unused timeFormat field from its local config shape. - The private retired whole-agent runtime opt-out in openai-routing keeps reading agents.defaults.agentRuntime through the legacy type for pre-admission plugin repair. - The WhatsApp test envelope mock honored the retired envelope toggles; it now mirrors resolveEnvelopeFormatOptions (timezone from userTimezone, timestamps and elapsed time always on). - The test-only shim that translated legacy media keys is removed; the image, video, and music tool tests author agents.defaults.mediaModels. Fixtures move to canonical owners: mediaModels.{image,video,music}, userTimezone instead of envelope/time-format toggles, and per-model models[ref].agentRuntime. Runtime-selection tests now configure the per-model runtime they exercise instead of an inert defaults key. Doctor and migration tests keep raw legacy inputs typed as OpenClawConfigWithLegacyRoster; media model migration coverage moves to legacy-config-migrate.media-models.test.ts and two test helpers move to support modules to stay under line caps. dead-config-keys now also asserts that validation rejects agents.defaults.agentRuntime, so all nine keys have runtime rejection coverage. Plugin SDK impact: type-only. OpenClawConfig agents.defaults loses the nine keys; no bundled plugin reads them and validated configs never hold them. plugin-sdk:api:diff confirms legacy.roster stays outside the public declaration closure. docs/plugins/sdk-migration/how-to-migrate.md names the canonical owners. * docs(plugins): route stored agents.defaults.agentRuntime through the intermediate upgrade Doctor refuses a stored agents.defaults.agentRuntime as a retired format (findRetiredConfigUpgradeRequirement), so the blanket doctor --fix guidance in the SDK migration paragraph did not hold for that key. Point it at the existing upgrade-through-2026.9.5 instructions.
Related: #164103
What Problem This Solves
The authored config type still declared per-agent
agentRuntimeandcompaction, which config validation rejects, so typed fixtures and config writers could author agent entries that Gateway startup then refuses.User Impact
No user-visible change. Developers and plugin authors get a type error instead of a startup rejection when they put
agentRuntimeorcompactionon an agent entry; per-modelmodels[ref].agentRuntimeandagents.defaults.compactionremain the supported owners. Type-only Plugin SDK change, documented in the SDK migration guide.Why This Change Was Made
Same cutover as #164103, applied to the two remaining rejected agent-entry keys. The authored type drops them; Doctor and pre-admission readers use the existing Doctor-owned legacy config type, which now carries one shared set of retired entry fields (
default,agentRuntime,compaction) and stays structurally assignable toOpenClawConfig.Readers, fixtures, and SDK impact
resolveAgentConfigstops projectingagentRuntime; validated entries cannot carry it. The system-agent inference route drops its dead per-agent runtime snapshot (per-model policy already owns it). The Control UI drops an unusedagentRuntimefield from a local config subset; its runtime labels come from Gateway metadata.agent-runtime-idmodule into a privateopenai-routinghelper typed with the legacy config, so the Doctor-owned type stays out of the public SDK declaration closure.plugin-sdk:api:diffconfirmed no legacy types are reachable.agents_listtool fixture drops a per-agent runtime its per-model policy already overrode; the test that fed the runtime a rejected per-agent key is removed (validation makes that input impossible). The routing opt-out test types its legacy input asOpenClawConfigWithLegacyRoster.OpenClawConfigagent entries lose both keys and theresolveAgentConfigreturn type (openclaw/plugin-sdk/agent-runtime,agent-scope-runtime) losesagentRuntime. No bundled plugin reads either agent-level key, and validated configs never held a value, so no compatibility record is added. API diff acknowledgement digest:79f700a9(pre-rebase).Follow-up:
AgentDefaultsConfigstill declares Doctor-only legacy keys (including its ownagentRuntime); tracked separately.Evidence
Blacksmith Testbox, on the exact rebased head:
pnpm run tsgo:corepnpm run tsgo:uipnpm run tsgo:extensionspnpm run tsgo:extensions:testoxfmt --checkon the 10 changed filesHead
eadb43cc91af, leasetbx_01m41wekd2qe2jr6jq2k1ph533. Thetsgo:test:{src,packages,ui,root}shards passed on the identical pre-rebase patch (734 / 33 / 235 / 163 s, leasetbx_01m40d0x3ezex3fg76qd6ck9mm); the exact-head shard rerun is queued on Testbox and PR CI runs the same shards.Before the rebase (same patch stacked on the pre-landing #164103 commit), the same lanes passed, plus
pnpm run plugin-sdk:api:diff(5 reachable declarations changed:AgentConfig,ResolvedAgentConfig, and the opt-out helper leavingagent-runtime-id; no legacy roster types reachable) and a Codex autoreview (scoped-clean).No new tests. One test removed; one fixture retyped.