fix(shell): quote CLAUDE_MODEL_FLAG expansion in security.sh (#2717)

Use ${CLAUDE_MODEL_FLAG:+"${CLAUDE_MODEL_FLAG}"} to prevent word-splitting
and glob expansion on values containing spaces or special characters.
When the variable is empty/unset, this expands to nothing (no empty arg).

Note: qa.sh does not use CLAUDE_MODEL_FLAG so no change needed there.

Fixes #2698

Agent: style-reviewer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-17 12:30:56 -07:00 committed by GitHub
parent c6087534aa
commit ce91953649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -300,7 +300,7 @@ if [[ "${RUN_MODE}" == "triage" ]]; then
CLAUDE_MODEL_FLAG="--model google/gemini-3-flash-preview"
fi
claude -p "$(cat "${PROMPT_FILE}")" ${CLAUDE_MODEL_FLAG} >> "${LOG_FILE}" 2>&1 &
claude -p "$(cat "${PROMPT_FILE}")" ${CLAUDE_MODEL_FLAG:+"${CLAUDE_MODEL_FLAG}"} >> "${LOG_FILE}" 2>&1 &
CLAUDE_PID=$!
log "Claude started (pid=${CLAUDE_PID})"