fix(input-json): only read stdin with explicit --input-json -#341
fix(input-json): only read stdin with explicit --input-json -#341rafa-thayto wants to merge 2 commits into
--input-json -#341Conversation
🦋 Changeset detectedLatest commit: 9662f59 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
57f7feb to
e8a1e1b
Compare
e8a1e1b to
67106f9
Compare
wyattjoh
left a comment
There was a problem hiding this comment.
One minor test-cleanup note inline. The fix itself is correct: stopping expandInputJson from implicitly draining stdin is the right call, since that stdin is shared with commands that read their own body (clerk api, clerk config push).
Implicit stdin consumption (when stdin was not a TTY) parsed any piped data as the --input-json options payload, breaking `while read` loops and commands that read their own stdin (e.g. `cat body.json | clerk api`). Require the explicit `--input-json -` marker instead. Fixes #333
7d4ac9d to
9662f59
Compare
Summary
In agent mode the program-level
--input-jsonexpander consumed any non-TTY stdin and parsed it as the options payload, even when--input-jsonwas never passed. That broke two common patterns:Non-JSON stdin then failed with
invalid_jsonbefore the command ran. This makes stdin read only with an explicit--input-json -; piped stdin is otherwise left untouched.Test plan
bun test src/lib/input-json.test.tsandsrc/test/integration/input-json.test.tspass--input-json -Fixes #333