-
Notifications
You must be signed in to change notification settings - Fork 35
t1896: Resolve specific model name in dispatch comments instead of auto-select (round-robin) #17503
Copy link
Copy link
Closed
Labels
auto-dispatchAuto-created from TODO.md tagAuto-created from TODO.md tagorigin:workerCreated from worker sessionCreated from worker sessionstatus:doneTask is completeTask is completetier:simpleHaiku-tier sufficient: docs, formatting, config, simple renamesHaiku-tier sufficient: docs, formatting, config, simple renames
Description
Problem
Dispatch comments posted by pulse-wrapper.sh show Model: auto-select (round-robin) when no explicit tier override is set (the common case). This makes it impossible to correlate worker success/failure with the specific model that was used.
Example current output:
Dispatching worker (deterministic).
- **Worker PID**: 12345
- **Model**: auto-select (round-robin)
- **Runner**: marcusquinn
- **Issue**: #17490
Root Cause
pulse-wrapper.sh line 6492:
local display_model="${selected_model:-auto-select (round-robin)}"When selected_model is empty (no tier override), the fallback is a generic string. The actual model is chosen later by headless-runtime-helper.sh's _choose_model_auto() inside the worker process, which runs asynchronously after the dispatch comment is posted.
Fix
Pre-resolve the model using the existing select subcommand before launching the worker. This:
- Gives us the specific model name for the dispatch comment
- Allows passing it via
--modelso the worker uses exactly what we display (no divergence)
Implementation (pulse-wrapper.sh, ~line 6453)
Replace the current model selection block:
# BEFORE (lines 6453-6456)
local selected_model=""
if [[ -n "$model_override" ]]; then
selected_model="$model_override"
fiWith:
# AFTER
local selected_model=""
if [[ -n "$model_override" ]]; then
selected_model="$model_override"
else
# Pre-resolve the round-robin model so we can display it in the dispatch
# comment AND pass it to the worker (ensuring comment matches reality).
selected_model=$("$HEADLESS_RUNTIME_HELPER" select --role worker 2>/dev/null) || selected_model=""
fiAnd update the display_model fallback (line 6492):
# BEFORE
local display_model="${selected_model:-auto-select (round-robin)}"
# AFTER — only falls back if select failed (all models backed off)
local display_model="${selected_model:-all models backed off}"Key considerations
- The
selectsubcommand calls_choose_model_auto()which respects backoff DB, auth availability, and round-robin rotation. It also updates the round-robin state, so the next call rotates correctly. - If
selectreturns empty (exit 75 — all backed off),selected_modelstays empty,--modelis omitted, and the worker falls back to its own retry logic. The dispatch comment shows "all models backed off" instead of the misleading "auto-select". - Since we now always pass
--modelwhen a model is resolved, the worker's internalchoose_model()gets an explicit model and skips its own round-robin — preventing the rare case where the dispatch comment and actual model diverge.
Files to change
.agents/scripts/pulse-wrapper.sh— lines ~6453-6456 and ~6492
Acceptance criteria
- Dispatch comments show specific model ID (e.g.,
anthropic/claude-sonnet-4-6) instead ofauto-select (round-robin) - ShellCheck clean
- When all models are backed off, comment shows
all models backed off(not a false specific model) - Round-robin rotation still works correctly (the
selectcall advances the rotation state)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
auto-dispatchAuto-created from TODO.md tagAuto-created from TODO.md tagorigin:workerCreated from worker sessionCreated from worker sessionstatus:doneTask is completeTask is completetier:simpleHaiku-tier sufficient: docs, formatting, config, simple renamesHaiku-tier sufficient: docs, formatting, config, simple renames