Skip to content

test(mcp): add contained Windows pool overlap regression - #252

Merged
KooshaPari merged 1 commit into
codex/mcp-owned-lifecycle-20261103from
codex/mcp-pool-overlap-witness-20261105
Nov 11, 2026
Merged

KooshaPari merged 1 commit into
codex/mcp-owned-lifecycle-20261103from
codex/mcp-pool-overlap-witness-20261105

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

User description

Exercise real Windows MCP processes while old-session release, disconnect commit, and reconnect wait behind the pool's reference barrier. The regression checks stale release preserves successor ownership, retired RPC handles fail, successor RPC succeeds, and exact retained process handles eventually signal before fixture teardown.

Package a dedicated creation-time Job controller, minimal Python fixtures, and a separate observational test. The controller requires exactly one selected passing test, verifies an outside-Job negative control separately, retains durable failure artifacts, and attempts every cleanup action despite diagnostic or wait failures.

Validation:

  • 10 Python selection/cleanup fault-injection tests passed; cleanup failures use mocked resources.
  • Both packaged Rust integration binaries compiled with --no-run on Windows.
  • Rust formatting and staged diff checks passed.
  • Current packaged controller/runtime execution is UNEXECUTED. Earlier experimental overlay runs observed accounting-zero and an empty Job PID list while a retained descendant handle remained unsignaled; one spawn-return sample also preceded predecessor handle signaling. Those earlier runs are separate evidence, not runtime proof for this commit.

This adds test support, not a strict predecessor-completion repair. Unsignaled handles do not prove active execution or resource collision; observational snapshots are sequential.

Stacked against codex/mcp-owned-lifecycle-20261103 at 47725bf5efcadd28336bb53517b3ac7050d1d474, the fork head of upstream draft PR #2062.


Tracks #271 (residual agent PR backlog): the Require Linked Issue gate failed only because this PR predates the issue.


CodeAnt-AI Description

Add Windows regression coverage for MCP pool reconnect overlap

What Changed

  • Adds a Windows test for a disconnect and reconnect while an old session is releasing its MCP handle; checks that a stale release does not affect the successor and that the successor can complete an RPC.
  • Checks that retired fixture processes eventually exit. A separate probe records process and spawn observations without claiming to prove that generations never overlap.
  • Adds a controller that runs one selected test in an isolated Windows Job, verifies an outside-Job control, and retains failure logs while attempting all cleanup steps.
  • Does not change production MCP lifecycle behavior.

Impact

✅ Detects stale releases that could disrupt a successor MCP connection
✅ Confirms retired fixture processes eventually exit
✅ Preserves logs when a Windows regression run fails

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Package a dedicated Job-contained fixture and separate observational probes.
Keep accounting and process-handle completion claims distinct.

tx-agent: codex
tx-validated: test,build
tx-task: mcp-pool-overlap-regression
tx-parent: 47725bf
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f05b8c44-a7e9-4e98-a8c8-38503dd2339b
Commits

Reviewing files that changed from the base of the PR and between 47725bf and 34e6135.

Files selected for processing: 17

  • crates/jcode-base/src/mcp/client_connect.rs
  • crates/jcode-base/src/mcp/pool.rs
  • crates/jcode-base/src/mcp/pool_connect.rs
  • crates/jcode-base/src/mcp/pool_handles.rs
  • crates/jcode-base/src/mcp/pool_state.rs
  • crates/jcode-base/src/mcp/windows_native_process.rs
  • crates/jcode-base/tests/production_pool_accounting_observations.rs
  • crates/jcode-base/tests/production_pool_overlap.rs
  • crates/jcode-base/tests/support/pool_drain_observer.rs
  • crates/jcode-base/tests/support/pool_overlap_case.rs
  • crates/jcode-base/tests/support/windows_mcp/README.md
  • crates/jcode-base/tests/support/windows_mcp/atomic_controller.py
  • crates/jcode-base/tests/support/windows_mcp/controller_cleanup.py
  • crates/jcode-base/tests/support/windows_mcp/test_atomic_controller.py
  • crates/jcode-base/tests/support/windows_mcp/test_controller_cleanup.py
  • crates/jcode-base/tests/support/windows_mcp/windows_joblist_prototype.py
  • crates/jcode-base/tests/support/windows_mcp/windows_mcp_fixture.py
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@KooshaPari
KooshaPari marked this pull request as ready for review November 11, 2026 13:16
Copilot AI balanced review requested due to automatic review settings November 11, 2026 13:16
@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #1fb64 Reviewed your PR 34e6135 Nov 11, 2026 · 13:16 13:26

@codeant-ai

codeant-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@KooshaPari
KooshaPari merged commit 2830cf0 into codex/mcp-owned-lifecycle-20261103 Nov 11, 2026
11 of 15 checks passed
@KooshaPari
KooshaPari deleted the codex/mcp-pool-overlap-witness-20261105 branch November 11, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Nov 11, 2026
@codeant-ai

codeant-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

2 code suggestions

1. If control.wait times out, it raises without stopping the outside process; attempt_all records the error and cleanup returns with that process still alive.

Resource leak · crates/jcode-base/tests/support/windows_mcp/controller_cleanup.py:34-36


2. tempfile is imported but never used in this fixture.

Code quality · crates/jcode-base/tests/support/windows_mcp/windows_mcp_fixture.py:6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants