Repository navigation
Conversation
…e when Setup checks a configured agent
|
🦞👀 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: needs real behavior proof before merge. What this changesThis PR lets a compatible read-only setup runtime capture a configured agent’s published model catalog. Example: Gateway agent default publishes openai/gpt-5.5 and setup checks it in /tmp/setup-probe-workspace.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain This PR addresses a current bug, but its new admission condition excludes the configured agent identity used by shipped setup verification. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGateway startup publishes configured model inventory; runtime admission captures that inventory for isolated model resolution and authentication planning. flowchart TD
A[Gateway startup] --> B[Configured catalog owner]
C[Setup configured agent route] --> D[Read-only runtime admission]
B --> D
D --> E[Captured model inventory]
E --> F[Authentication and inference]
F --> G[Verification result]
Technical reviewBest possible solution: Match the actual setup projection under route.agentId in existing catalog admission while preserving configuration, directory, credential, and execution isolation. Do we have a high-confidence way to reproduce the issue? Source tracing shows that a configured agent named default reaches read-only acquisition as default, skips the new openclaw-only projection, and retains the catalog-key mismatch; no target code was executed. Is this the best way to solve the issue? Sharing compatible inventory through the existing owner is the right repair boundary, but the admission condition and regression fixture must use the identity supplied by the real setup caller. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 066c7ecdeccf. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +32, Tests +85. Total +117 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. 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 Reviewed November 13, 2026, 1:32 AM ET / 06:32 UTC. |
Closes #196817
What Problem This Solves
Fixes: AI setup verification does not see the configured agent's published model route (for example the ChatGPT subscription route) when it checks that agent's model.
User Impact
User impact: Setup's read-only verification now plans authentication against the same published catalog the Gateway announced at startup, so a subscription-backed model is recognized instead of falling through to an empty profile order. No credentials are written, no API key is substituted, and OAuth/auth-policy eligibility is unchanged.
Why This Change Was Made
Setup runs its probe in an isolated read-only runtime under the reserved
openclawagent. When that runtime was admitted, the check that decides whether it may read the configured agent's published catalog compared full owner identities, so the agent id, the read-only flag and config hash, and the Gateway subagent-binding grant all made it unequal. The probe therefore started from an empty catalog. Now that comparison accepts exactly one extra shape: a read-onlyopenclawrequest, without subagent binding, whose config is the owner's config plus theopenclawexecution entry. Everything else keeps its own catalog.Technical detail
resolveCatalogSourceKey(inprepared-model-runtime.owner.ts) replaces the inline catalog-owner comparison inprepared-model-runtime-lease.ts. It only affects which owner's passive catalog is captured.ownerKey, owner lookup, plugin generations, and execution identity are untouched, and the probe still runs on its own isolated read-only owner.allowGatewaySubagentBinding. The inverse (owner without binding, request with binding) does not borrow.skipCredentialsrequests keep separate catalogs. Execution purpose and plugin selections were already excluded from this comparison and still are.Evidence
src/agents/prepared-model-runtime.owner-selection.test.ts("setup read-only catalog capture") drive the real Gateway startup publisher (publishConfiguredModelRuntimeSnapshots), the real setup projection (resolveSystemAgentConfiguredRouteFromConfig), and read-only static acquisition (acquireReadOnlyPreparedModelRuntime).expected [] to deeply equal [ 'gpt-5.5' ]. The third (separation of altered projections and identities) passes either way as a negative control. With the fix: 3 of 3 pass.skipCredentials, and an owner without subagent binding versus a request with it.pnpm test src/agents/prepared-model-runtime.owner-selection.test.ts src/agents/prepared-model-runtime.test.ts src/agents/prepared-model-runtime.catalog-owner.test.ts src/system-agent/inference-route.test.ts src/system-agent/setup-inference-turn.test.ts --maxWorkers=1: 5 files, 98 tests passed (25 + 73), including "reuses read-only owners for equivalent config clones but rejects projections" and "keeps an isolated setup probe exact after a gateway replacement".pnpm tsgo:corepasses.oxlintis clean on the three touched files, the format check passes, andgit diff --checkis clean.pnpm tsgo:core:testtimed out locally before finishing (every shard that completed passed, including the threeagents-*shards). Full-repopnpm lintwas not rerun; it reports a pre-existingmax-lineserror inextensions/crabbox/src/crabbox-worker-node-enrollment.test.ts, which this PR does not touch. No live ready-Gatewayopenclaw.setup.verifyrun with a real ChatGPT subscription was performed; evidence comes from the production code path under the prepared-runtime test harness.