Expand description
What AgentMux’s own record says about an agent’s conversations.
Every agent’s provider output is mirrored into the global transcript store
(~/.agentmux/shared/agents/transcripts/filestore.db): zone
agent:<id>:current, moved to agent:<id>:archive:<ms> by “New
conversation”. For a user agent <id> is its UID (db_agents.id), the same
in every channel and version and across account switches, so this record is
the one place that holds every session the agent ran — including sessions
whose provider transcript is gone (75 of 190 sessions across the 15 agents
on one host, measured 2026-09-24). A template launch writes into its
template’s shared zone; that zone is not the agent’s alone and is never read
here.
Sessions come from the record, not from guessing by folder or account:
every line the provider writes carries its session_id. A line without one
— a message a person typed, echoed by AgentMux — belongs to the session of
the next line that has one, the process that received it. The record only
grows until it’s archived, so each zone remembers how far it has been read
and a later search reads only what was appended.
Claude’s stream-json only: a line from a provider whose output carries no
session_id never starts a session here.
Structs§
- Agent
Records 🔒 - Reads agents’ records from the global transcript store. No store (a test, or a srv that couldn’t attach it) reads nothing.
- Record
Session 🔒 - A session, as the agent’s record holds it.
- Run 🔒
- Consecutive lines of one session.
- Zone
Scan 🔒 - How far a zone has been read, and what was found.
Enums§
Constants§
- READ_
CHUNK 🔒 - How much of a zone is read per step.
Functions§
- for_
each_ 🔒line - Call
f(line, offset)for every complete (newline-terminated) line of the zone’soutputin[start, end). A trailing unterminated line is left for the next read — it’s an append in progress. - init_
cwd 🔒 - The working directory an
initline reports. - is_
agents_ 🔒own_ zone agent:<uid>:currentandagent:<uid>:archive:<ms>— never another id’s zone, and never a template’s shared one (its key isn’t this UID).- is_
stream_ 🔒event - Streaming deltas: most of the record’s bytes, and never a message.
- line_
session_ 🔒id - The session a line belongs to, if it names one. A streaming delta’s shape
is fixed and its payload holds only escaped strings, so its last
"session_id":"key is the line’s own; anything else is parsed. - line_
stamps 🔒 - Receive times for line offsets from the zone’s
output.tsidx;Noneif the zone has none. - scan_
line 🔒 - scan_
zone 🔒 - Read what was appended to
zonesince the last scan. A zone smaller than what was read (archived and started over) is read again from the start. - zone_
stamps 🔒 (first, last)receive time for each run: its first line and the line holding its last byte.