Type Alias: AgentPaneEvent
agentmux / agent-pane-state-store / AgentPaneEvent
AgentPaneEvent = {
type:"init-ready"; } | {reason:string;type:"init-failed"; } | {at:number;type:"stream-subscribed"; } | {at:number;type:"stream-unsubscribed"; } | {at:number;lastKind:KindBeforeDisconnect;reason:DisconnectReason;type:"stream-disconnected"; } | {addedCount:number;type:"stream-flush-observed"; } | {idleSinceMs:number;recoverThresholdMs:number;thresholdMs:number;type:"stream-stuck"; } | {idleSinceMs:number;thresholdMs:number;type:"working-recovered"; } | {at:number;type:"turn-started"; } | {type:"turn-active-reconciled"; } | {at:number;type:"turn-inactive-reconciled"; } | {tokens:number;type:"context-reconciled-at-mount"; } | {model:string|null;reason:string;source:ContextSource;tokens:number;type:"context-reading-rejected";window:number|null; } | {model:string;reported:number;tokens:number;type:"context-window-refuted";window:number; } | {outcome:TurnOutcome;statsMerged:boolean;stoppingCleared:boolean;type:"turn-ended"; } | {type:"turn-reset"; } | {type:"turn-start-failed"; } | {reason:string;type:"turn-start-suppressed"; } | {name:string;type:"tool-started"; } | {type:"tool-ended"; } | {input:number|null;output:number|null;type:"tokens-updated"; } | {boundaryUuid?:string|null;durationMs?:number;frameTimestamp?:string|null;source:"real"|"heuristic";tokensAfter:number;tokensBefore:number;trigger?:"manual"|"auto";type:"context-compacted"; } | {trigger:"manual"|"auto";type:"compaction-started"; } | {trigger:"manual"|"auto";type:"compaction-started-buffered"; } | {reason:"rate_limited";type:"provider-waiting"; } | {code:AgentFailure["code"];turnWasEnded:boolean;type:"failure-observed"; } | {reason?:FailureClearReason;type:"failure-cleared"; } | {at:number;type:"stop-requested"; } | {type:"stop-failed"; } | {deadlineMs:number;type:"schedule-interrupt-timeout"; } | {at:number;type:"interrupt-timed-out"; } | {deadlineMs:number;type:"schedule-submit-timeout"; } | {at:number;type:"submit-timed-out"; } | {id:string;type:"pending-flush-started"; } | {ahead:number;id:string;type:"pending-waiting"; } | {id:string;type:"pending-queued"; } | {id:string;type:"pending-accepted";wasPresent:boolean; } | {id:string;type:"pending-rejected";wasPresent:boolean; } | {ageMs:number;id:string;queuedAt:number;type:"pending-expired";wasPresent:boolean; } | {question?:string;questionCount?:number;type:"waiting-for-input"; } | {reason:"submitted"|"typing"|"closed";type:"waiting-ended"; } | {at:number;type:"attached-task-observed"; } | {type:"attached-task-cleared"; } | {at:number;type:"registry-attached-task-observed"; } | {type:"registry-attached-task-cleared"; } | {at:number;type:"resume-retry-started"; } | {type:"resume-retry-resolved"; }
Defined in: agent-pane-state/types.ts:813
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ type: "init-ready"; }
Type Literal
Section titled “Type Literal”{ reason: string; type: "init-failed"; }
Type Literal
Section titled “Type Literal”{ at: number; type: "stream-subscribed"; }
Type Literal
Section titled “Type Literal”{ at: number; type: "stream-unsubscribed"; }
Type Literal
Section titled “Type Literal”{ at: number; lastKind: KindBeforeDisconnect; reason: DisconnectReason; type: "stream-disconnected"; }
The stream tore down while a turn was in flight; emitted alongside stream-unsubscribed,
only on the working-set → Disconnected transition (not on idle unsubscribes), so the view can
drive a “Disconnected — reconnecting…” banner.
Type Literal
Section titled “Type Literal”{ addedCount: number; type: "stream-flush-observed"; }
Type Literal
Section titled “Type Literal”{ idleSinceMs: number; recoverThresholdMs: number; thresholdMs: number; type: "stream-stuck"; }
idleSinceMs
Section titled “idleSinceMs”idleSinceMs:
number
recoverThresholdMs
Section titled “recoverThresholdMs”recoverThresholdMs:
number
The bar that would force this turn back to Idle: always larger than thresholdMs, and
larger still under a rate-limit backoff.
thresholdMs
Section titled “thresholdMs”thresholdMs:
number
The WARNING bar (STUCK_THRESHOLD_MS). Crossing it is cosmetic.
type:
"stream-stuck"
Stream has been silent for idleSinceMs while subscribed —
exceeds thresholdMs. Surfaced for diagnostics / UI badge.
Type Literal
Section titled “Type Literal”{ idleSinceMs: number; thresholdMs: number; type: "working-recovered"; }
idleSinceMs
Section titled “idleSinceMs”idleSinceMs:
number
thresholdMs
Section titled “thresholdMs”thresholdMs:
number
type:
"working-recovered"
The watchdog force-recovered a hung Streaming turn to Idle after idleSinceMs ≥
LIVENESS_RECOVERY_MS (its session_end was never observed). For telemetry; the phase
change is the real effect.
Type Literal
Section titled “Type Literal”{ at: number; type: "turn-started"; }
Type Literal
Section titled “Type Literal”{ type: "turn-active-reconciled"; }
ReconcileTurnActive promoted the phase to Streaming (from the mount-default Idle or a
settled Done.completed episode). For diagnostics: distinguishes this from a user-initiated
turn-started.
Type Literal
Section titled “Type Literal”{ at: number; type: "turn-inactive-reconciled"; }
ReconcileTurnActive demoted a stuck Streaming phase to Idle: the backend reported the
turn over while the frontend never saw session_end. For telemetry; the phase change is the
real effect.
Type Literal
Section titled “Type Literal”{ tokens: number; type: "context-reconciled-at-mount"; }
ReconcileContextFromHistory seeded context from the restored
transcript’s last main-agent call at mount. Surfaced for diagnostics only.
Type Literal
Section titled “Type Literal”{ model: string | null; reason: string; source: ContextSource; tokens: number; type: "context-reading-rejected"; window: number | null; }
A reading that can’t be true (more tokens than its window, or than any
known window with none) was refused or will not display. Logged by the
pane store; the meter shows nothing rather than a wrong number. See
context-reading.ts implausibleReason.
Type Literal
Section titled “Type Literal”{ model: string; reported: number; tokens: number; type: "context-window-refuted"; window: number; }
An accepted prompt was larger than the window Claude Code reported for its model, so the
reported window can’t be right; the meter uses the next known tier above the prompt. Logged
once per model by the pane store (context-reading.ts refutedReportedWindow).
Type Literal
Section titled “Type Literal”{ outcome: TurnOutcome; statsMerged: boolean; stoppingCleared: boolean; type: "turn-ended"; }
outcome
Section titled “outcome”outcome:
TurnOutcome
statsMerged
Section titled “statsMerged”statsMerged:
boolean
stoppingCleared
Section titled “stoppingCleared”stoppingCleared:
boolean
type:
"turn-ended"
A turn finished and the phase became Done. Carries outcome directly so consumers
(notification sounds, telemetry) needn’t snapshot the slot
(SPEC_SOUND_NOTIFICATIONS_2026_06_05.md §3.2).
Type Literal
Section titled “Type Literal”{ type: "turn-reset"; }
Type Literal
Section titled “Type Literal”{ type: "turn-start-failed"; }
Type Literal
Section titled “Type Literal”{ reason: string; type: "turn-start-suppressed"; }
reason
Section titled “reason”reason:
string
type:
"turn-start-suppressed"
Invariant fire: TurnStart while streaming inactive OR initPhase.kind === “InitPending” — dropped.
Type Literal
Section titled “Type Literal”{ name: string; type: "tool-started"; }
Type Literal
Section titled “Type Literal”{ type: "tool-ended"; }
Type Literal
Section titled “Type Literal”{ input: number | null; output: number | null; type: "tokens-updated"; }
Type Literal
Section titled “Type Literal”{ boundaryUuid?: string | null; durationMs?: number; frameTimestamp?: string | null; source: "real" | "heuristic"; tokensAfter: number; tokensBefore: number; trigger?: "manual" | "auto"; type: "context-compacted"; }
source: "real": an authoritative CompactionBoundary event (trigger / durationMs
present). source: "heuristic": inferred from a ≥50% drop in TokensIn (both absent).
boundaryUuid?
Section titled “boundaryUuid?”
optionalboundaryUuid?:string|null
source: "real" only — see CompactionBoundary command’s doc comment.
durationMs?
Section titled “durationMs?”
optionaldurationMs?:number
frameTimestamp?
Section titled “frameTimestamp?”
optionalframeTimestamp?:string|null
source: "real" only — see CompactionBoundary command’s doc comment.
source
Section titled “source”source:
"real"|"heuristic"
tokensAfter
Section titled “tokensAfter”tokensAfter:
number
tokensBefore
Section titled “tokensBefore”tokensBefore:
number
trigger?
Section titled “trigger?”
optionaltrigger?:"manual"|"auto"
type:
"context-compacted"
Type Literal
Section titled “Type Literal”{ trigger: "manual" | "auto"; type: "compaction-started"; }
CompactionStarted landed — compaction is in progress.
Type Literal
Section titled “Type Literal”{ trigger: "manual" | "auto"; type: "compaction-started-buffered"; }
CompactionStarted arrived before turnPhase was confirmed working
— buffered onto state.pendingCompactionPing rather than dropped.
See SPEC_COMPACTION_STARTED_RECONCILIATION_RACE_2026_09_02.md.
Type Literal
Section titled “Type Literal”{ reason: "rate_limited"; type: "provider-waiting"; }
Type Literal
Section titled “Type Literal”{ code: AgentFailure["code"]; turnWasEnded: boolean; type: "failure-observed"; }
A failure was observed and recorded on state.failure. turnWasEnded is true iff the turn
was actually working at the time (for diagnostics: a genuine mid-turn failure vs a stray late
event after idle).
Type Literal
Section titled “Type Literal”{ reason?: FailureClearReason; type: "failure-cleared"; }
state.failure was cleared (explicit dismiss, or implicitly by TurnStart).
Type Literal
Section titled “Type Literal”{ at: number; type: "stop-requested"; }
Type Literal
Section titled “Type Literal”{ type: "stop-failed"; }
Type Literal
Section titled “Type Literal”{ deadlineMs: number; type: "schedule-interrupt-timeout"; }
Reducer signal: a turn has just entered Interrupting. The dispatch layer starts the
INTERRUPT_TIMEOUT_MS timer and fires InterruptTimeoutElapsed on expiry, gated by a shared
cancel flag so a later RequestStop doesn’t double-fire. deadlineMs is at + INTERRUPT_TIMEOUT_MS.
Type Literal
Section titled “Type Literal”{ at: number; type: "interrupt-timed-out"; }
Reducer signal: the bounded Interrupting → Done.{interrupted}
force-transition fired because no graceful ack arrived within
INTERRUPT_TIMEOUT_MS. The view can surface this as
“interrupt timed out — assuming dead” if needed. Spec §8.
Type Literal
Section titled “Type Literal”{ deadlineMs: number; type: "schedule-submit-timeout"; }
Reducer signal: a turn has just entered Submitting. The dispatch layer starts the
SUBMIT_TIMEOUT_MS timer and fires SubmitTimeoutElapsed on expiry, gated by a shared
cancel flag so a promotion to Streaming cancels it first. deadlineMs is at + SUBMIT_TIMEOUT_MS.
Type Literal
Section titled “Type Literal”{ at: number; type: "submit-timed-out"; }
Reducer signal: the bounded Submitting → Done.{errored} force transition fired because no
stream activity arrived within SUBMIT_TIMEOUT_MS. Carries the firing wall-clock for audit
(spec §8, #728 gap 2).
Type Literal
Section titled “Type Literal”{ id: string; type: "pending-flush-started"; }
Type Literal
Section titled “Type Literal”{ ahead: number; id: string; type: "pending-waiting"; }
Type Literal
Section titled “Type Literal”{ id: string; type: "pending-queued"; }
Type Literal
Section titled “Type Literal”{ id: string; type: "pending-accepted"; wasPresent: boolean; }
Type Literal
Section titled “Type Literal”{ id: string; type: "pending-rejected"; wasPresent: boolean; }
Type Literal
Section titled “Type Literal”{ ageMs: number; id: string; queuedAt: number; type: "pending-expired"; wasPresent: boolean; }
ageMs:
number
id:
string
queuedAt
Section titled “queuedAt”queuedAt:
number
type:
"pending-expired"
Pending entry expired and was removed; queuedAt for log/audit.
wasPresent
Section titled “wasPresent”wasPresent:
boolean
Type Literal
Section titled “Type Literal”{ question?: string; questionCount?: number; type: "waiting-for-input"; }
Emitted when the pane enters the waiting-for-input state (turn completed with a question, composer empty); the sound service starts the looping ambient tone on it (SPEC_AGENT_WAITING_AMBIENT_SOUND_2026_06_19.md §6.3).
question?
Section titled “question?”
optionalquestion?:string
Text of the first pending question, when known. Consumed by the OS notification bridge, which forwards it to the srv router for redaction (SPEC_OS_NOTIFICATIONS_SYSTEM_2026_09_24.md §9.2).
questionCount?
Section titled “questionCount?”
optionalquestionCount?:number
How many questions the pending call asks — the toast adds ” (+N more)” when it’s more than one.
type:
"waiting-for-input"
Type Literal
Section titled “Type Literal”{ reason: "submitted" | "typing" | "closed"; type: "waiting-ended"; }
Emitted when the waiting state ends — user submitted or started typing, pane closed, or the 5-minute safety cutoff fired.
Type Literal
Section titled “Type Literal”{ at: number; type: "attached-task-observed"; }
AttachedTaskObserved set state.attachedTask (0→1 edge).
Type Literal
Section titled “Type Literal”{ type: "attached-task-cleared"; }
AttachedTaskCleared cleared state.attachedTask (1→0 edge).
Type Literal
Section titled “Type Literal”{ at: number; type: "registry-attached-task-observed"; }
RegistryAttachedTaskObserved set state.registryAttachedTaskSince.
Type Literal
Section titled “Type Literal”{ type: "registry-attached-task-cleared"; }
RegistryAttachedTaskCleared cleared state.registryAttachedTaskSince.
Type Literal
Section titled “Type Literal”{ at: number; type: "resume-retry-started"; }
ResumeRetryStarted set state.reconnecting (0→1 edge).
Type Literal
Section titled “Type Literal”{ type: "resume-retry-resolved"; }
ResumeRetryResolved cleared state.reconnecting (1→0 edge).