Expand description
Empty-title recovery: a running agent with conversation and no usable
session title gets one, written straight to its block’s
term:ambient_summary, which the pane header and the Swarm row read.
The title is otherwise computed only when a human submits a message
(useAgentActivitySummary.ts). An agent driven by jekts or tool work, one
reattached mid-turn, or one whose title call failed or abstained could sit on
an empty title for as long as it ran. This sweep is the second route.
It replaces what this module used to do: a “what is being worked on” summary
every 20 s for every running agent, published as an agent:summary event that
nothing subscribed to, so every call was spent and its output went nowhere.
Now an agent that already has a title costs nothing here.
docs/specs/SPEC_AMBIENT_SWARM_SUMMARY_HARDENING_2026_10_02.md sections 2.1
(defects 2 and 5), 5.6 and 5.7.
Each call goes through crate::ambient::tasks::generate_recovered_title, so
the Ambient Model Call gateway admits, cancels and accounts for it under its
own purpose tag, distinct from the pane’s own title request.
Cost controls:
- only agents whose controller is running (
STATUS_RUNNING) and that have no usable title; - only agents whose
outputis in a shape the digest can read (digest::reads_output_format); another provider’s file holds no conversation it can find; - only when the block’s
outputhas grown since the last completed attempt; - at most
MAX_ATTEMPTScompleted attempts per block while the title stays empty, counted again from zero once a title exists, so an agent whose activity never shows what the work is (the model abstains) stops costing; - no conversation in the digest means no call at all (
digestreturnsNonefor activity with no user or assistant text); - one call in flight per block, waiting in the background class’s queue
(
ambient::limits) across all blocks; - per-block bookkeeping is pruned each tick against the registration list.
Structs§
- Attempts 🔒
- Per-block state the sweep keeps between ticks.
Constants§
- MAX_
ATTEMPTS 🔒 - Completed attempts per block while its title stays empty. Bounded, as the
lysdesign bounds its retries (spec section 3, research point 2). - SWEEP_
INTERVAL_ 🔒SECS - How often to sweep registered agents.
- WORD_
TARGET 🔒 - Word budget for a recovered title: within the range the pane’s own request uses (5 to 12, by pane width), so a recovered title looks like any other.
Functions§
- run_
agent_ summary_ loop - Run the recovery sweep. Never returns.
- skip_
reason 🔒 - Why a block is not attempted this tick, or
Noneto attempt it. Pure, so the cost rules are testable without a model, a store or a clock.