Skip to content

test(mcp): observe cleanup failures at their current delivery boundary - #11702

Closed
g1at wants to merge 1 commit into
morluto:mainfrom
g1at:g1at/test-mcp-cleanup-delivery
Closed

g1at wants to merge 1 commit into
morluto:mainfrom
g1at:g1at/test-mcp-cleanup-delivery

Conversation

@g1at

@g1at g1at commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #11693. Fix two cleanup regressions that still observe the old toCallToolResult delivery path. Current value-handler failures are delivered through toPartialErrorToolResult, whose first argument is the original AnalysisError.

Change and scope

Move the two test spies to the current error-delivery owner and inspect its typed error directly. Assert initial incomplete cleanup and keep the original checks for exact file-descriptor retention, EBADF after release, blocked reuse, cleanup state updating on the original error, same-connection close retries, Kuna staging cleanup, and unchanged target bytes.

This is a test correction within the existing contribution scope. Production code, tools, schemas, provider authority, and package metadata are unchanged. No separate maintainer scope decision is needed.

Evidence and regression coverage

On main at ab16163, the process test passes its public MCP cleanup/partial-observation assertions before the obsolete spy returns undefined. The Kuna test likewise cannot find the typed close failure through the obsolete spy.

Both tests now pass without removing their cleanup or recovery checks. This addresses these two cases in #11693; the other reported failures require separate work.

Validation performed

Linux/WSL, Node 24.22.1, npm 11.16.0, locked dependencies:

  • npm run test:focused -- tests/process-global/processSnapshotCleanupMcp.test.ts tests/boundary/mcp/kunaCloseRetryMcp.test.ts — 2 files, 2 tests passed; required artifacts build passed.
  • npm run check:fast — typecheck, lint, module/numeric-limit checks, and architecture guards passed.
  • Formatting for both changed files and git diff --check — passed.

Kuna uses the existing recording producer, not a real Kuna engine. Native Windows/macOS and the complete repository suite were not run. No production performance claim is made.

Author readiness

Human owner: @g1at

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The test corrections appear safe to merge.

Summary

Updates two cleanup tests to observe toPartialErrorToolResult and read its typed error directly.

  • Cleanup tests now inspect failures at the delivery call that receives them.

Tests were not run during this review. Whether another PR supersedes this one could not be checked because GitHub access required authentication.

Reviews (1) · Last reviewed commit: "test(mcp): observe cleanup failures at t..." · Reviewed by Greptile

@g1at
g1at marked this pull request as ready for review November 16, 2026 07:17
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T07:17:45.185153Z
We couldn’t complete this review. Comment @codex review to try again.
010fa34 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto

morluto commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thank you! Closing as already landed on main via #11727 (552d1c7108, test(mcp): observe cleanup failures at their current delivery boundary).

@morluto morluto closed this Nov 17, 2026
@morluto morluto added the area: mcp MCP server, transport, and tool registration label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants