Repository navigation
fix(branch): --agent-stdin keeps the piped brief with an issue flag (#359) - #360
Conversation
…359) oclif fills a positional that was not given from piped stdin, so with --linear, --github, --jira or --clickup the parse drained the pipe before readBriefStdin ran, and every linear-listen delegation failed with an empty brief. branchName now sets ignoreStdin, and a test runs the real oclif parse with a piped brief for each issue flag. Closes #359
There was a problem hiding this comment.
code-reviewer: minor issues
This sets ignoreStdin: true on branch's branchName positional. With an issue flag and no positional, oclif's parser used to drain piped stdin before readAgentBrief ran, so the brief read empty. The fix is the right lever, since oclif skips its stdin fallback only for args that set ignoreStdin, and the new test exercises the real Parser.parse for all four issue flags. I found no correctness problems, only one small suggestion on the test.
Reviewed 31c0a70 for baldurpan · claude-opus-5-5 · 3 files · $0.21
There was a problem hiding this comment.
code-reviewer follow-up: looks good
Since the last review, the redundant second test was replaced with the case where --agent-stdin is given with no issue flag and no positional branch name. It asserts that branchName stays unset and the brief remains on stdin. The earlier comment is addressed, and the change looks sound.
Earlier comments
- Fixed; yours to resolve: Suggestion: Second test repeats the first; cover the no-issue-flag case instead
Reviewed a52854f (changes since 31c0a70) for baldurpan · claude-opus-5-5 · 1 file · $0.03
What changed
worktree branch --agent-stdinused to read an empty brief whenever the branch came from an issue flag (--linear,--github,--jira,--clickup). Everylinear-listendelegation failed with "The agent brief from --agent-stdin is empty."Cause: when a positional arg is not given, oclif's parser fills it from piped stdin (
tryStdinin@oclif/core/lib/parser/parse.js). It skips this only when the arg setsignoreStdin. With an issue flag,branchNameis never given, sothis.parse(Branch)drained the pipe beforereadBriefStdinran.src/commands/branch.ts:branchNamenow setsignoreStdin: true.src/commands/branch-stdin.test.ts: runs the real oclifParser.parsewithBranch.args/Branch.flags, a piped non-TTY stdin and each issue flag. It asserts thatbranchNamestays unset and the brief is still on stdin. All 5 tests fail without the fix and pass with it..changeset/quiet-pipes-listen.md: apatchnote.Only
branchdefines--agent-stdin.checkouttakes only--agent(its docs say it has no--agent-stdin), so no other command needs the change.Gates
context/verify.md):pnpm check0 errors;pnpm typecheck,pnpm buildexit 0;pnpm test: 56 files, 3831 tests pass.reviewersubagent): PASS WITH NOTES, nothing blocking. Non-blocking notes:not.toBe(brief)) adds nothing to the first'stoBeUndefined().worktree branchwith no positional no longer fillsbranchName. This was never documented.Branch.runend to end.checkout/open/remove/rename/configpositionals keep oclif's default. That is harmless while none of them reads stdin.Release note
Paths checked:
src/**owed a note, written atpatch(level confirmed).docs/**,context/**or.github/**path is touched.docs/src/content/docs/commands/branch.mdx:61(cat brief.md | worktree branch --github 42 --agent-stdin) is now true as written.Closes #359