Skip to content

test: scope MCP lifecycle drain assertion - #150910

Merged
RomneyDa merged 1 commit into
mainfrom
fix/mcp-requester-lifecycle-isolation-20260917
Sep 17, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/mcp-requester-lifecycle-isolation-20260917

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • assert that the requester-lifecycle proof retires its own session
  • stop asserting equality over the process-global MCP runtime manager while other Vitest files run concurrently

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-* and private-memory-source runtimes 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.ts
  • pnpm exec oxlint --type-aware src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts
  • pnpm test src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 9:11 AM ET / 13:11 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 3c1d57cd1a5aa0835da25a5bacd47f1dd8017be1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test correction preserves the meaningful lifecycle checks without introducing a correctness or security concern.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR changes only an OpenClaw manager assertion; the contributor live-proof gate does not apply, and reported focused validation remains supplemental.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR changes only an OpenClaw manager assertion; the contributor live-proof gate does not apply, and reported focused validation remains supplemental.
Evidence reviewed 6 items Verified introduced change: The pinned base-to-head diff changes only the final manager assertion and removes its process-wide baseline snapshot. The tool execution, deferred-retirement check, empty transport-session set, and both DELETE assertions remain intact.
Session assertion covers all retained partitions: listSessionIds derives distinct session IDs from every runtime value in the same map used by listRuntimeKeys. Either a requester or static runtime left behind for this test would therefore fail the new assertion.
Current main still needs the correction: Fetched main retains previousRuntimeKeys and the exact process-wide equality assertion. The supplied discussion attributes failures to unrelated concurrent runtimes; that failure was not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

OpenClaw’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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -1. Total -1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 2 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 2 -1

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a focused test-isolation correction with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR changes only an OpenClaw manager assertion; the contributor live-proof gate does not apply, and reported focused validation remains supplemental.

Label justifications:

  • P3: This is a focused test-isolation correction with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR changes only an OpenClaw manager assertion; the contributor live-proof gate does not apply, and reported focused validation remains supplemental.

Evidence

What I checked:

  • Verified introduced change: The pinned base-to-head diff changes only the final manager assertion and removes its process-wide baseline snapshot. The tool execution, deferred-retirement check, empty transport-session set, and both DELETE assertions remain intact. (src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts:165, 3c1d57cd1a5a)
  • Session assertion covers all retained partitions: listSessionIds derives distinct session IDs from every runtime value in the same map used by listRuntimeKeys. Either a requester or static runtime left behind for this test would therefore fail the new assertion. (src/agents/agent-bundle-mcp-manager.ts:398, 3c1d57cd1a5a)
  • Current main still needs the correction: Fetched main retains previousRuntimeKeys and the exact process-wide equality assertion. The supplied discussion attributes failures to unrelated concurrent runtimes; that failure was not executed during this read-only review. (src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts:166, 0a44952c7b12)
  • Recent assertion history: GitHub commit metadata identifies steipete as the author of the earlier change from an empty global inventory assertion to a captured baseline. Its patch also adds the manager binding retained at reviewed line 90. Deeper local follow-history inspection encountered an unavailable historical object; the relevant commit patch was inspected through GitHub. (src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts:90, 8d6decdecafe)
  • Release and related-work check: The latest supplied release commit does not contain this test path. No canonical replacement was provided; the bounded GitHub PR search was denied by the read proxy, so no exhaustive duplicate-search claim is made. (src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts, 3a9d69db306c)
  • Implementation boundary and proof scope: The changed assertion observes OpenClaw’s global manager. The unchanged Codex-named preparation helper acquires and releases that manager locally; this correction does not alter or establish compatibility with an external Codex protocol. The member-authored PR reports focused test, lint, and formatting validation; no tests were executed by this review. (src/agents/cli-runner/bundle-mcp-codex.ts, 3c1d57cd1a5a)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@RomneyDa
RomneyDa merged commit 1d5e6ab into main Sep 17, 2026
104 checks passed
@RomneyDa
RomneyDa deleted the fix/mcp-requester-lifecycle-isolation-20260917 branch September 17, 2026 13:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant