Repository navigation
fix(omp): keep the tool_call branch probe quiet outside a git repo - #190
Merged
Merged
Conversation
|
🎉 This PR is included in version 2.90.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #189.
extensions/omp-hooks.tscurrentBranch()rangit rev-parse --abbrev-ref HEADwith nostdiooption. Node
execSyncthen inherits fd 2, so in a session rooted inside a repo, any bash commandthat
cds into a non-repo directory (cd /tmp/x && ls) paintedfatal: not a git repository …over the TUI input line. Thecatchswallowed the exception butnot the already-written bytes — invisible to the agent and to the session file.
inGitRepo(cwd)first (alreadystdio: "ignore"), so a non-repo target spawns no gitprocess at all, and give the probe
stdio: ["ignore", "pipe", "ignore"]for the real-repo path."unknown", which is what the protected-branch checks alreadytreat as "not protected"; resolution inside a real repo is verified below.
Regression guard
scripts/omp-smoke.tsgains an opt-in probe (OMP_SMOKE_SILENT_TOOL_CALL=1) that calls the realtool_callhandler withcd <non-repo temp dir> && lsand asserts it is not blocked.scripts/validate-omp-extension.sh(already in CI) runs it with stderr captured and fails on anyfatal: not a git repository.Evidence
FAIL: tool_call leaked git stderr onto the TUI: fatal: not a git repository (or any of the parent directories): .gitok : tool_call writes nothing to stderr for a non-repo target{repo: "fix/omp-hooks-stderr-leak", nonRepo: "unknown", missing: "unknown"}, 0 stderr bytescompliance=0,run-verification-gates=0,sync-skills=0,trace-stories --strict=0Test plan
bash scripts/validate-omp-extension.sh→ passedcd /tmp/scratch && lsprints nofatal: