Skip to content

feat(dispatcher): run fix-ci and resolve-conflicts on a Sonnet lane - #318

Merged
Ardnived merged 4 commits into
mainfrom
claude/sonnet-lane
Nov 25, 2026
Merged

Ardnived merged 4 commits into
mainfrom
claude/sonnet-lane

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • handlers.<handler>.model names the lane routine, keyed like a repo: ROUTINE_ID_<MODEL> (variable) and ROUTINE_TOKEN_<MODEL> (secret). fire.mjs's new routineFor picks it.
  • fix-ci and resolve-conflicts get "model": "sonnet". dispatcher.yml passes ROUTINE_TOKEN_SONNET and ROUTINE_ID_SONNET through.
  • While the lane is unset, nothing changes. A lane missing its id or its token falls back to the repo's routine. This PR is safe to merge before the routine exists.
  • docs/routine-setup.md §5 and the secrets table describe loop-sonnet. docs/why.md records 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-conflicts and fix-ci were 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)

  1. Create loop-sonnet: model Sonnet, cloning all five repos, the same environment and the same prompt as the repo routines (§5), with persist_session: false and clear_mcp_connections: true. If the routine settings expose effort, set it to high.
  2. Generate its token. Then run gh secret set ROUTINE_TOKEN_SONNET --org sydevs --visibility all and gh variable set ROUTINE_ID_SONNET --org sydevs --visibility all --body trig_….
  3. Watch the next fix-ci or resolve-conflicts: the act log reads fires 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: fireRetry retries the fire and holds the item Pending.

Tests

  • node --test dispatcher/test/*.test.mjs: 443 pass. The new routine.test.mjs covers the lane, a model with no lane routine, and a half-configured lane falling back.
  • Lean gate is green.

🤖 Generated with Claude Code

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-dispatcher

sydevs-dispatcher Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🤖 no session running

recent dispatches
  • 20:35Z address-review · attempt 1 · session · done
  • 20:35Z address-review · attempt 1 · session
  • 20:27Z review-pr · attempt 1 · session · done
  • 20:27Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 25, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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 — model and lane are 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, doFire in apply.mjs, fireDeps in deps.mjs, routine.test.mjs, the act and deps env blocks, workflow-state.yml, loop-config.json, both routine-setup.md sections, the why.md entry.
  • Ladder: one new piece, routineFor. The streamliner covered 1 and kept 1, with one finding on its return shape. Walking the skipped files raised the lane key. No new dependency.
  • Grepped for readers of handlers.*: model at payload.mjs:168, lane only in fire.mjs, and routine nowhere — so audit-nightly's is documentary.
  • workflow-state.yml passes secrets: inherit, so ROUTINE_TOKEN_SONNET reaches the dispatcher here. The other four callers are outside this session's repo scope and unread; required: false means 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

Comment thread loop-config.json Resolved
Comment thread dispatcher/fire.mjs Resolved
Comment thread docs/routine-setup.md Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
`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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Three critic findings, all adopted. Head is 2c6596e.

The first finding sharpened the second: keyed off model, unsetLane was set on every Opus fire, so the log announced a missing opus lane each time.

Security review ran, triggered by dispatcher/ and loop-config.json — no findings. Lean gate green. 443 dispatcher tests pass. The body's lane key is renamed, and its act log claim dropped.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@Ardnived
Ardnived enabled auto-merge November 25, 2026 20:44
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Ardnived
Ardnived added this pull request to the merge queue Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 25, 2026
Merged via the queue into main with commit a000d49 Nov 25, 2026
59 of 64 checks passed
@Ardnived
Ardnived deleted the claude/sonnet-lane branch November 25, 2026 20:45
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants