Repository navigation
Description
TL;DR
When gemini_debug is enabled, the action streams all debug output to the console via tee and writes the full content to GITHUB_OUTPUT. Recent versions of Gemini CLI (post-0.25.x) significantly increased the volume of diagnostic output behind the --debug flag (auth info, API request/error counts, retry events, loop detection). This causes GITHUB_OUTPUT to exceed the ~1MB platform limit, resulting in truncated or failed step outputs.
Proposal
Add a new output_to_file boolean input (default: false) that, when enabled:
- Redirects all output to files only — runs with
--debugbut withoutteeto the console, same as non-debug redirection but with the--debugflag - Returns file paths as step outputs —
summarycontains the path togemini-artifacts/stdout.loganderrorcontains the path togemini-artifacts/stderr.log, instead of the file contents - Produces a compact job summary — instead of dumping the full response/error into the step summary, shows file sizes and paths
- Adds new outputs —
output_mode(contentorfile) andartifacts_dir(path togemini-artifacts/) so callers can programmatically detect the mode
When output_to_file is not set (or false), behavior is identical to today — full backwards compatibility.
Why file-based output?
- The
gemini-artifacts/directory already exists and is populated withstdout.log,stderr.log, andtelemetry.logon every run - Callers can upload these as artifacts (via
upload_artifacts: true), filter/process them in subsequent steps, or extract specific data (e.g., stats, traces) - This pattern naturally enables future
stream-jsonadoption — once output goes to a file, callers can parse NDJSON to extract both the final response and a step-by-step agent trace
Detailed design
The execution block (lines 294-307) would add a third branch:
if [[ "${GEMINI_DEBUG}" = true ]] && [[ "${OUTPUT_TO_FILE}" = true ]]; then
# Debug to files only — no console streaming
if ! gemini --debug --yolo --prompt "${PROMPT}" --output-format json \
2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
FAILED=true
fi
elif [[ "${GEMINI_DEBUG}" = true ]]; then
# Existing behavior: stream to console via tee
...
else
# Existing behavior: silent capture
...
fiThe output-setting block (lines 340-356) would conditionally emit paths or content:
if [[ "${OUTPUT_TO_FILE}" = true ]]; then
echo "gemini_response<<EOF" >> "${GITHUB_OUTPUT}"
echo "$(pwd)/gemini-artifacts/stdout.log" >> "${GITHUB_OUTPUT}"
echo "EOF" >> "${GITHUB_OUTPUT}"
else
# existing content-based output
fiRelated issues
- Summary output field contains invalid JSON when using json output format #381 —
summaryoutput contains invalid JSON due toEOFdelimiter handling. File-based output sidesteps this entirely since file paths don't containEOF. - Refactor scripts into own files from
action.yml#305 — Refactor scripts into own files. This change adds a small amount of logic to the existing bash block; if the refactor lands first, the change would go into the extracted script instead.
Additional information
I'm happy to submit a PR for this. My use case is a CI code review bot that uses gemini_debug: true with 80+ turn sessions, producing debug output that consistently exceeds GitHub's output limits.
Activity
gemini-cli commentedon Mar 11, 2026
🤖 Hi @michalszelagsonos, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.
feat: add file-based output mode to avoid exceeding GitHub Actions ou…
feat: add file-based output mode to avoid exceeding GitHub Actions ou…
refactor: decouple output_to_file from gemini_debug
docs: regenerate README with new input and outputs
fix: preserve prompt quoting in gemini CLI invocation
[-]feat: Add file-based output mode to avoid exceeding GitHub Actions output limits with debug enabled[/-][+]Add file-based output mode to avoid exceeding GitHub Actions output limits with debug enabled[/+]feat: add file-based output mode to avoid exceeding GitHub Actions ou…
refactor: decouple output_to_file from gemini_debug
docs: regenerate README with new input and outputs
fix: preserve prompt quoting in gemini CLI invocation
dashesy commentedon Apr 16, 2026
We hit this consistently when reviewing PRs with larger diffs. Our specific use case is watching long-running reviews live (sometimes 20+ minutes) to detect when the CLI is stuck vs. making progress — so
gemini_debug=trueis essential for our workflow, but the template-engine size limit makes it unusable as-is.Ideal fix from our side: keep
gemini_debug=true's live-streaming behavior (tee to stderr), but avoid dumping the unboundedTEMP_STDOUTinto$GITHUB_OUTPUTas a fallback.