Skip to content

Expand PID recognition for broker daemon and clean non-broker PIDs before spawn#143

Closed
SoundBlaster wants to merge 1 commit intomainfrom
codex/investigate-broker-mode-startup-issue-qyna3i
Closed

Expand PID recognition for broker daemon and clean non-broker PIDs before spawn#143
SoundBlaster wants to merge 1 commit intomainfrom
codex/investigate-broker-mode-startup-issue-qyna3i

Conversation

@SoundBlaster
Copy link
Owner

Motivation

  • Improve detection of running broker daemons across different installation/launch forms and avoid treating unrelated live processes as the broker when auto-spawning.

Description

  • Change _pid_belongs_to_broker to require the --broker-daemon token and accept multiple executable name tokens ("mcpbridge_wrapper", "mcpbridge-wrapper", and "xcodemcpwrapper").
  • Update _spawn_broker_if_needed to check _pid_belongs_to_broker and clean stale files when a live PID does not belong to the broker, and to rearrange the version-mismatch logic accordingly.
  • Add tests that exercise the expanded PID recognition and the behavior when a live unrelated PID is present, and update existing tests to mock the new PID-checking behavior where appropriate.

Testing

  • Ran the unit tests for the broker proxy module using pytest tests/unit/test_broker_proxy.py, which includes the new tests test_pid_belongs_to_broker_true_for_console_script_command, test_pid_belongs_to_broker_true_for_legacy_wrapper_command, and test_live_non_broker_pid_is_treated_as_stale.
  • All updated and new tests passed locally.

Codex Task

@SoundBlaster SoundBlaster marked this pull request as draft March 6, 2026 17:49
@SoundBlaster SoundBlaster deleted the codex/investigate-broker-mode-startup-issue-qyna3i branch March 7, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant