Expand description
What an agent was last asked, read from its GLOBAL transcript zone.
“My Agents” needs a preview, a last-activity time and an honest empty state
for every agent, whether or not it was launched in this channel and whether
or not a pane is open. The per-block output.state.json it used to read is
no longer written; the history lives under agent:<defId>:current (or, once
archived, agent:<defId>:archive:<ms>) in the shared transcript store, keyed
by agent id and written by every channel.
The output file there is the provider’s raw NDJSON stream and can be
gigabytes (most of it stream_event deltas), so it is never loaded whole:
the newest user prompt is found by reading backwards in fixed chunks, up to
a cap, and the result is remembered until the file changes.
Spec: SPEC_MY_AGENTS_TILES_AUTH_AND_HISTORY_2026_10_03.md §5.3.
Structs§
Enums§
- History
Read - What the transcript store knows about one agent.
Constants§
- CHUNK 🔒
- Bytes read per backwards step.
- MAX_
LINE 🔒 - A single line longer than this is skipped rather than carried across chunks.
- MAX_
SCAN 🔒 - The most of a transcript’s tail one lookup reads. Real transcripts put the newest user prompt well inside the last two chunks; past this the answer is “none recent”, not a longer read.
- MEMO_
CAP 🔒 - Remembered results kept before the memo is reset.
Functions§
- contains 🔒
- history_
store 🔒 - The store to read: the process-global transcript store, or in tests the one the current thread installed.
- is_
scaffolding 🔒 - Text the harness puts in the user turn that the user did not type.
- memo 🔒
- newest_
zone_ 🔒with_ output (zone, size, modts)of the agent’s current zone if it has output, else of its newest archive that does.- read_
agent_ history - Read what
definition_id’s transcript says, falling back to its newest archive when the current zone is empty. - read_
histories - History for each distinct agent id, read on the blocking pool. Empty when no transcript store is installed, which callers treat as “use the old source”.
- scan_
tail_ 🔒for_ prompt - The newest real user prompt within the last
MAX_SCANbytes ofoutput, or an empty string if there is none. - user_
prompt_ 🔒in_ line - The text of a real user prompt if
lineis one: auserrecord that is not a tool result, not from a sub-agent, and not startup or injected scaffolding.