You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: preserve prompt quoting in gemini CLI invocation
The GEMINI_ARGS variable caused word-splitting on the multi-line PROMPT
string, breaking the gemini CLI argument parsing. Use a separate
DEBUG_FLAG variable instead and keep "${PROMPT}" quoted in each
invocation.
Ref: #479
# Run Gemini CLI with the provided prompt, using JSON output format
321
321
# We capture stdout (JSON) to TEMP_STDOUT and stderr to TEMP_STDERR
322
322
if [[ "${OUTPUT_TO_FILE}" = true ]]; then
323
323
echo "::notice::Gemini CLI output redirected to files (gemini-artifacts/)"
324
-
if ! gemini ${GEMINI_ARGS} 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
324
+
if ! gemini ${DEBUG_FLAG} --yolo --prompt "${PROMPT}" --output-format json 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
325
325
FAILED=true
326
326
fi
327
327
elif [[ "${GEMINI_DEBUG}" = true ]]; then
328
328
echo "::warning::Gemini CLI debug logging is enabled. This will stream responses, which could reveal sensitive information if processed with untrusted inputs."
329
329
echo "::: Start Gemini CLI STDOUT :::"
330
-
if ! gemini ${GEMINI_ARGS} 2> >(tee "${TEMP_STDERR}" >&2) | tee "${TEMP_STDOUT}"; then
330
+
if ! gemini ${DEBUG_FLAG} --yolo --prompt "${PROMPT}" --output-format json 2> >(tee "${TEMP_STDERR}" >&2) | tee "${TEMP_STDOUT}"; then
331
331
FAILED=true
332
332
fi
333
333
# Wait for async stderr logging to complete. This is because process substitution in Bash is async so let tee finish writing to ${TEMP_STDERR}
334
334
sleep 1
335
335
echo "::: End Gemini CLI STDOUT :::"
336
336
else
337
-
if ! gemini ${GEMINI_ARGS} 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
337
+
if ! gemini --yolo --prompt "${PROMPT}" --output-format json 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
0 commit comments