From 722dbe4e7ea5611135316db13e8df8fc579fe7a4 Mon Sep 17 00:00:00 2001 From: scottschreckengaust <345885+scottschreckengaust@users.noreply.github.com> Date: Wed, 12 Aug 2026 00:32:32 +0000 Subject: [PATCH] fix(agent): stop run.sh from shadowing the platform model default run.sh always passed -e ANTHROPIC_MODEL=${ANTHROPIC_MODEL:-}, so the variable was always set in the container and the agent's own os.environ.get("ANTHROPIC_MODEL", ) fallback in config.py was never reached. Local Docker runs therefore used a different model than deployed runs, and a future default bump would silently leave local runs behind. Pass the variable through only when the caller set it, matching the conditional-append pattern already used for the other optional vars, and stop restating the model literal in the usage text. Closes #743 Co-Authored-By: Claude --- agent/run.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/agent/run.sh b/agent/run.sh index 810794adc..bd7747c93 100755 --- a/agent/run.sh +++ b/agent/run.sh @@ -30,7 +30,7 @@ Environment variables (required): AWS_REGION AWS region for Bedrock (e.g., us-east-1) Environment variables (optional): - ANTHROPIC_MODEL Model to use (default: us.anthropic.claude-sonnet-4-6) + ANTHROPIC_MODEL Model to use (unset: defer to the agent runtime default) DRY_RUN Set to 1 to validate config and print prompt without running the agent MAX_TURNS Max agent turns (default: 100) @@ -205,13 +205,15 @@ DOCKER_ARGS=( -e "CLAUDE_CODE_USE_BEDROCK=1" -e "AWS_REGION=${AWS_REGION}" -e "GITHUB_TOKEN=${GITHUB_TOKEN}" - -e "ANTHROPIC_MODEL=${ANTHROPIC_MODEL:-us.anthropic.claude-sonnet-4-6}" ) # Repo URL (may be empty in server mode — sent via payload) [[ -n "${REPO_URL}" ]] && DOCKER_ARGS+=(-e "REPO_URL=${REPO_URL}") -# Optional env vars +# Optional env vars. Pass each through only when the caller actually set it, so an +# unset variable leaves the agent runtime's own default (agent/src/config.py) intact +# instead of being shadowed by a second default defined here. +[[ -n "${ANTHROPIC_MODEL:-}" ]] && DOCKER_ARGS+=(-e "ANTHROPIC_MODEL=${ANTHROPIC_MODEL}") [[ -n "${ISSUE_NUMBER}" ]] && DOCKER_ARGS+=(-e "ISSUE_NUMBER=${ISSUE_NUMBER}") [[ -n "${TASK_DESCRIPTION}" ]] && DOCKER_ARGS+=(-e "TASK_DESCRIPTION=${TASK_DESCRIPTION}") [[ -n "${DRY_RUN:-}" ]] && DOCKER_ARGS+=(-e "DRY_RUN=${DRY_RUN}")