fix(gateway): declare the dev agent required by the gateway e2e session key#99520
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 8:00 AM ET / 12:00 UTC. Summary PR surface: Tests +3. Total +3 across 1 file. Reproducibility: yes. from source inspection and the linked issue's focused before/after evidence. Current main still builds a config without Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the narrow test-fixture declaration after normal maintainer review while keeping the deleted-agent runtime guard intact. Do we have a high-confidence way to reproduce the issue? Yes from source inspection and the linked issue's focused before/after evidence. Current main still builds a config without Is this the best way to solve the issue? Yes. Declaring the test-local AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8abc633cf8e2. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +3. Total +3 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
What Problem This Solves
Fixes #99513.
The clean-checkout e2e test
src/gateway/gateway.test.ts > gateway e2e > accepts a gateway agent request over ws and returns a run idfails on currentmain:Because it reproduces on an untouched checkout, it blocks contributors' local pre-push gates (
pnpm check:changedand precheck flows that run the gateway lane) regardless of what they changed.Why This Change Was Made
The failure is a broken test fixture, not a product bug: the test requests
sessionKey = "agent:dev:mock-openai", but its gateway config declares onlyagents.defaults— noagents.listentry with iddev— so the gateway's deleted-agent guard correctly rejects the run. The sibling test in the same file declaresagents.list: [{ id: "main", default: true, ... }]and passes.The smallest repair is to declare the agent the test's own session key requires:
Declaring
dev(rather than switching the session key tomain) preserves the tested session identity;default: trueis unambiguous in a single-agent test config. The config object is local to this one test, so no other case relies on the previous shape.Note: this is a fixture repair that restores the test's intent — it does not weaken or bypass the deleted-agent validation (the guard behaves correctly and stays untouched). #98686 previously attempted a broader fix for scheduled live/e2e failures in this area but was closed unmerged with no public discussion; this PR takes only the single-fixture slice with a fresh reproduction on current
main.User Impact
pnpm test src/gateway/gateway.test.tspasses on a clean checkout again, so contributor pre-push gates and the gateway e2e lane stop failing on an upstream fixture bug. No runtime behavior changes.Evidence
HEAD:
9addbdeb73ceff8bd912e7ed491d7745f8cb9b1d(base upstream/main0cc9927577)Before (clean
main, reproduced at776b34a4e642,df350e6720,8d535fb039— details in #99513):After (this branch):
OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 pnpm check:changed -- src/gateway/gateway.test.tsexit 0;git diff --checkclean.Non-scope: no runtime gateway behavior change; no change to deleted-agent validation; no
gateway-models.profiles.live.test.tschanges (not reproduced on currentmain, deliberately excluded).🤖 AI-assisted (Claude Fable 5 + Codex GPT-5.5 review). The failure, root cause, and fix were verified by hand at the SHAs above; structured review round clean ("patch is correct", including the declare-vs-rename design question).