Skip to content

BUG-T9: Orphaned Web UI server process blocks port after MCP client disconnect or config change#110

Merged
SoundBlaster merged 8 commits into
mainfrom
feature/BUG-T9-orphaned-webui-process-clean-exit
Feb 28, 2026
Merged

BUG-T9: Orphaned Web UI server process blocks port after MCP client disconnect or config change#110
SoundBlaster merged 8 commits into
mainfrom
feature/BUG-T9-orphaned-webui-process-clean-exit

Conversation

@SoundBlaster
Copy link
Copy Markdown
Owner

Description

Fixes BUG-T9 by preventing orphaned wrapper processes from keeping the Web UI port bound after MCP client stdin disconnects.

Key changes:

  • Added on_stdin_closed callback support to run_stdin_forwarder().
  • Added terminate_bridge_process() with bounded shutdown behavior (SIGTERM then SIGKILL fallback after grace timeout).
  • Wired a one-shot stdin-closed callback in main() to terminate the upstream bridge when stdin reaches EOF.
  • Added/updated unit tests for EOF callback invocation, termination fallback behavior, and main-loop callback wiring.
  • Completed FLOW artifacts for BUG-T9 (PRD, validation report, review report, archive index updates).

Validation summary:

  • PYTHONPATH=src pytest659 passed, 5 skipped
  • ruff check src/ → pass
  • mypy src/ → pass
  • PYTHONPATH=src pytest --cov=src/mcpbridge_wrapper --cov-report=term-missing91.52% total coverage

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD improvement

Quality Gates

Before submitting, ensure all quality gates pass:

make check

Or run individually:

  • make test - All tests pass with ≥90% coverage
  • make lint - No linting errors
  • make format - Code is properly formatted
  • make typecheck - Type checking passes
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

If you modified files in docs/, ensure corresponding DocC files are also updated:

docs/ file DocC file
docs/installation.md mcpbridge-wrapper.docc/Installation.md
docs/cursor-setup.md mcpbridge-wrapper.docc/CursorSetup.md
docs/claude-setup.md mcpbridge-wrapper.docc/ClaudeCodeSetup.md
docs/codex-setup.md mcpbridge-wrapper.docc/CodexCLISetup.md
docs/troubleshooting.md mcpbridge-wrapper.docc/Troubleshooting.md
docs/architecture.md mcpbridge-wrapper.docc/Architecture.md
docs/environment-variables.md mcpbridge-wrapper.docc/EnvironmentVariables.md
README.md mcpbridge-wrapper.docc/mcpbridge-wrapper.md
  • Documentation changes are synced with DocC catalog (or N/A)

Testing

  • Added/updated tests for new functionality
  • All tests pass locally
  • Manually tested the changes

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated (if needed)
  • No new warnings generated
  • PR title is descriptive

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52c645e441

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcpbridge_wrapper/__main__.py
@SoundBlaster SoundBlaster merged commit b71c5a5 into main Feb 28, 2026
10 checks passed
@SoundBlaster SoundBlaster deleted the feature/BUG-T9-orphaned-webui-process-clean-exit branch February 28, 2026 10:43
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.

1 participant