Repository navigation
refactor(config): retire agents.list and default markers from the authored config type - #164103
Merged
Merged
Conversation
… the authored config type The authored OpenClawConfig type still declared AgentsConfig.list and AgentConfig.default after #162612 made config validation reject both, so `satisfies OpenClawConfig` kept admitting fixtures and writers that Gateway startup then refused (#163766, #163623). Production code also read the untyped runtime agents.list projection, which structuredClone drops, so config-mutation drafts and canonical configs silently saw an empty roster. The authored type now rejects both shapes. Doctor and pre-admission migration inputs use the Doctor-owned OpenClawConfigWithLegacyRoster type (src/config/legacy.roster.ts), which stays structurally assignable to OpenClawConfig, so legacy fixtures need no casts. Runtime readers use the roster owners (listAgentEntries, resolveAgentEntry, resolveAgentConfig). Raw default-marker compatibility for raw SDK inputs is unchanged. The non-enumerable runtime agents.list projection is kept, untyped, for plugins built against SDK releases through 2026.9.x and registered as the deprecated compatibility record agent-list-runtime-projection (removal after 2027-01-02), documented in docs/plugins/sdk-migration/how-to-migrate.md. Fixes found by the cutover: - Feishu dynamic agents: lock-time duplicate and maxAgents checks saw an empty cloned roster and wrote an agents.list that validation rejects. - TUI abort, sessions_send, harness compaction preflight, and run-session lookup resolved a default agent even when an explicit owner was known; models.list now uses the ambient owner like models.ts. - ACP session-metadata migration ignored plugin-declared owners; Talk lost configured wake names; per-agent model normalization and model-auth policy cleanup skipped canonical agents.entries. About 1,075 test fixtures now author canonical agents.entries with the explicit per-surface owners Doctor materializes; Doctor/migration tests keep legacy input typed as OpenClawConfigWithLegacyRoster.
Keep runtime fixtures canonical and preserve explicit per-call ownership. Pin the Doctor schema rehearsal session-store owner without restoring an implicit default. Remove file-transfer reload selectors for rejected list and default fields; canonical workspace paths continue to cover roster changes.
…on test The legacy-list case had been converted to keyed entries, duplicating the keyed-roster case. Doctor state migrations receive raw pre-migration config, so restore the raw agents.list input under a plugin-local raw roster type.
Contributor
|
🦞👀 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 QMD cases moved into doctor-contract-api.qmd.test.ts lost the raw pre-Doctor config type, so check-test-types rejected their agents.list fixture. Share RawLegacyDoctorConfig from the test support module and use it in both files.
…es warning The warning reads agents through listAgentEntries, so it now labels configured workspaces as agents.entries.<id>.workspace instead of the retired agents.list path.
Contributor
Author
|
Maintainer confirmation for the two remaining ClawSweeper checklist items on head
|
steipete
added a commit
that referenced
this pull request
Oct 3, 2026
Commit 42e9715 (#164137) made the core outbound media resolver return a bounded native openFile alongside localRoots, readFile, and workspaceDir. Feishu and iMessage forward the core-resolved access to their senders unchanged, but their real-core delivery tests deep-compared it against the caller-supplied object, so both failed deterministically. These files only run in changed-extension PR lanes, so hourly main stayed green (surfaced on PR #164103, run 37132997751). Keep the comparison exact-shape and expect openFile as a function; the identity checks on localRoots and readFile are unchanged. Sibling channel tests that reach the core resolver (Discord, Slack, WhatsApp, Matrix, MSTeams, Telegram, ClickClack, Feishu send authority) already pass.
Contributor
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
This was referenced Oct 3, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 4, 2026
Commit 5c36f7f (openclaw#164137) made the core outbound media resolver return a bounded native openFile alongside localRoots, readFile, and workspaceDir. Feishu and iMessage forward the core-resolved access to their senders unchanged, but their real-core delivery tests deep-compared it against the caller-supplied object, so both failed deterministically. These files only run in changed-extension PR lanes, so hourly main stayed green (surfaced on PR openclaw#164103, run 37132997751). Keep the comparison exact-shape and expect openFile as a function; the identity checks on localRoots and readFile are unchanged. Sibling channel tests that reach the core resolver (Discord, Slack, WhatsApp, Matrix, MSTeams, Telegram, ClickClack, Feishu send authority) already pass.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 4, 2026
…hored config type (openclaw#164103) * refactor(config): remove retired agents.list and default markers from the authored config type The authored OpenClawConfig type still declared AgentsConfig.list and AgentConfig.default after openclaw#162612 made config validation reject both, so `satisfies OpenClawConfig` kept admitting fixtures and writers that Gateway startup then refused (openclaw#163766, openclaw#163623). Production code also read the untyped runtime agents.list projection, which structuredClone drops, so config-mutation drafts and canonical configs silently saw an empty roster. The authored type now rejects both shapes. Doctor and pre-admission migration inputs use the Doctor-owned OpenClawConfigWithLegacyRoster type (src/config/legacy.roster.ts), which stays structurally assignable to OpenClawConfig, so legacy fixtures need no casts. Runtime readers use the roster owners (listAgentEntries, resolveAgentEntry, resolveAgentConfig). Raw default-marker compatibility for raw SDK inputs is unchanged. The non-enumerable runtime agents.list projection is kept, untyped, for plugins built against SDK releases through 2026.9.x and registered as the deprecated compatibility record agent-list-runtime-projection (removal after 2027-01-02), documented in docs/plugins/sdk-migration/how-to-migrate.md. Fixes found by the cutover: - Feishu dynamic agents: lock-time duplicate and maxAgents checks saw an empty cloned roster and wrote an agents.list that validation rejects. - TUI abort, sessions_send, harness compaction preflight, and run-session lookup resolved a default agent even when an explicit owner was known; models.list now uses the ambient owner like models.ts. - ACP session-metadata migration ignored plugin-declared owners; Talk lost configured wake names; per-agent model normalization and model-auth policy cleanup skipped canonical agents.entries. About 1,075 test fixtures now author canonical agents.entries with the explicit per-surface owners Doctor materializes; Doctor/migration tests keep legacy input typed as OpenClawConfigWithLegacyRoster. * refactor: convert roster fixtures added on main to keyed agents.entries Keep runtime fixtures canonical and preserve explicit per-call ownership. Pin the Doctor schema rehearsal session-store owner without restoring an implicit default. Remove file-transfer reload selectors for rejected list and default fields; canonical workspace paths continue to cover roster changes. * test(zalouser): keep raw legacy-list coverage in Doctor state migration test The legacy-list case had been converted to keyed entries, duplicating the keyed-roster case. Doctor state migrations receive raw pre-migration config, so restore the raw agents.list input under a plugin-local raw roster type. * fix(memory-host-sdk): preserve raw default-marker workspace inheritance Use the shared raw legacy default-marker reader before first-agent workspace inheritance. Preserve explicit ownership resolution and restore the marked secondary-agent regression with the legacy input type. * refactor: split oversized files below their line-cap baselines Extract Mistral cache-cost normalization, sessions-send input readers, and Feishu roster collection. Move session-repair and QMD migration coverage into protected sibling suites and consolidate existing test fixtures without dropping assertions. * fix(ci): clear lint, Docker e2e boundary, and ratchet failures for the roster cutover Keep the npm Telegram live runner on a local historical-config type instead of importing src, fix oxlint diagnostics in converted tests, move the agents.list runtime projection compat record into its own module, split branch-grown files back under their line-cap allowances, and shrink the assertion-safety baseline for casts this branch removed. * test: canonicalize fixtures added during main merge * test(memory-core): type split QMD Doctor fixture as raw legacy config The QMD cases moved into doctor-contract-api.qmd.test.ts lost the raw pre-Doctor config type, so check-test-types rejected their agents.list fixture. Share RawLegacyDoctorConfig from the test support module and use it in both files. * fix(doctor): name canonical agent workspace paths in removed-workspaces warning The warning reads agents through listAgentEntries, so it now labels configured workspaces as agents.entries.<id>.workspace instead of the retired agents.list path. * test: type preserved canary inputs as legacy rosters
steipete
added a commit
that referenced
this pull request
Oct 4, 2026
…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.
This was referenced Oct 19, 2026
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #162612, #163766, #163623
What Problem This Solves
Fixes: test fixtures and code kept writing the retired
agents.listroster and agentdefaultmarkers because the config type still allowed them, even though config validation has rejected both since #162612. Gateway startup then refused those configs (#163766, #163623), and production code reading the untyped runtimeagents.listsilently saw an empty roster in config-mutation drafts and canonical configs.User Impact
User impact: several features now work on canonical keyed rosters (
agents.entries), including multi-agent installs migrated by Doctor:maxAgents, and no longer writes anagents.listthat the next config load rejects.sessions_send, and compaction preflight no longer fail with "Multiple agents are configured" when the agent is already known.models.listwithout anagentIduses the configured system agent; run-session lookup honors the configured fixed session-store owner.defaultmarker, so on main no agent was marked and scopes sorted alphabetically.agents.entries.Plugin developers:
OpenClawConfig(re-exported by the plugin SDK) no longer declaresagents.listorAgentConfig.default. Plugins that read them must usecfg.agents.entries, orlistAgentIds/resolveAgentConfigfromopenclaw/plugin-sdk/agent-runtime. Already-built plugins keep working: the deprecated, non-enumerable runtimeagents.listprojection stays until after 2027-01-02 (compatibility recordagent-list-runtime-projection; seedocs/plugins/sdk-migration/how-to-migrate.md#agent-roster-config). This source-incompatibility was accepted by the maintainer.Upgrade and config compatibility: no stored-config change and no new migration. Config validation has rejected
agents.listand agentdefaultmarkers since #162612, and Doctor already rewrites stored rosters toagents.entrieswith explicit owners; this PR only makes the TypeScript type match that contract. Doctor and pre-admission migrations keep reading old files through the legacy type, soopenclaw updateandopenclaw doctorbehave as before on unmigrated installs. Raw SDK inputs that still carry a singledefault: truemarker keep resolving that agent (including memory workspace inheritance).Why This Change Was Made
The authored type is now the single gate:
satisfies OpenClawConfigrejects both retired shapes, so fixtures and writers fail at compile time instead of at Gateway startup. Doctor and pre-admission migration code read old configs through the Doctor-ownedOpenClawConfigWithLegacyRostertype (src/config/legacy.roster.ts), which stays structurally assignable toOpenClawConfig, so legacy inputs need no casts. Runtime code reads the roster only through its owners (listAgentEntries,resolveAgentEntry,resolveAgentConfig). Rawdefault: truemarker compatibility for raw SDK inputs is unchanged, and so is the #162612 owner contract (no implicit default in a multi-agent roster).About 1,075 test fixtures now author canonical
agents.entrieswith the explicit owners Doctor materializes for upgraded installs (systemAgent,sessionStore,authInheritance, bindings); Doctor/migration tests keep legacy input typed as legacy.Evidence
All suite runs on Blacksmith Testbox through
scripts/crabbox-wrapper.mjsunless noted.Typecheck: 36/36 lanes and shards pass with zero errors on the branch merged with main
ca77256127e6(tsgo:core,tsgo:extensions,tsgo:ui,tsgo:scripts,tsgo:extensions:test, the four root shards, packages, and all 27 core-test shards run individually, sincetsgo:core:test/tsgo:test:rootstop at the first failing shard). PR CI re-runs the typecheck lanes on the current head.Tests: all 983 changed unit/integration test files (~10,000 tests) plus 36 e2e files on the pre-merge tree; Control UI e2e 14/14; core/QA-lab e2e includes the disk-written Gateway fixtures from fix(test): exec approval Gateway e2e fails at startup on its legacy agents.list fixture #163766 and fix(test): Gateway E2E shard 1/4 fails after the concise error copy and keyed agent roster changes #163623 (exec approval, dreaming startup cleanup, WhatsApp login authority). After each merge of main, every test file touched by the merge or its conflict resolution passed (105 unit/integration + 3 e2e for the first merge).
Regression tests (each fails on the pre-change code): Feishu lock-time duplicate/
maxAgentsagainst a cloned canonical draft; TUI cross-agent abort on a canonical multi-agent roster;models.listsystem-agent owner; per-agent model normalization onagents.entrieswithout emittingagents.list; plugin-declared owners in ACP metadata migration; Talk agent/identity wake names on an entries-only roster; memory-host SDK workspace inheritance for a raw roster whose marked default agent is not first (restored after ClawSweeper flagged it; fails with the fix reverted).Control UI, Devices page (mock Control UI, canonical roster
main/ops/researchwith system agentops; captures inspected, fixture data only):Type contract: a fresh
OpenClawConfigliteral withagents.list, with an entrydefault, or viasatisfiesis a compile error; anOpenClawConfigWithLegacyRostervalue passes whereOpenClawConfigis expected without a cast.Current head (
690ce3c50689, merged with main66cbf25fa624): conflicts resolved keeping main's consolidated tests with canonical fixtures; fixtures main added since the last merge converted; line-cap, assertion-safety, max-lines, Docker e2e boundary, and oxlint checks pass locally. Ratchet baselines changed only by exact shrinks where this branch removed casts. CI on3ec784de9dd1(run 37132997751) found one PR-caused failure, a split memory-core QMD test that lost its raw legacy-config type; it is fixed, andtsgoontest/tsconfig/tsconfig.extensions.test.jsonpasses with zero errors on Testbox together with the memory-core and Doctor tests. CI on9a4c1a26d58e(run 37135863141) failed only the inherited Feishu case below. The latest merge's one production conflict (src/infra/update-candidate-rehearsal.ts) keeps main's new startup-only migration behavior unchanged; the branch only types its raw config input as legacy.Autoreview (Codex, P2): whole-branch review findings resolved (one verified false positive in a JSONC fixture, one restored zalouser legacy-list Doctor case); each later fix and merge resolution reviewed scoped-clean.
Known unrelated failures: tests that fail identically on the untouched base were left alone: state-database lifecycle cases (doctor auth/state-integrity, status summary, session listing/placement/sharing, session accessor, host-hook cleanup, startup-index and fleet preflight), the Tlon monitor,
doctor-health-contributions,doctor-config-preflight.admission.process, three embedded-runner integration files, andpublished-driver-update(also red on main's scheduled runs).extensions/feishu/src/outbound-delivery.test.ts("routes oversized presentation media…") fails the same way on clean main2a5875d200f1: #164137 addedopenFileto outbound media access and the test still expects the old exact shape. It only runs in PR changed-extension lanes, and this PR touches none of its files.New regression cases live in existing test files; no real timers, sleeps, per-test Gateway boots, or worker pins were added.