Skip to content

Fix tri-* CLI: pipe diff via stdin instead of argument - #26

Merged
5uck1ess merged 1 commit into
mainfrom
fix/tri-gemini-stdin
Apr 6, 2026
Merged

Fix tri-* CLI: pipe diff via stdin instead of argument#26
5uck1ess merged 1 commit into
mainfrom
fix/tri-gemini-stdin

Conversation

@5uck1ess

@5uck1ess 5uck1ess commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

Change $(cat /tmp/diff.txt) CLI arguments to cat diff.txt | command -p "{prompt}" for Codex and Gemini CLI fallbacks.

Problem

Large diffs exceed shell ARG_MAX when passed as command-line arguments, producing empty output. This was the root cause of empty Codex/Gemini results in tri-reviews — not a Gemini bug.

Fix

Both CLIs support stdin:

  • Codex: "If stdin is piped and a prompt is also provided, stdin is appended as a <stdin> block"
  • Gemini: "-p prompt. Appended to input on stdin (if any)"

Files changed

  • commands/tri-review.md — Codex and Gemini CLI fallbacks
  • commands/tri-security.md — Gemini CLI fallback

Test plan

  • CI passes
  • Next tri-review with large diff produces Gemini output

$(cat /tmp/diff.txt) as a CLI argument hits shell ARG_MAX on large diffs,
producing empty output. Both Codex and Gemini support stdin:
- Codex: stdin appended as <stdin> block when prompt also provided
- Gemini: stdin appended to -p prompt

Changed to: cat diff.txt | codex/gemini -p "{prompt}"

This was the root cause of empty Codex/Gemini output in tri-reviews
this session — not a Gemini bug.
@5uck1ess
5uck1ess merged commit c385e90 into main Apr 6, 2026
3 checks passed
@5uck1ess
5uck1ess deleted the fix/tri-gemini-stdin branch April 6, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant