Repository navigation
stewards: read a worker's model from its first turn, not the project defaults - #65
Conversation
…defaults validateWorkerSpawn ran on thread.created and asked the server for the worker's defaultExecutionOptions. A just-created thread is pending until its first turn is admitted (136 s for one hiringloop review worker under the concurrency limit) and has no execution recorded yet, so the server fell back to the project's remembered defaults for the provider: the owner's own picker choices (claude-fable-5-1, medium on hiringloop). Every claude-code worker spawned with the playbook's opus-5-5/high was recorded as "Started with the wrong model claude-fable-5-1 ... reasoning level medium; stopped", while the stop on the pending thread did nothing and the worker ran on with the right model anyway. The stewards then paused on a host fault that did not exist. Read the spawn's execution from the thread's own first client/turn/requested event instead. When it is not there yet, check provider and environment now and the model when the thread goes active, which is when the first turn has been dispatched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Independent review running in bb thread @thread:thr_uwhhca7bxm. _— from bb thread |
Review round 1 (GLM 5.3, at a7d090f)Owner review required: no — none of the owner-reviewed triggers apply. A narrow bug fix in a live plugin's runtime code that makes the existing safety net do what it was already meant to do; no contract, setting, default or migration changes. The PR body's classification matches. Blockers
Suggestions
Checked
|
The wait for a worker's first turn was an in-memory set, lost when the server restarts while the worker is still pending; its model would then never be checked. Keep it as model_check_pending on the workers table (append-only migration), set in validateWorkerSpawn, read and cleared on thread.active, cleared on archive and delete. The test fake now answers defaultExecutionOptions for a pending thread with the project's picker defaults, as the server does, so the test pins the production symptom. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Round 1 addressed in acdee13.
_— from bb thread |
Review round 2 (GLM 5.3, at acdee13)Owner review required: yes — this round added a store migration ( Blockers
Suggestions
Resolved since round 1
Checked
|
|
Round 2 addressed: the PR body's Lane section now says owner-reviewed and names the store migration. No code change; head stays at acdee13. @trotterdylan, your approval is needed before this merges. _— from bb thread |
Review round 3 (GLM 5.3, at acdee13)Owner review required: yes — store migration ( Resolved since round 2
Checked
No blockers remain. Owner approval (@trotterdylan) is the only thing between this PR and merge. |
|
LGTM |
|
Merged: owner-reviewed, approved by trotterdylan on acdee13 (comment 2026-10-23T15:18:59Z), reviewer approved the same sha in round 3, checks green. Squash commit c3f0857 on main. This moves the bb-server pin: the next bb-gate bb-server tick builds a new image and stages a restart for every developer's server (Settings → Plugins → Team setup, or the quiet window). _— from bb thread |
What
validateWorkerSpawn(the post-spawn safety net) read the worker's model and reasoning level throughthreads.defaultExecutionOptionsonthread.created. A just-created thread ispendinguntil its first turn is admitted (136 s for one hiringloop review worker, under the concurrency limit) and has no execution recorded, so the server resolved the project's remembered defaults for the provider instead: the owner's own picker choices (claude-fable-5-1/mediumon hiringloop). Every claude-code worker spawned with the playbook'sclaude-opus-5-5/highwas recorded asStarted with the wrong model claude-fable-5-1 instead of claude-opus-5-5, reasoning level medium instead of high; stopped, the stop on the pending thread did nothing, and the worker ran on with the right model. The project steward then diagnosed a host fault on barney and paused the hiringloop stewards on a question to the user.Now the plugin reads the spawn's execution from the thread's own first
client/turn/requestedevent. When that event is not there yet, provider and environment are checked at once and model and reasoning level when the thread goesactive, which is when the first turn has been dispatched. A stop at that point also reaches a running thread. The wait is kept on the worker row (model_check_pending, an append-only migration), so a server restart while the worker is pending does not lose it.Lane
Owner-reviewed: the change includes a store migration (
WORKER_CHECK_MIGRATIONS,ALTER TABLE workers ADD COLUMN model_check_pending INTEGER NOT NULL DEFAULT 0, appended toMIGRATIONS), which is an owner-reviewed trigger whatever its shape. The runtime change itself is a narrow bug fix that makes the safety net do what it was already meant to do, with no contract, setting or default changes. @trotterdylan, this needs your approval before it merges.Tests
npx tsc --noEmitclean.npx vitest runinplugins/stewards: 375 passed, including new tests for a worker whose first turn is dispatched after creation (not stopped at creation even thoughdefaultExecutionOptionsanswers with the project defaults; stopped when the model is wrong atthread.active, left alone when right, not re-checked on later turns) and for the pending flag surviving a reopened store and defaulting to false for pre-migration rows.Shipping
Merging to
mainmoves thebb-serverpin, builds a new image and stages a restart for every developer's server (Settings → Plugins → Team setup, or the quiet window).🤖 Generated with Claude Code