mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 16:31:08 +00:00
fix: remove duplicate API key + model selection in spawn_agent() (#1462)
Steps 3-4 (get_or_prompt_api_key and model selection) were executed twice in spawn_agent() -- once before provisioning and once after. This caused redundant HTTP validation calls to openrouter.ai/api for every agent deployment (~130+ scripts use spawn_agent). The duplicate step numbering in comments (3,4,5 then 4,5,6) confirms this was accidental. Agent: code-health 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:
parent
be904cbe1c
commit
b603e05043
1 changed files with 1 additions and 9 deletions
|
|
@ -1720,15 +1720,7 @@ spawn_agent() {
|
|||
server_name=$(get_server_name)
|
||||
cloud_provision "${server_name}"
|
||||
|
||||
# 4. Get API key while server provisions (overlaps with cloud-init)
|
||||
get_or_prompt_api_key
|
||||
|
||||
# 5. Model selection while server provisions (if agent needs it)
|
||||
if [[ -n "${AGENT_MODEL_PROMPT:-}" ]]; then
|
||||
MODEL_ID=$(get_model_id_interactive "${AGENT_MODEL_DEFAULT:-openrouter/auto}" "${agent_name}") || exit 1
|
||||
fi
|
||||
|
||||
# 6. Wait for readiness (may already be done after OAuth)
|
||||
# 6. Wait for readiness
|
||||
cloud_wait_ready
|
||||
|
||||
# 7. Install agent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue