Skip to content

fix: isolate Flow subprocesses from MCP stdin - #42

Closed
zt1901 wants to merge 1 commit into
OpenAdaptAI:mainfrom
zt1901:fix/isolate-flow-subprocess-stdin
Closed

fix: isolate Flow subprocesses from MCP stdin#42
zt1901 wants to merge 1 commit into
OpenAdaptAI:mainfrom
zt1901:fix/isolate-flow-subprocess-stdin

Conversation

@zt1901

@zt1901 zt1901 commented Aug 31, 2026

Copy link
Copy Markdown

Problem

The MCP server owns stdin as its JSON-RPC transport, but FlowRunner.run() and FlowRunner.certify() currently pass that live stream to openadapt-flow. A child command that probes or reads stdin can block indefinitely or consume MCP protocol bytes.

Change

  • launch both Flow subprocess paths with stdin=subprocess.DEVNULL
  • extend the shared CLI stub to record stdin
  • assert the isolation contract for both run and certify

Validation

  • uv run --extra dev pytest tests/test_runner.py tests/test_bridge.py::test_certify_result_is_fixed_copy_unless_protected_export_enabled -q (32 passed)
  • uv run --extra dev ruff check src/openadapt_agent/runner.py tests/conftest.py tests/test_runner.py tests/test_bridge.py
  • git diff --check

@zt1901
zt1901 requested a review from abrichr as a code owner August 31, 2026 12:30
@zt1901 zt1901 closed this Sep 1, 2026
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