You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Orchestrator hierarchy: one orchestrator per project with sub-orchestrators per lane, switched out on a schedule #1156
area:agentsOrchestration, slots, delegate, handoff, wake-ups, model policy, review rulessize:bigMulti-part feature, design, research or audit (usually has sub-issues)type:featureNew behaviour or capability
Why: one orchestrator thread per project does everything: PR queue, reviews, merges, CI, issues, machine updates, owner questions. A study of 40 days of agent transcripts found orchestrator threads used 23% of all tokens (174k tokens per turn, against 98k for a review agent) and sat 64.6 h blocked on foreground sub-agents. Long sessions also get slower and compact often, and one thread is a single point of failure.
Idea: keep ONE orchestrator per project as the thread the owner talks to and sees, and give it sub-orchestrators: child agents with an orchestrator role that each own a lane (for example the PR queue, the issue backlog, CI and machines), run their own children, and report up in short summaries. Sub-orchestrators and the main one are switched out on a schedule (fresh session from generated state, e.g. daily or after about 300 turns) without losing the children they run.
Design questions:
Which lanes, and how a lane hands an item to another lane.
Design summary: lanes under one project orchestrator
This is a design only; no code is written yet. Three options were compared.
What exists already
Most of the hierarchy can be assembled from parts that are already there:
Upstream: nested delegate_task children that show inside their parent's view and not in thread lists; a child's result wakes its parent, not the root; approval and secret requests roll up to the listed ancestor; t3_thread_send; scheduled tasks.
Fork: handoff in the same thread (the thread id, children, waits and watched PRs are kept), the threadRoles orchestrator pointer, wait_for, delegated results with reminders, agent slots, usage pacing, the slot filler route, lens_start, MCP profiles, stopping finished children, run records.
Missing: a role for a long-lived child, a lane concept, a claim on a PR or issue, switch-out by turns or age, and a lane view for the owner.
Options
A: by convention
B: server lanes + agents
C: lane programs
What it is
Long-lived children with a "you run the PR queue" brief and hand-kept state files
The server holds the lane registry, claims, state and reports; a lane thread is an ordinary delegated child that decides only what needs judgement
Each lane is a tested program that starts a short agent for single judgement steps
Server code
none
small, in fork files
large, per lane
Two lanes on one PR
not prevented
refused by the claim store
refused by the claim store
A lane dies half-way
found by hand
noticed by a watchdog, replaced from state on disk
a service restart
Token cost
lane contexts plus a main turn per report
lane contexts; main turns only for escalations
lowest
Time to first value
days
2-3 weeks of small PRs
months
Recommendation: B, built so a lane can move to C step by step
Lanes are defined in settings (off by default, person-only): pr-queue and issues first, ops and temporary campaign lanes later. No lane per machine by default, because placement rules already decide where work runs. Two levels only: main, lanes, workers.
One owner per item. An item (pr:<repo>#<n>, issue:<repo>#<n>) is claimed by one lane. A second claim is refused, and lens_start and the slot filler refuse a caller that is not the owner. Each lane thread has a generation number, so a replaced thread can no longer act as the lane.
Workers wake the lane, not the main orchestrator. A lane's workers have the lane thread as parent. The main orchestrator reads a short board when it needs to, and is woken only by escalations (delivered at least once, joined into one message).
Switch-out is the existing same-thread handoff with two new triggers (turn count, age) and a new notes source: the lane's state file, read live by the server. The agent does not have to write its own handoff. A new thread is started only when the old one is dead, in journaled steps that are safe to repeat.
The owner sees one row per project, with a small row per lane under it and a Lanes panel in the main thread. Requests from any depth flag the main row.
A lane gets a driver:agent now, program later. The stores and the board are the same for both, so routine steps can move into code (direction C, and Orchestrator logic as software, not prose #870) without changing what the owner sees.
Failure cases
Case
What happens
A lane thread dies half-way
Its claims, notes, waits and children are on disk or live in T3. It is replaced from that state, and results owed by its running workers are forwarded.
Two lanes claim the same PR
The second claim is refused, and tools that act on the item refuse a non-owner.
The main orchestrator is restarted
Same thread, fresh session, the board in its handoff. Lanes belong to the project, not to a thread id.
Usage runs out
Lanes pause and say so once. Events wait in queues and nothing is downgraded.
A lane store cannot be read
It counts as unknown, not empty: claims and starts are refused until it reads again.
Phased plan (small PRs, each with its tests and its state question)
A trial by convention with one lane, plus a lane field in run records, to measure first.
Settings and contracts.
Lane stores: registry, claims, outbox, notes.
lane_start, lane_stop, lane_board and a lanes tool group.
Claims and handover, with the owner check in lens_start and the slot filler route.
Reports up: lane_note, lane_escalate, joined delivery.
Switch-out: turn and age triggers, the lane-state handoff source.
Health and replacement: watchdog and lane_replace, report-only first.
The owner's view: lane rows and the Lanes panel (can be built in parallel once 3 is merged).
Rules and limits: owns rules, children per lane in the slot gate, tokens per level.
Lane programs for the routine steps of pr-queue.
The measure for the whole feature: orchestrator-level tokens per merged PR. If that number is not lower after two weeks, the setting goes off.
Open points for the owner (recommendation first)
May the orchestrator invent lanes? Recommended: no. Lanes are defined in settings, and the orchestrator switches defined lanes on and off.
Replace a dead lane thread automatically? Recommended: report-only for the first week, then automatic.
Which lanes first? Recommended: pr-queue and issues.
area:agentsOrchestration, slots, delegate, handoff, wake-ups, model policy, review rulessize:bigMulti-part feature, design, research or audit (usually has sub-issues)type:featureNew behaviour or capability
Activity
scuttletoby commentedon Nov 28, 2026
Design summary: lanes under one project orchestrator
This is a design only; no code is written yet. Three options were compared.
What exists already
Most of the hierarchy can be assembled from parts that are already there:
delegate_taskchildren that show inside their parent's view and not in thread lists; a child's result wakes its parent, not the root; approval and secret requests roll up to the listed ancestor;t3_thread_send; scheduled tasks.threadRolesorchestrator pointer,wait_for, delegated results with reminders, agent slots, usage pacing, the slot filler route,lens_start, MCP profiles, stopping finished children, run records.Missing: a role for a long-lived child, a lane concept, a claim on a PR or issue, switch-out by turns or age, and a lane view for the owner.
Options
Recommendation: B, built so a lane can move to C step by step
pr-queueandissuesfirst,opsand temporary campaign lanes later. No lane per machine by default, because placement rules already decide where work runs. Two levels only: main, lanes, workers.pr:<repo>#<n>,issue:<repo>#<n>) is claimed by one lane. A second claim is refused, andlens_startand the slot filler refuse a caller that is not the owner. Each lane thread has a generation number, so a replaced thread can no longer act as the lane.driver:agentnow,programlater. The stores and the board are the same for both, so routine steps can move into code (direction C, and Orchestrator logic as software, not prose #870) without changing what the owner sees.Failure cases
Phased plan (small PRs, each with its tests and its state question)
lanefield in run records, to measure first.lane_start,lane_stop,lane_boardand alanestool group.lens_startand the slot filler route.lane_note,lane_escalate, joined delivery.lane_replace, report-only first.ownsrules, children per lane in the slot gate, tokens per level.pr-queue.The measure for the whole feature: orchestrator-level tokens per merged PR. If that number is not lower after two weeks, the setting goes off.
Open points for the owner (recommendation first)
pr-queueandissues.🤖 Generated with Claude Code
Lanes, part 1: keep forkLanes' module-only constants unexported (knip) (
Lanes, part 2: keep the lane store's module-only constants unexported…
Lanes, part 1, round 1: built-in lanes survive the sparse settings wr…
Lanes, part 2: the lane store (registry, claims, outbox, notes) (#1156)
Lanes, part 2: keep the lane store's module-only constants unexported…
Lanes, part 2: read the lanes through laneDefinitions (built-in lanes…
Lanes, part 3: lane_start, lane_stop, lane_board, lane_claim, lane_re…
Lanes, part 3: read lanes through laneDefinitions; count lane tools a…
Lanes, part 2, round 1: own-key lookups, one spelling per item and es…
Lanes, part 3: lane_start, lane_stop, lane_board, lane_claim, lane_re…
Lanes, part 3: read lanes through laneDefinitions; count lane tools a…
Lanes, part 3: the store's own-key lookups and item normalizer in the…
Lanes, part 1: the lanes settings and the lane contracts (#1156)
Lanes, part 1: keep forkLanes' module-only constants unexported (knip) (
21 remaining items
Lanes, part 2, round 1: own-key lookups, one spelling per item and es…
Lanes, part 3: lane_start, lane_stop, lane_board, lane_claim, lane_re…
Lanes, part 3: read lanes through laneDefinitions; count lane tools a…
Lanes, part 3: the store's own-key lookups and item normalizer in the…
Lanes, part 3, round 1: every store refusal a tool code; starter-only…
Lanes, part 3, round 2: a gone starter frees the stop; startedBy on t…
Lanes, part 2: the lane store (registry, claims, outbox, notes) (#1156)…
Lanes, part 1: the lanes settings and the lane contracts (#1156) (#1164)
Lanes, part 2: the lane store (registry, claims, outbox, notes) (#1156)…
Merge origin/main into fork/armed-pr-sweep-880
Merge main into fork/1156-p3-lane-tools (#1156)
Lanes, part 3: the lane tools and the lanes tool group (#1156) (#1179)