Repository navigation
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Formal verification. 4 change(s) tested, no difference found (not proven).
Graphify review — findings
Isolates every subprocess in prs.py with stdin=subprocess.DEVNULL so gh/git calls never inherit and block on the MCP stdio server's open stdin pipe. Fixes _detect_default_branch to pass an explicit repo positionally to gh repo view instead of the invalid --repo flag, and skips the local git symbolic-ref fallback entirely when an explicit repo is given, returning "main" rather than reading the current working directory's branch.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 324 functions depend on the 122 functions this change touches.
Health — this change adds coupling hotspots:
- new:
dispatch_command()— 2 callers, 123 callees - new:
_build_server()— 2 callers, 16 callees - new:
cmd_prs()— 2 callers, 12 callees - new:
_status_color()— 4 callers, 5 callees - new:
fetch_prs()— 5 callers, 4 callees - new:
_main()— 4 callers, 3 callees - new:
render_dashboard()— 1 callers, 10 callees - new:
render_pr_detail()— 1 callers, 8 callees - …and 5 more — each is listed as a finding
Verification — 324 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 136 function(s) in the blast radius were not formally verified this run
Formal verification
No difference found (not proven): No behavior difference found in \_detect\_default\_branch (not a proof).
The verifier ran both versions of \_detect\_default\_branch on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
No difference found (not proven): No behavior difference found in fetch\_pr\_files (not a proof).
The verifier ran both versions of fetch\_pr\_files on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
No difference found (not proven): No behavior difference found in fetch\_worktrees (not a proof).
The verifier ran both versions of fetch\_worktrees on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
No difference found (not proven): No behavior difference found in \_gh (not a proof).
The verifier ran both versions of \_gh on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
· 13 more finding(s) on lines outside this diff (see the check run).
|
Shipped in v0.9.55 — landed on |
Summary
Fixes #3318.
PR-related MCP tools (
list_prs,triage_prs, andget_pr_impact) could time out when Graphify was running over the stdio transport.The MCP server replaces stdin with a pipe that remains open for the lifetime of the process. PR-related
git/ghsubprocesses inherited that stdin, and Git for Windows could block while inspecting the handle. This caused the subprocess timeouts to cascade into MCP client request timeouts.This PR also fixes an independent
gh repo viewargument bug where--repowas incorrectly used even thoughgh repo viewexpects the repository as a positional argument.Changes
Pass
stdin=subprocess.DEVNULLto non-interactive PR subprocesses:_gh_detect_default_branchGit fallbackfetch_pr_filesfetch_worktreesFix
gh repo viewto pass the repository positionally.Prevent an explicitly supplied remote
repofrom falling back to the local repository's Git branch.Add regression tests for stdin isolation and repository argument handling.
Why
Before this fix,
list_prscould follow this timeout chain:The issue was specific to the MCP stdio process environment.
ghauthentication and network access were working normally.With child stdin redirected to
DEVNULL, the PR tools no longer inherit the MCP transport's open stdin pipe.Verification
pytest tests/test_prs.py→ 52 passedpytest tests/test_serve_http.py tests/test_serve.py→ 146 passed, 1 skippedgit diff --check→ cleanNo changes were made to
serve.py,export.py, or unrelated subprocess paths.