Repository navigation
test: scope MCP lifecycle drain assertion - #150910
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 17, 2026, 9:11 AM ET / 13:11 UTC. ClawSweeper reviewWhat this changesThe PR changes an MCP connection lifecycle test to verify that its own session is removed instead of requiring the process-wide runtime inventory to remain unchanged. Merge readiness✅ Ready for maintainer review Keep open: this is a useful, narrowly scoped test correction that current main still needs. The replacement preserves session cleanup coverage while avoiding assertions about unrelated runtimes; no actionable defects were found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s MCP runtime manager holds tool-server connections for agent sessions, including separate requester and static connections. This test checks that connections remain usable during preparation and close after the session’s final lease is released. flowchart TD
A[Requester tool preparation] --> C[Session runtime manager]
B[Static server preparation] --> C
C --> D[Tool call succeeds]
D --> E[Session retirement and lease release]
E --> F[Both transports close]
E --> G[Session absent from manager]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -1. Total -1 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep lifecycle assertions scoped to the session under test while retaining observable connection-use and transport-cleanup checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: an unrelated runtime added between the two global snapshots makes the existing assertion fail despite successful cleanup of this session. The concurrent failure was not executed in this read-only review. Is this the best way to solve the issue? Yes. The existing session query covers both runtime partitions, and the retained HTTP assertions independently verify both connections close. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a44952c7b12. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
Root cause
The compact large shard runs test files concurrently in one process. This test captured the manager’s global runtime keys before its work, then required exact equality afterward. Concurrent tests legitimately created
internal-session-effects-*andprivate-memory-sourceruntimes between those two observations, producing the same failure across four repair PRs.The lifecycle contract belongs to
mixed-native-discovery, so the final assertion now verifies that exact session is absent. The existing transport DELETE and session-set assertions continue proving both requester and static MCP transports close.Validation
pnpm exec oxfmt src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.tspnpm exec oxlint --type-aware src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.tspnpm test src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts