Repository navigation
feat(dispatcher): run fix-ci and resolve-conflicts on a Sonnet lane - #318
Conversation
Every handler ran on the repo's Opus routine, and the routines account keeps hitting its usage limit. resolve-conflicts and fix-ci were 86 of 214 sessions from 2026-11-22 to 25, and both are bounded jobs that already hand back what they cannot settle. A handler's `lane` now names a routine keyed like a repo (ROUTINE_ID_<LANE>, ROUTINE_TOKEN_<LANE>). Until both are set the repo's routine runs it, so this merges safely before loop-sonnet exists, and unsetting the secret is the rollback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The change is the size of the problem: one resolver, one config key, a test, three doc edits. Nothing is smuggled in — routineIdFor and tokenFor are reused rather than replaced, and the id-and-token fallback really does make this safe to merge before the routine exists.
The one shape question is that the config now says the same thing twice. model and lane are both sonnet, and model is already load-bearing: workflow/lib/payload.mjs:168 copies it into the dispatch record. So on merge the record reads sonnet while the session still runs on the repo's Opus routine — "nothing changes" holds for behaviour, not for the record.
Findings
- should-fix —
modelandlaneare two keys for one value.loop-config.json:73 - should-fix — Streamline
routineFor's return to one lane field.dispatcher/fire.mjs:41 - should-fix — the fallback is stated twice in one file.
docs/routine-setup.md:357
What was checked
- Read whole on the branch:
dispatcher/fire.mjs,doFireinapply.mjs,fireDepsindeps.mjs,routine.test.mjs, theactanddepsenv blocks,workflow-state.yml,loop-config.json, bothroutine-setup.mdsections, thewhy.mdentry. - Ladder: one new piece,
routineFor. The streamliner covered 1 and kept 1, with one finding on its return shape. Walking the skipped files raised thelanekey. No new dependency. - Grepped for readers of
handlers.*:modelatpayload.mjs:168,laneonly infire.mjs, androutinenowhere — soaudit-nightly's is documentary. workflow-state.ymlpassessecrets: inherit, soROUTINE_TOKEN_SONNETreaches the dispatcher here. The other four callers are outside this session's repo scope and unread;required: falsemeans one that lists secrets explicitly degrades to the repo routine rather than failing.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`model` and `lane` carried the same value on both handlers, and `model` was already read into the dispatch record (workflow/lib/payload.mjs:168). Two keys for one value let them drift: a record could read `sonnet` while the fire chose a lane named something else. `routineFor` now reads `handlers.<handler>.model` as the lane name, so ROUTINE_ID_SONNET and ROUTINE_TOKEN_SONNET serve it unchanged, and the one key both documents the model and selects the routine. Addresses #318 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV4zZkEbWycaucGhPD
The return carried a tri-state across two mutually exclusive fields, `lane` and `unsetLane`, and keying the lane off `model` made `unsetLane` always set on fallback — so the act log announced "the opus lane has no routine id or token" on every Opus fire. `lane` alone now names the lane fired on, and is null when the repo's routine took it. The `→ routine <id>` log below already names the routine used, so the fallback needs no line of its own. Addresses #318 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV4zZkEbWycaucGhPD
The secrets table repeated what §5 already says, with the why link, and `routineFor` shows. The row's job is what to set. Addresses #318 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV4zZkEbWycaucGhPD
|
Three critic findings, all adopted. Head is 2c6596e.
The first finding sharpened the second: keyed off Security review ran, triggered by 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. 🤖 Written by the sydevs autonomous loop — see what this is
Summary
handlers.<handler>.modelnames the lane routine, keyed like a repo:ROUTINE_ID_<MODEL>(variable) andROUTINE_TOKEN_<MODEL>(secret).fire.mjs's newroutineForpicks it.fix-ciandresolve-conflictsget"model": "sonnet".dispatcher.ymlpassesROUTINE_TOKEN_SONNETandROUTINE_ID_SONNETthrough.docs/routine-setup.md§5 and the secrets table describeloop-sonnet.docs/why.mdrecords why.The failure this prevents
Every session runs on Opus, and the Routines account keeps hitting its usage limit. From 2026-11-22 to 25,
resolve-conflictsandfix-ciwere 86 of 214 sessions. Both are bounded jobs: merging the base, or fixing one red check against the lean gate. Both already hand back what they can't settle. So a weaker model costs a hand-back, never a guess. Review, implementation and address-review stay on Opus.To switch it on (owner, on the Routines account)
loop-sonnet: model Sonnet, cloning all five repos, the same environment and the same prompt as the repo routines (§5), withpersist_session: falseandclear_mcp_connections: true. If the routine settings expose effort, set it tohigh.gh secret set ROUTINE_TOKEN_SONNET --org sydevs --visibility allandgh variable set ROUTINE_ID_SONNET --org sydevs --visibility all --body trig_….fix-ciorresolve-conflicts: theactlog readsfires on the sonnet lane.Rollback: delete either the variable or the secret.
Risk
If the routine fire cap is per routine, this lane concentrates about 40% of fires on one routine. The 429 handling still applies:
fireRetryretries the fire and holds the item Pending.Tests
node --test dispatcher/test/*.test.mjs: 443 pass. The newroutine.test.mjscovers the lane, a model with no lane routine, and a half-configured lane falling back.🤖 Generated with Claude Code