Skip to content

feat(#390): MCP server SSE multi-client rejection - #411

Merged
admarble merged 4 commits into
mainfrom
feature/390-mcp-server-sse-transport-improvements-multi-client
Mar 24, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/390-mcp-server-sse-transport-improvements-multi-client

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Reject second SSE client with 409 Conflict when one is already connected
  • Health endpoint (/health) now reports connected: boolean for connection status
  • Automatic cleanup of transport reference on client disconnect via res.on('close')
  • 11 integration tests covering rejection, reconnection, health status, concurrency, and abrupt disconnect

Pre-PR AC Verification

AC Description Status Evidence
AC-1 Second SSE connection rejected with 409 ✅ Implemented src/commands/serve.ts:68-76
AC-2 First client notification if replaced N/A 409 rejection strategy — first client undisturbed
AC-3 Health endpoint reports connection status ✅ Implemented src/commands/serve.ts:86-94
AC-4 Test coverage for multi-client scenarios ✅ Implemented 11 tests in mcp-serve-multi-client.integration.test.ts
AC-5 Disconnect cleanup ✅ Implemented src/commands/serve.ts:77-80

Test plan

  • npm run build — passes
  • npm run lint — passes
  • npm test — 1844 tests pass (11 new multi-client integration tests)

Closes #390

Reject second SSE client with 409 Conflict, add connected status to
health endpoint, and clean up transport reference on disconnect.

Entire-Checkpoint: a68b6fd321ab
…ests from tautology detector

- Wrap server.connect() in try/catch to reset clientConnected flag on failure,
  preventing the server from getting stuck rejecting all clients
- Exclude __tests__/integration/ from tautology detector — integration tests
  exercise production code through process/HTTP boundaries, not direct imports

Entire-Checkpoint: a68b6fd321ab
The path-based exclusion in the CLI was wrong layer (not available to
library consumers), hardcoded convention (/integration/), and silent.

Instead, add a file-level @tautology-skip pragma to the detector library:
- hasTautologySkipPragma() checks first 10 lines for the pragma
- analyzeTestFile() returns early with skipped:true
- detectTautologicalTests() excludes skipped files from summary counts
- formatTautologyResults() reports skipped files transparently
- Revert CLI path filter (no longer needed)
@admarble
admarble merged commit eb2fa84 into main Mar 24, 2026
5 checks passed
admarble added a commit that referenced this pull request Apr 9, 2026
- Mixed-states: add #411 with ◂ resume symbol and # resume command
- Large batch: add 2 more exec→qa issues (13 total) so the 7 exec→qa
  issues split into 6+1, directly demonstrating Rule 7's >6 threshold
admarble added a commit that referenced this pull request Apr 9, 2026
…#512)

* docs: descope target architecture after overcomplexity review

Reviewed #503-#508 architecture for overengineering given project
scale (1 maintainer, 0 external users). Key changes:

- #504: descoped to emitter only, defer consumer migration
- #505: descoped to built-in registry, defer user extensibility
- #506: split to GitHubProvider async only, defer WorktreeManager
- #508: deferred entirely, fix log polling race separately

Added scope decisions table, deferred work table with explicit
triggers, and updated all diagrams to reflect revised scope.

Entire-Checkpoint: 5c90033d6aec

* fix: /assess batch output formatting + label-priority spec-skip

- Replace box-drawing command blocks with indented commands to
  prevent mojibake and overflow at any terminal width (AC-1)
- Add Rule 7: split commands at >6 issue numbers (AC-2)
- Add table column rules preventing mid-word truncation (AC-3)
- Add 11-issue large batch example (AC-4)
- Fix all existing examples for consistency (AC-5)
- Add label priority: domain labels override generic labels (AC-6)
- Amend skip-spec rule to exclude domain labels (AC-7)
- Add bug+auth label-priority example in batch output (AC-8)
- Sync all changes across 3 skill locations (AC-9)

Closes #494

* fix: remove PARK issue from command block in large batch example

Rule 1 states "Only PROCEED and REWRITE issues get commands" —
#496 (PARK) should not have a command line in the command block.

* docs: add CHANGELOG entry for #494

* fix: restore resume example + demonstrate Rule 7 split in examples

- Mixed-states: add #411 with ◂ resume symbol and # resume command
- Large batch: add 2 more exec→qa issues (13 total) so the 7 exec→qa
  issues split into 6+1, directly demonstrating Rule 7's >6 threshold
admarble added a commit that referenced this pull request Sep 9, 2026
- Mixed-states: add #411 with ◂ resume symbol and # resume command
- Large batch: add 2 more exec→qa issues (13 total) so the 7 exec→qa
  issues split into 6+1, directly demonstrating Rule 7's >6 threshold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server: SSE transport improvements (multi-client, rejection)

1 participant