Skip to main content

Module flares

Module flares 

Source
Expand description

#171: a flare run — N read-only sibling agents on one task, and the merge of what they said.

A flare is one child agent: its own session (origin = "flare:<run>:<n>"), its own route, a small iteration budget, and a registry holding only the readers (READ_TOOLS). A flare run is the set of them on one task, plus the merge. The lead is unchanged — it is the only agent that writes.

This is not a second runtime. A flare is what a delegate child is, times N, plus a scheduler: DelegateTool::run_child builds both, so the preamble, the hooks, the usage capture and the cancellation are one implementation with two callers.

§Why local runs are serial, and why that is correct

A local server serves one model at a time — llama-swap swaps by stopping one to start another — so N flares on one local route are N sequential turns. Parallelism buys nothing there; what it buys is isolation: each flare reads its own files, and the lead’s context never fills with them. Mixed routes are the case where concurrency is real: three cheap local readers plus one cloud thinker run in two slots, not four. So the cap is per server, which is why a route can name a group: two routes pointed at one box are one slot.

§What keeps a fan-out safe

Every flare is read-only, and read-only is a property of its registry, not of a policy: it is narrowed to READ_TOOLS by crate::tools::ToolRegistry::only, so a tool_call bridge cannot reach anything that is not there. Approvals stay one at a time on purpose (runtime.rs’s gate), and a read-only flare asks nothing at all.

Structs§

FlareJob
One job as the lead states it.
FlareLine
One child’s row in the run’s report.
FlareTool
The flares tool.
RouteSlot
What a route offers a run: its name, how many flares may share it, and which server it is.
RunResult
A finished run: its children, in the lead’s order.
Slots
The cap a run actually has: one number per server, and the sum of them, floored by [flares] max_concurrent.

Enums§

Merge
How a run’s answers come back.
State
How a child ended, as one word the ledger and the readout both use.

Constants§

MAX_FLARES_PER_RUN
The most jobs one call may name. A model that wants more has not split the task, it has multiplied it; the CLI’s -n is where a bigger number is typed deliberately.
READ_TOOLS
The tools a flare does have (#548): the readers, named one at a time.

Functions§

slots