Repository navigation
fix(agents): capture published catalog for read-only setup probes - #198054
huwei-xydt wants to merge 5 commits into
Conversation
Setup inference and isolated completion run an isolated read-only prepared model runtime whose projection differs from the configured agent's published owner only by its read-only execution identity and the gateway subagent-binding capability. The catalog capture comparison still included those dimensions, so the read-only probe never matched the configured owner and captured an empty static catalog, losing the configured agent's published OAuth subscription rows and failing setup.verify with "Explicit auth order ... has no usable profiles." Compare the catalog source with the read-only identity and binding capability excluded so a read-only probe captures the configured agent's published catalog while keeping its own execution owner, without granting subagent-binding authority or changing auth policy. Fixes openclaw#196817
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR lets read-only setup probes capture a compatible configured agent’s published model catalog. Example: Setup verifies agent pro using the published openai/gpt-5.4-codex subscription route.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 3 items remain This PR addresses a current upstream bug, but its new compatibility predicate rejects a valid setup projection and permits reuse across staged account-selection changes. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGateway publication owns discovered model inventory; runtime admission selects which catalog an isolated setup probe captures before model resolution and authentication. flowchart LR
A[Gateway publication] --> B[Configured catalog]
C[Setup verification] --> D[Projected configuration]
D --> E[Read-only runtime admission]
B --> E
E --> F[Model and auth resolution]
F --> G[Provider request]
Technical reviewBest possible solution: Recognize the exact setup execution projection while preserving authentication, environment, and other catalog-source inputs in compatibility checks. Do we have a high-confidence way to reproduce the issue? The linked report and current-main owner-key comparison establish deterministic catalog loss on isolated read-only setup acquisition; this read-only review ran no target code. Is this the best way to solve the issue? Repairing catalog-source selection at admission is appropriate, but compatibility must follow the real setup projection and the existing inventory owner’s authentication inputs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f52d9254a99c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +59, Tests +191. Total +250 across 3 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 (2 earlier review cycles)
Reviewed November 13, 2026, 7:39 AM ET / 12:39 UTC (Revision 3). |
|
ClawSweeper status: applying reviewed decision. I am applying the reviewed decision for this pull request: fix(agents): capture published catalog for read-only setup probes This is item 1/1 in the current shard. Shard 1/1. This transient lease prevents a newer review from overlapping label, comment, or close mutations. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
The catalog-source comparison for a read-only probe omitted the config field from the projected input, which violated the PreparedModelRuntimeInput contract (config is required). Keep the entry's config; ownerKey already excludes config from the key when readOnly is false, so the comparison still treats read-only projections as equivalent for catalog capture.
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review — P2 staged-config compatibility addressed: catalog borrow now requires |
|
🦞👀 Re-review progress:
|
Compare copied reviewer selectors against the configured owner while rejecting catalog-relevant auth and environment changes. Type catalog fixtures and remove unsafe config casts. Co-authored-by: RomneyDa <[email protected]>
Apply the repository formatter to the catalog correction tests. No behavior changes. Co-authored-by: RomneyDa <[email protected]>
|
Closing: the branch is 1534 commits behind main and CI shows eight real failures (check-test-types, four checks-node-changed shards, checks-ui-e2e, baseline ratchets) that all stem from the stale base rather than this change. The TS18048 in scripts/perf/state-read-worker-bench.ts already differs on current main, so a full rebase would need re-verification of the whole setup-catalog path. Reopening as a fresh branch against current main is the cheaper route if this fix is still wanted. |
What Problem This Solves
Setup inference (
openclaw.setup.verify) loses the configured agent's published subscription routes and rejects a usable OAuth profile withExplicit auth order for openai has no usable profiles.acquireReadOnlyPreparedModelRuntime(used by setup inference and isolated completion probes) runs an ephemeralreadOnlyprepared model runtime. Its catalog capture comparison inprepared-model-runtime-lease.tscomparedownerKey()values that still included the read-only execution identity and the gateway subagent-binding capability. Because a setup probe isreadOnly: true, uses the projected execution config, and does not request the subagent-binding capability, its key never matched the configured owner published at Gateway startup — so the probe captured an empty static catalog and lost the configured agent's OAuth subscription rows. Auth planning then found no usable profile and failed with the explicit-order error.Solution
Compare the catalog source with the read-only identity and the gateway subagent-binding capability excluded, so a read-only probe captures the configured agent's published catalog while keeping its own execution owner. This:
ownerKey— the probe still runs under its own ephemeral read-only owner;allowGatewaySubagentBindingis not copied onto the probe;The fix follows the same "execution purpose isolates plugins, not the configured agent's published inventory" precedent already used to exclude
loadRuntimePlugins/runtimePluginPurpose/runtimePluginSelectionsfrom the catalog-source comparison, extended to the read-only projection dimensions.Preserving staged configuration compatibility
Borrowing the configured agent's inventory is only sound while the candidate's config still agrees with the published config on everything the catalog build consumes. The borrow check now also requires
preparedModelRuntimeCatalogConfigsCompatible(configuredConfig, candidateConfig):collectConfiguredModelRefs: agents/tools/channels/hooks/tts) match;modelssection matches (mode + provider static configs —baseUrl,apiKey, inlinemodels, etc.);pluginssection matches (manifest provider availability).The setup execution projection — the reserved
SYSTEM_AGENT_IDentry gainingparams/tools— never feeds the catalog build, so a projection-only difference still borrows. A staged change to provider settings or model selection does not: the probe falls back to its own catalog instead of reusing inventory published against the previous config.Evidence
prepared-model-runtime.test.ts > captures the configured agent's published catalog for a read-only setup probe: red on the base (empty catalog,expected [] to include 'openai/gpt-5.5'), green with the fix (capturesopenai/gpt-5.5), and asserts the probe keeps its own scratch workspace (execution isolation).prepared-model-runtime.test.ts > does not borrow the configured published catalog when staged provider settings change: red on the base (the old borrow logic reused the stale inventory,expected ['openai/gpt-5.5'] to not include 'openai/gpt-5.5'), green with the predicate.prepared-model-runtime.test.ts > still borrows the configured published catalog when only the setup projection differs: the reserved system-agent entry gainingparams/toolskeeps the catalog borrow, so setup probes keep working.prepared-model-runtime.test.ts,prepared-model-runtime.owner-selection.test.ts,prepared-model-runtime.catalog-owner.test.ts,src/system-agent/inference-route.test.ts,src/system-agent/setup-inference-turn.test.ts.keeps an isolated setup probe exact after a gateway replacementtest stays green — read-only probes still keep their own execution owner.Fixes #196817
Reviewed correction and current proof status
This correction supersedes the earlier compatibility description: setup does collect reviewer model references from copied tools. Only newly projected, exact copies of the configured owner agent’s tool selectors are ignored for catalog comparison. Existing reserved-agent selectors, changed selectors, unmatched selectors, and changed fallback paths remain incompatible. Staged
authand configuredenvchanges now participate in the catalog fingerprint alongsidemodelsandplugins. Execution ownership, scratch workspace, and read-only credential behavior remain separate and unchanged.The correction also uses typed
ModelCatalogSnapshotfixtures (OAuth evidence stays insetPreparedModelFullCatalogAuth) and removes the two unsupported config casts that caused the incoming assertion-safety failure. It reuses the existing catalog compatibility owner; no new cache, policy owner, or compatibility path was added.Candidate evidence
a6e2d5a99254fa357a0b2d70084c0a204b20af41; correction patch SHA-256:9dbe809757789dd91db6f6cf196dd9ee7484e9f7a396545eb73cd612cb5d5b93. The exact signed candidate is recorded below.git diff --checkand commit signature verification passed. No contributor source was executed on the credentialed local host.Pending proof — not READY
The candidate is published only to obtain required proof. It is not approved for merge. Pending: exact-candidate prepared-runtime and system-agent/isolated-completion regressions; base-red/fix-green copied-tools proof; targeted production/test typecheck, lint, format, and assertion-safety checks; applicable build/package proof; and current-head CI/mergeability. The independent reviewer also recommended changed-existing-reviewer and primary/fallback regression cases.
Authenticated Gateway setup verification cannot be performed in this environment: a safe secretless execution host is unavailable and no isolated authenticated runtime is provisioned. This is a live-proof gap, not a successful test. No account, credential, model, auth-order, live Gateway, or safety guard has been changed to work around it.
Verified published candidate:
Current candidate CI diagnosis
Candidate CI run 43601168191 exposed a build blocker before the affected test shards execute: agents/identity-file.worker.js evaluates 240 modules against the 220 budget. The same failure occurs in UI e2e and three Node shards; this is not a passing runtime proof.
The incoming comparison passed at 203 modules but used merge base 777c036; the current run checks merge 91271c8 onto d98f18f. That base includes commit 1b3e37b (PR #198857), which adds a static logging/subsystem import and logger construction to worker-idle-gc.ts. The affected chain is identity-file.worker → worker-task-server → worker-idle-gc → logging/subsystem. The catalog correction does not edit this chain. This is the identified base-side source of graph growth; an exact module-count base replay is still unavailable, so the build failure remains unresolved rather than waived.
Candidate assertion-safety passes, confirming removal of the original unsafe casts. The aggregate baseline-ratchets job instead fails on the new mock in src/infra/worker-idle-gc.test.ts:13, also introduced by #198857, which does not preserve real logging exports or document isolation. No budget, baseline, mock guard, or workflow was weakened. Targeted type/runtime checks are still being collected. This PR remains NEEDS WORK; worker-logging repair is outside this catalog correction.
Formatting follow-up and prior-head check results
The formatter failure was correction-owned and has been repaired with the repository formatter (oxfmt 0.74.0): signed formatting-only commit 5a3fc9e, tree 2e2e926fcd5e8e2160e1d6ae99f8243215ee0b29. An independent review confirms no behavior changes and approves proof-only publication. All three touched files pass the local formatting check; new-head CI is still required.
On prior candidate 2a6c653, production typecheck and all five core-test typecheck stripes passed, including core-2 that failed on the original catalog fixtures. Assertion-safety passed. These remain prior-head evidence. The aggregate test-types job separately fails at scripts/perf/state-read-worker-bench.ts:373 (TS18048, entry.tasksCompleted possibly undefined); that file is not changed by this correction. Several catalog lifecycle siblings passed, but those do not replace the required copied-tools regression, blocked build/package proof, or authenticated live setup verification.
Current published formatting candidate: 5a3fc9e. Exact-head CI has been approved after verifying unchanged workflow source and is running. Previous-head evidence above is not reclassified as current-head proof. No merge requested.
Exact-head readiness update
On head 5a3fc9e, CI run 43601989046 now passes production types, all five core-test type stripes, check-lint (including corrected formatting), and assertion-safety. The completed compact-large-28 job passes prepared-runtime plugin-drain, catalog-projection, and refresh-scope siblings. Those siblings do not prove the changed copied-tools regression or authenticated setup flow.
Still blocked: exact-head Node/UI build logs repeat identity-file.worker.js: 240 evaluated modules exceeds budget 220 (jobs 132469027022 and 132469026184). Baseline ratchets still reject src/infra/worker-idle-gc.test.ts:13's logging mock (job 132469025839). General test types fail at scripts/perf/state-read-worker-bench.ts:373 with TS18048 (job 132469669377). Remaining jobs are not reported as complete.
Independent current-main source check: at main a02a1e0, src/infra/worker-idle-gc.ts is blob f98679238940b5e4dfa0201179eccc3892227118, identical to the file introduced by 1b3e37b / #198857. It still eagerly imports logging/subsystem through the identity-worker chain. The diagnosed worker source is not repaired on that pinned main.
Existing repair #198881, head b239a63, is open, not merged. Its inspected diff moves logging behind the slow-GC branch's dynamic import and leaves the budget unchanged. Its author reports base 240/220 and fixed 203/220 full/sourcePerformance builds; that report is not independent execution proof for this catalog candidate. It also retains the existing logging mock, so the separate mock-exports failure is not proven resolved by it.
Supported next proof path: after a verified owning repair lands, refresh this candidate only as needed to incorporate that material build fix, preserve the catalog correction, and rerun affected exact-head build/runtime gates. Do not import an unmerged worker repair or raise budgets in this catalog PR. Until then, required copied-tools runtime/base-red-fix-green proof and authenticated Gateway setup verification remain unresolved. NEEDS WORK; no merge authorized or attempted.
Native baseline recovery after the worker fix
Worker repair #198895 is now merged as
d43de8d733674c942c8eb7bfb7333a30de4f910fand is an ancestor of verified baseline976a4fb8784a326579108e03d0df4356dad501a3. The earlier statement that no worker repair has landed is historical. No unmerged #198881 code or budget change was imported.Fresh independent source review still finds the catalog correction suitable for proof-only baseline materialization, not READY. Required copied-tools/base-red-fix-green behavior, a successful exact-candidate build, and authenticated setup verification remain unproven. No contributor code was executed on the credentialed host.
Native recovery is blocked before source materialization: this already-published correction has local and hosted head
5a3fc9efdad3f5b3a8338fb7abd504f5528c7b5a, while retained preparation records original incoming heada6e2d5a99254fa357a0b2d70084c0a204b20af41. Initial proof-baseline validation uses that old incoming lease; the supported correction-continuation validator rejects the equal local/hosted-head case. The publication receipt remains intact. This needs a canonical workflow recovery fix for the existing receipt-backed equal-head case; no fabricated commit, rewritten receipt, manual binding change, merge, or safeguard bypass was used. The published source head is unchanged and remains NEEDS WORK.