Skip to content

fix(omp): keep the tool_call branch probe quiet outside a git repo - #190

Merged
danielvm-git merged 3 commits into
mainfrom
fix/omp-hooks-stderr-leak
Nov 3, 2026
Merged

danielvm-git merged 3 commits into
mainfrom
fix/omp-hooks-stderr-leak

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

Summary

Fixes #189.

  • extensions/omp-hooks.ts currentBranch() ran git rev-parse --abbrev-ref HEAD with no stdio
    option. Node execSync then inherits fd 2, so in a session rooted inside a repo, any bash command
    that cds into a non-repo directory (cd /tmp/x && ls) painted
    fatal: not a git repository … over the TUI input line. The catch swallowed the exception but
    not the already-written bytes — invisible to the agent and to the session file.
  • Fix: ask inGitRepo(cwd) first (already stdio: "ignore"), so a non-repo target spawns no git
    process at all, and give the probe stdio: ["ignore", "pipe", "ignore"] for the real-repo path.
  • Fail-closed unchanged: non-repo → "unknown", which is what the protected-branch checks already
    treat as "not protected"; resolution inside a real repo is verified below.

Regression guard

  • scripts/omp-smoke.ts gains an opt-in probe (OMP_SMOKE_SILENT_TOOL_CALL=1) that calls the real
    tool_call handler with cd <non-repo temp dir> && ls and asserts it is not blocked.
  • scripts/validate-omp-extension.sh (already in CI) runs it with stderr captured and fails on any
    fatal: not a git repository.

Evidence

  • Red before fix:
    FAIL: tool_call leaked git stderr onto the TUI: fatal: not a git repository (or any of the parent directories): .git
  • Green after fix: ok : tool_call writes nothing to stderr for a non-repo target
  • Semantics probe: {repo: "fix/omp-hooks-stderr-leak", nonRepo: "unknown", missing: "unknown"}, 0 stderr bytes
  • Preflight on the branch: compliance=0, run-verification-gates=0, sync-skills=0,
    trace-stories --strict=0

Test plan

  • bash scripts/validate-omp-extension.sh → passed
  • Full Preflight green
  • Manual UAT: in a pi session rooted in a repo, cd /tmp/scratch && ls prints no fatal:

@danielvm-git
danielvm-git merged commit bcacf33 into main Nov 3, 2026
7 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 3, 2026
## [2.90.1](v2.90.0...v2.90.1) (2026-11-03)

### Bug Fixes

* **omp:** keep the tool_call branch probe quiet outside a git repo ([#190](#190)) ([bcacf33](bcacf33)), closes [#189](#189)
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.90.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

git error printed over TUI input line

1 participant