Interface: AgentPaneState
agentmux / agent-pane-state-store / AgentPaneState
Defined in: agent-pane-state/types.ts:260
The reducer’s state. Each field maps 1:1 to a Solid signal the agent pane projects from; the
reducer enforces invariants ACROSS fields (e.g. no turn enters Submitting/Streaming while the
stream is unsubscribed: the TurnStart arm). state.turnPhase.kind is the sole working-state
encoding; “is the stream subscribed?” is state.lastEventMs !== null (cleared atomically with
the stream on StreamSubscribe/StreamUnsubscribe).
Properties
Section titled “Properties”activity
Section titled “activity”activity:
ActivityState
Defined in: agent-pane-state/types.ts:289
What the agent is doing right now (see ActivityState).
attachedTask
Section titled “attachedTask”attachedTask:
AttachedTaskState
Defined in: agent-pane-state/types.ts:371
Live “attached long-running task” state, or null (AttachedTaskState). Deliberately
NOT cleared by any TurnPhase transition: a task attached in one turn can outlive it, so
only AttachedTaskObserved/AttachedTaskCleared touch it.
compacting
Section titled “compacting”compacting:
CompactionState
Defined in: agent-pane-state/types.ts:365
Live “compaction in progress” state, or null. See CompactionState.
context
Section titled “context”context:
ContextReading
Defined in: agent-pane-state/types.ts:334
The context meter’s reading: tokens, the model’s window and where each came from
(context-reading.ts). Set by TokensIn and, only while contextSeedable, by
ReconcileContextFromHistory. Unlike turnTokens it is NOT cleared at TurnEnd; it is
cleared on TurnReset, ContextInvalidated and CompactionBoundary. Displays read it through
plausibleReading, never directly.
contextSeedable
Section titled “contextSeedable”contextSeedable:
boolean
Defined in: agent-pane-state/types.ts:342
True until something more current than the restored transcript has
spoken: a live reading, an invalidation, a compaction or a reset.
ReconcileContextFromHistory seeds only while it holds — context
being null can’t tell “nothing yet” from “invalidated while history was
still loading”, and seeding the latter restores a dead conversation.
currentTool
Section titled “currentTool”currentTool:
string
Defined in: agent-pane-state/types.ts:270
currentToolArg
Section titled “currentToolArg”currentToolArg:
string
Defined in: agent-pane-state/types.ts:273
First significant argument of the active tool (file path, command, etc.). Cleared alongside currentTool on ToolEnd / TurnEnd / TurnReset.
detailsOpen
Section titled “detailsOpen”detailsOpen:
boolean
Defined in: agent-pane-state/types.ts:326
Whether the composer details panel (the Shell drawer with the interactive terminal) is open.
Default false, per session, reset on pane unmount, not persisted. It must NOT auto-collapse
on TurnStart: the live shell (AgentShellSubblock) has to survive sending more messages.
failure
Section titled “failure”failure:
PaneFailure
Defined in: agent-pane-state/types.ts:363
Active classified failure for this pane, or null. Set by FailureObserved (which also
force-ends a working turn), cleared by FailureCleared or implicitly by the next TurnStart
(a fresh turn ends the failure episode). See PaneFailure.
initPhase
Section titled “initPhase”initPhase:
InitPhase
Defined in: agent-pane-state/types.ts:308
Init phase: InitPending until history fetch resolves or fails; the failure reason lives in
InitFailed’s payload (no separate initError).
lastCompactionBoundaryAt
Section titled “lastCompactionBoundaryAt”lastCompactionBoundaryAt:
number
Defined in: agent-pane-state/types.ts:392
Ms of the most recent REAL CompactionBoundary event. The TokensIn ≥50%-drop heuristic
checks it before firing its own synthetic context-compacted, so a session that just got a
real boundary gets no duplicate. Providers without a structured signal never set it.
lastContextModel
Section titled “lastContextModel”lastContextModel:
string
Defined in: agent-pane-state/types.ts:357
Resolved model id of the main agent’s latest reply (message.model).
The Runtime menu shows it; the context reading is measured on it.
lastEventMs
Section titled “lastEventMs”lastEventMs:
number
Defined in: agent-pane-state/types.ts:314
Ms of the last observable stream activity (subscribe, flush, tool, tokens); drives the
stuck-stream watchdog. Also the “is the stream subscribed?” gate: lastEventMs !== null ⇔ a
StreamSubscribe that no later StreamUnsubscribe has cleared.
learnedContextWindows
Section titled “learnedContextWindows”learnedContextWindows:
ContextWindowMap
Defined in: agent-pane-state/types.ts:354
Context windows proven per model by an accepted prompt larger than the
window we had (context-reading.ts learnedWindowsAfter). Outlive
TurnReset for the same reason as reportedContextWindows.
pending
Section titled “pending”pending:
PendingMessage[]
Defined in: agent-pane-state/types.ts:303
pendingCompactionPing
Section titled “pendingCompactionPing”pendingCompactionPing:
object
Defined in: agent-pane-state/types.ts:400
A compaction_started ping rejected because turnPhase wasn’t (yet) working, which a later
authoritative signal can still promote for THIS turn (ReconcileTurnActive(active: true) or
StreamFlushObserved’s promotion arm). Cleared on that promotion, when a signal proves the
turn isn’t running, by a fresh unrelated TurnStart, or by any terminal transition that
clears compacting.
startedAt
Section titled “startedAt”startedAt:
number
trigger
Section titled “trigger”trigger:
"manual"|"auto"
pendingCompactTurn
Section titled “pendingCompactTurn”pendingCompactTurn:
boolean
Defined in: agent-pane-state/types.ts:302
True for a turn started to send a manual “/compact”: set on TurnStart when command.content === "/compact", consumed by CompactionBoundary. A manual boundary’s trigger alone is NOT
a safe signal that this pane’s turn is the synthetic one (the events have no ordering
guarantee against the NDJSON stream) (#2659).
reconnecting
Section titled “reconnecting”reconnecting:
ResumeRetryState
Defined in: agent-pane-state/types.ts:378
Live “reconnecting after a stale --resume session id” state, or
null — see ResumeRetryState. Owned exclusively by
ResumeRetryStarted/ResumeRetryResolved, dispatched from
useResumeRetryStream.ts.
registryAttachedTaskSince
Section titled “registryAttachedTaskSince”registryAttachedTaskSince:
number
Defined in: agent-pane-state/types.ts:386
Earliest started_at_ms among this block’s Running db_background_tasks rows, or null:
a separate floor signal from attachedTask (the durable registry can know a task the live
transcript doesn’t). Owned EXCLUSIVELY by RegistryAttachedTaskObserved/Cleared
(dispatched only from useBackgroundTaskRegistry.ts); the transcript-derived attachedTask
effect (agent-view.tsx) only READS it and combines both, earliest start winning (#2685).
reportedContextWindows
Section titled “reportedContextWindows”reportedContextWindows:
ReportedContextWindows
Defined in: agent-pane-state/types.ts:348
Context windows Claude Code reported in result.modelUsage, per model
id. They outrank the model-name table for any reading on that model, and
outlive TurnReset: a model’s window is a fact about the model.
sessionStats
Section titled “sessionStats”sessionStats:
SessionStats
Defined in: agent-pane-state/types.ts:262
sessionTotals
Section titled “sessionTotals”sessionTotals:
SessionStats
Defined in: agent-pane-state/types.ts:269
Cumulative cost/tokens/duration across every completed turn in this pane’s lifetime: unlike
sessionStats (replaced on each TurnEnd) it sums into the previous value. Feeds the
composer-strip “totals” display; cleared only on TurnReset
(SPEC_AGENT_SESSION_COST_TOTALS_2026_07_02.md).
streaming
Section titled “streaming”streaming:
StreamingState
Defined in: agent-pane-state/types.ts:261
turnCarry
Section titled “turnCarry”turnCarry:
TurnCarry
Defined in: agent-pane-state/types.ts:295
Each pass’s own figures (its TurnEnd stats), summed over the turn srv reported it in; the
Worked line reports from this for providers whose passes srv doesn’t count (ACP, App Server,
one-shot subprocess).
turnLedger
Section titled “turnLedger”turnLedger:
TurnLedger
Defined in: agent-pane-state/types.ts:287
The turn as the user sees it over however many CLI passes: srv’s agentturn event, verbatim
(turn-ledger.ts); null until srv has published one. turnPhase and turnTokens stay per
pass.
turnPhase
Section titled “turnPhase”turnPhase:
TurnPhase
Defined in: agent-pane-state/types.ts:319
Single-source-of-truth turn phase; consumers use isWorking(state) / isDisconnected(state)
/ state.turnPhase.kind.
turnTokens
Section titled “turnTokens”turnTokens:
TurnTokens
Defined in: agent-pane-state/types.ts:281
The current turn’s live usage: set by TokensIn; cleared by that turn’s TurnEnd, by
StreamSessionStarted (the process died before a result) and by hard ends (disconnect,
failure, timeouts, reset). Nothing else clears it on a normal turn end: srv sends the
turn-ended push before the result line, so session_end (and sometimes earlier calls)
still follow, and a queued turn can start in that gap.