Skip to main content

Module recent

Module recent 

Source
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.
PickerSources 🔒
What the rows are enriched from, each read once for the whole call.
RecentSessionsDeps 🔒
What the handler reads, cloned into the registered closure.

Constants§

DEFAULT_LIMIT 🔒
MAX_LIMIT 🔒

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_agents since 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) and Err (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_count is 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§

AgentKey 🔒
DegradedSources 🔒
The data sources that fell back to empty during one call, by name.