Repository navigation
fix(issue-triage): forbid stdin redirection with bridged gh CLI - #943
Merged
Merged
Conversation
The flue `defineCommand` shim used to expose `gh` and `git` to the agent runs commands via `child_process.execFile` and never forwards just-bash's stdin into the spawned process. When the issue-triage agent ran `gh issue edit ... --body-file - < /workspace/...md` (run 25576059392), `gh` blocked on an unwritten stdin pipe until the 5-minute stage timeout fired. The mutation also wiped the body of issue #941 to an empty string before the kill. Update the issue-triage skill so the model: - Treats stdin redirection (`<`, `<<`, `<<<`) and `--body-file -` as forbidden when invoking bridged commands. - Always passes content via a real file path (`--body-file <path>`). - Runs each `gh` mutation in its own bash invocation and never chains an edit with a verification call. - Trusts a successful `gh issue edit` instead of re-running it to verify, which is what triggered the second, hanging call. Co-Authored-By: Cursor Agent <[email protected]>
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.
What
Tighten the
issue-triageskill prompt so the agent never tries to feed input intoghvia shell stdin redirection or--body-file -.Why
Run 25576059392 hung for 5 minutes and then failed during the
apply-triage-updatestage:The agent had already run a successful
gh issue edit ... --body-file /workspace/issue-941-body.md --title "..."a few seconds earlier, then re-ran the edit using--body-file -to "verify" the result. That second invocation hung until the 5-minute stage timeout, and along the way wiped the body of issue #941 to an empty string.Root cause
The agent shells out through Flue's
defineCommand:The
envform in@flue/sdk/dist/node/index.mjsruns commands viachild_process.execFile(name, args, mergedOpts)— it never forwards stdin from the simulatedjust-bashshell into the spawned process. When the model uses shell redirection (< file) or--body-file -, the redirected bytes are read by the simulated shell and then dropped on the floor; the realghprocess is launched with an unwritten stdin pipe and blocks onread()forever.just-bashis itself a "simulated bash environment with virtual filesystem" (see the package README), so any feature that depends on the OS shell forwarding stdin into a bridged binary is unsafe.Fix
Update
.agents/skills/issue-triage/SKILL.mdto make the limitation explicit, since this is a prompt-level mitigation:<,<<,<<<), process substitution, and--body-file -/--body -against any bridged command (gh,git, ...).apply-triage-updateandclose-duplicatestages now require:/workspace/issue-<n>-body.md).--body-file <path>.ghmutation in its own bash invocation (no&&chains with verification reads).gh issue editexit code instead of re-running it to verify, which is exactly what triggered the hang.Notes / follow-ups
issues:write, so I could not restore it from this branch — a maintainer should re-run the triage agent (or paste the proposed body back manually) once this lands.defineCommandproperly forwardjust-bash's stdin intoexecFile, but that's an upstream@flue/sdkchange. The SKILL update is a defensive mitigation that prevents the failure mode regardless.defineCommandlayer (e.g. wrappingghto reject--body-file -), but the function-formdefineCommandin flue 0.3.11 only receivesargs(not the bashctx), so we can't currently do that without forking the wrapper.Quality gate
pnpm run lint✅pnpm run tsc✅pnpm run testnot run — change is prompt-only and there are no tests covering the SKILL prose. The triage agent is exercised end-to-end on the next opened issue.Slack Thread