Repository navigation
refactor: remove agent-step test registry - #155125
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 21, 2026, 3:54 PM ET / 19:54 UTC. ClawSweeper reviewWhat this changesRemoves the nested agent executor’s production test registry and moves dependency substitution into awaited Vitest spies while preserving session messaging behavior. Merge readiness✅ Ready for maintainer review This remains useful, focused cleanup: pinned main and the latest release still contain the registry. No introduced correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherNested agent steps carry messages between sessions and return assistant replies. Ordinary steps use the Gateway; transcript-preserving announcement steps call the agent command directly through a lazy import. flowchart TD
A[Session message flow] --> B[Nested agent step]
B --> C{Transcript bookkeeping needed?}
C -->|Yes| D[Lazy agent command]
C -->|No| E[Gateway execution]
D --> F[Extract assistant reply]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -30, Tests +14, Other -1. Total -17 across 11 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep dependency substitution in test support while retaining the existing lazy execution boundary and session-reply contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor removes source-visible test machinery rather than addressing a reported runtime failure; no runtime reproduction was executed. Is this the best way to solve the issue? Yes. Reusing the existing lazy command import and scoped module spies removes production-only testing machinery without creating a competing execution path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8c56f7239e98. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Retain the real A2A completion promises until fixture cleanup can join them, then reset admission, system events, adjusted tool parameters, and the command spy. Finish the synthetic pending-error run during cleanup after its timeout assertions. Keep all 82 sessions cases in their original registration order. The production registry cleanup landed in #155125. This commit preserves the original #147167 ancestry and addresses its remaining primary-suite lifetime bug through the existing test fixture owners. Proof: the actual-tool baseline exposed an unsettled callback after fixture reset. The candidate handshake passed, as did all 82 original sessions cases, 5 AgentStep cases, and 33 child-coordination cases. All 21 selected checks, including all 25 core-test type graphs, passed on Blacksmith Testbox. Fresh Codex P2 review found no actionable findings.
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Nested agent steps keep a mutable dependency override and a global test registry in production code.
User Impact
No intended user-visible change. Inter-session message annotation, Gateway execution, direct transcript-preserving announcements, and reply handling keep their existing behavior.
Why This Change Was Made
Use the existing lazy agent-command import directly, capturing ingress arguments before awaiting it. Keep scoped module spies in test support, await their setup and restoration, and remove the retired global registry and its metadata entries. Production shrinks by 31 lines; test/support grows by 16 and metadata shrinks by 2, for 17 fewer lines overall.
Related: #150153.
Evidence
No production Gateway or external model-provider run is claimed. Exact-head PR CI remains required before landing.
Required Gateway before/after timing
The complete
src/gateway/server.sessions-send.test.tsfile passed all 15 cases on each revision using one isolated Linux host (Node 24.19.0, pnpm 12.4.0), independent frozen installs and fresh caches.The case inventory is identical. These are single observations, not a statistical performance claim. Baseline
d61156bb5cfa22e15d19121d6ab4c073bfeac33e; final candidate tree5d73d65d657278328a4ff456d42ee58b29e37dd6.