Skip to content

test(windows): guard clean MCP stdio startup - #2213

Closed
lorenzozanee wants to merge 1 commit into
DeusData:mainfrom
lorenzozanee:restore/pr-2097
Closed

lorenzozanee wants to merge 1 commit into
DeusData:mainfrom
lorenzozanee:restore/pr-2097

Conversation

@lorenzozanee

@lorenzozanee lorenzozanee commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a native Windows MCP stdio regression guard for #654. The guard isolates daemon runtime cleanup and rejects the reported path-not-found diagnostics after a successful initialize/tools/list exchange.

Checklist

  • Every commit is signed off (git commit -s) — required, CI rejects
    unsigned commits (DCO, see CONTRIBUTING.md)
  • Tests pass locally (make -f Makefile.cbm test)
  • Lint passes (make -f Makefile.cbm lint-ci)
  • New behavior is covered by a test (reproduce-first for bug fixes)

Fixes #654

Supersedes #2097(原PR分支已删,按原提交重建)

@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

@DeusData DeusData added maintainer-notes Internal observations and improvement notes windows Windows-specific issues priority/normal Standard review queue; useful PR with ordinary maintainer urgency. labels Sep 19, 2026
@DeusData

Copy link
Copy Markdown
Owner

Thank you for building a native Windows MCP stdio guard for #654 — that platform is where our hardest bugs hide and guards there are worth a lot.

Before you spend any time on this one: I think it may be a double-submit, and I would rather ask than close it on you.

This PR and #2217 are the same guard for the same issue, opened thirteen seconds apart. #2217 looks like the fuller version:

#2213 (this one) #2217
tests/windows/test_mcp_stdio.py +57 +59
tests/windows/mcp_stdio.py — +1
scripts/test-windows.ps1 +1 +1
description rejects path-not-found diagnostics also captures stderr deterministically, handles the Spanish diagnostic text

If that is right, #2217 is the one to keep and this can be closed — but it is your work and your call, so tell me which you want and I will do the rest. If they are actually different and I have misread, say so and I will review both.

Whichever survives needs the same two things:

The dco check is red. Your commits carry no Signed-off-by trailer — a headline with an empty body, so there is nothing to parse. (Not the blank-line trap, where a sign-off falls outside the trailer block and git's parser ignores it while grep still sees it; here there is no trailer.)

git commit --amend -s          # single commit
git rebase --signoff origin/main   # several
git push --force-with-lease

test / test-msan is our problem, not yours. That lane fails on its Docker image build whenever apt.llvm.org is flaky, and it reddens PRs that have nothing to do with it. Please ignore it — I track it separately and it will not block this.

#2241 and #2242 both merged today after review. Good work on those.

@DeusData

Copy link
Copy Markdown
Owner

Thanks again for the Windows guard. Following up on the duplicate-submission question: please confirm whether #2217 is the intended canonical version, or describe the distinction if both are needed. Neither PR is being closed in this sweep.

@DeusData

Copy link
Copy Markdown
Owner

Thanks again for the Windows startup guard. Could you confirm whether #2217 is the canonical submission, or explain the distinction if both are needed? That will let us continue with the right PR without duplicating your work.

@DeusData

Copy link
Copy Markdown
Owner

Thank you, @lorenzozanee, for this guard and the care that went into it. We held both versions open while we asked which one you wanted to keep. Since we have not heard back, we are closing this one as a duplicate of #2217, which carries the same Windows startup check for #654 in its newer form (it restores #2182, your second pass at #2097). That guard has now landed in #2952 (merge ff812bf), with you credited as co-author.

For the record, #2217 was the right one to keep, for two reasons:

  1. test(windows): guard clean MCP stdio startup #2217 joins the stderr reader before the output is inspected, so a message printed just before the server exits cannot slip past the check. Here the text is read while the reader may still be draining it.
  2. test(windows): guard clean MCP stdio startup #2217 gives every run its own runtime directory. This version reuses a fixed cbm-mcp-stdio-runtime folder next to the temporary cache and creates it without exist_ok, so a second run on the same machine stops with a "file exists" error before the guard even starts.

Both versions check the English and the Spanish message. Our first comparison said only #2217 did; that was our mistake, sorry for the confusion. Handling a localized machine at all is the kind of detail that usually gets found the hard way, so thank you for that.

@DeusData DeusData closed this Nov 11, 2026
taggedzi pushed a commit to taggedzi/codebase-memory-mcp that referenced this pull request Nov 12, 2026
Adds a native Windows guard for DeusData#654: a successful MCP initialize +
tools/list exchange, run against an isolated cache and runtime directory,
must leave nothing on stderr but the server's own structured log lines.

- tests/windows/test_mcp_stdio.py: the guard. The English and Spanish
  path-not-found messages reported in DeusData#654 are named cases; any other
  non-empty stderr line that is not a structured "level=<name> msg=<event>"
  record fails as well, so the same leak on a machine in another language
  is caught without listing its translation. The log format is pinned to
  text so an inherited CBM_LOG_FORMAT=json cannot change the verdict. Cache
  and runtime live under one temp root, so both are removed with it, also
  on failure, after the daemon is stopped.
- tests/windows/mcp_stdio.py: close() joins the stderr reader, and the new
  stderr_complete() reports whether the reader reached EOF. The guard reads
  stderr only after it has; a reader still running after the server exited
  is a SETUP failure (exit 2), never a verdict on a partial capture.
- scripts/test-windows.ps1: registers the guard in the green guard list
  and documents it in the header.

DeusData#2213 was an earlier duplicate of the same check.

Refs DeusData#654.

Distilled from DeusData#2217.

Co-authored-by: lorenzozanee <[email protected]>
Co-authored-by: Shinken009 <[email protected]>
Signed-off-by: Martin Vogel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-notes Internal observations and improvement notes priority/normal Standard review queue; useful PR with ordinary maintainer urgency. windows Windows-specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] MCP stdio startup emits localized path-not-found message on stderr

2 participants