Expand description
listrecentsessions, moved out of register unchanged as named steps. It joins the agents the shared
registry knows with this channel’s own instances, enriches each with its definition, account line, memory
and last activity, and answers the picker’s “My Agents” list. The cascade follow-up (2026-05-23) added it;
the reattach itself is the existing continuation flow (continueOfInstanceId + workDirOverride, PR #977).
Every data source degrades to empty on its own failure and is named in the reply’s degraded list, so one
bad row cannot blank the whole list (the My Agents regression of 2026-07-27, PR #2296’s oauth serde-tag
mismatch) and a caller can tell “no agents” from “a source failed”.
Structs§
- Activity 🔒
- When an agent was last active and what it was last asked: from its transcript, else this channel’s snapshot.
- Picker
Sources 🔒 - What the rows are enriched from, each read once for the whole call.
- Recent
Sessions 🔒Deps - What the handler reads, cloned into the registered closure.
Constants§
Functions§
- account_
line_ 🔒for - The agent’s own account links, falling back to its template’s. A launch-only agent can hold a link of its
own (the FK targets
db_agentssince Phase 3c, #3088), but nothing writes one there yet: the only binding UI targets a template or user agent’s own definition id. Until a launch-scoped binding path exists, dropping the fallback would make a launched agent’s identity disappear (retire it with Phase 3d). - activity_
from_ 🔒snapshot - This channel’s per-block snapshot: a stat first (cheap, and it gives the sort time), the content only when it
exists.
Ok(None)(the block never wrote one) andErr(a filestore I/O error) are different rows: a real error on an agent that does have history must not read as “never had one” (REPORT_AGENT_PICKER_FIELD_ORDER_SORT_AND_DATA_GAPS_AUDIT_2026_08_24.md §5). - activity_
from_ 🔒transcript - The agent’s global transcript, keyed by its id. None when there is none to use, so the per-block snapshot, which old builds wrote, answers instead.
- append_
local_ 🔒only - The local agents whose (definition, name) no registry row represents, appended after the registry’s.
- build_
row 🔒 - fill_
preview_ 🔒from_ summary - No structured snapshot to preview: use the agent’s persisted summary, or ask for one once per definition per process (a Haiku summary of its raw terminal output, REPORT_AGENT_PICKER_FIELD_ORDER_SORT_AND_DATA_GAPS_AUDIT §5a). Only for a local row with a real block: a cross-channel row has no local raw output, and keeps the plain fallback text, which is accurate for it.
- group_
links 🔒 - handover_
of 🔒 - Where the agent went, when it carries a hand-over mark (the same answer its runtime row gives).
- identity_
filter 🔒 - list_
recent_ 🔒sessions - load_
instances 🔒 - The agents to list. “My Agents” sources from the cross-version registry when there is one, so agents made in any build, channel or version appear, not only this instance’s local sessions; without a registry (CI, odd environments) it is this channel’s own instances.
- load_
sources 🔒 - memory_
name 🔒 - newest_
launch_ 🔒per_ agent - The records of the identity asked for (when one is), one per (definition, name) keeping the newest launch
(the registry read path lacks SQLite’s chain-root collapse, so two fresh heads of one agent would double up),
newest first, at most
raw_limit. - newest_
local_ 🔒by_ key - This channel’s instances by (definition id, instance name), the same key the registry dedup uses, keeping the newest, so the overlay and the local-only append agree on identity.
- overlay_
or_ 🔒synthesize - The local instance when this channel has one (the fresher source), else an instance made from the record.
- registry_
instances 🔒 - The registry’s agents, each replaced by this channel’s own instance of it when there is one, plus the local agents no registry record represents (made before the live mirror could register them, or orphan continuations whose head was deleted).
- request_
limits 🔒 - The rows asked for (0 means the default, and the most is 100), and how many candidates to pull so that filtering by snapshot and identity does not run out: ten times the rows, within 50 to 500.
- sort_
recent_ 🔒first - Rows with a snapshot first (newest activity first), then the rest by launch time, so live conversations stay on top while legacy rows still surface.
- spawn_
definition_ 🔒summary - Fire and forget: a real Haiku CLI round trip must not block the response. Its spend is logged and no more: no UI total exists for any background ambient call (#2786).
- synthesized_
instance 🔒 - A cross-channel row: no live block, and its workdir rebuilt from the record’s source base (v3) or this channel’s agents base (legacy).
- transcript_
activity 🔒 node_countis 0: counting messages would mean reading the whole transcript, so the tile shows none rather than a guess.- with_
registry_ 🔒session_ id - The local row, with the registry’s session id when the local one is empty rather than an empty id the picker’s reattach would read as “start fresh” (SPEC_PANE_CLOSE_REOPEN_CONTINUITY_GUARANTEE_2026_07_27.md §4.1). The local row is normally fresher, but this holds for a row that predates the live write or raced it.
Type Aliases§
- Agent
Key 🔒 - Degraded
Sources 🔒 - The data sources that fell back to empty during one call, by name.