Wakterm Agent API v1 golden contract#
These fixtures are the cross-repository semantic contract for the live Wakterm Agent API. Panetone can use them for fake-adapter and compatibility tests.
golden-fixtures.json retains two capability snapshots:
current_capabilitiesis an exact live Wakterm capability response.event_stream_capabilitiesis a compatibility alias for consumers that previously selected the event fixture profile.
Wakterm advertises event_stream.v1 only while its durable event store is
available. Consumers must still negotiate the live capability before reading.
The implemented v1 boundary is capability negotiation, the agent catalog, authoritative prompt admission, and the existing return-request terminal stream. Admission is scoped to a stable Wakterm agent ID and opaque current incarnation. Native observed sessions use process identity, while managed Codex sessions use exact app-server provider identity. A definitive non-acceptance means no prompt bytes were written.
A one-way admission is accepted only after the target's exact incarnation records the written prompt. For Claude, Codex and agy, that is an input_accepted or turn_started event whose input_sha256 matches the prompt; for other harnesses, any turn that starts after the write. A Claude slash command is accepted once Claude records a command after the write, whatever its name and without the status change, since an alias is recorded under the command's own name and many commands start no work. Admission refuses with busy and writes nothing while Claude's input box holds text the user is typing, which the prompt would otherwise be submitted with; a dimmed prompt suggestion in an empty box does not count. Writing the prompt is not enough, because a harness can drop input, for example while one of its own dialogs has keyboard focus. Wakterm types the prompt, waits until the pane has redrawn it, and then presses Enter in its own write, since Claude discards an Enter that arrives with a paste whose line ends like an image path. Claude can also leave the prompt in its input box without submitting it: it can drop an Enter, and it ignores Enter while it compacts its conversation, which an idle compaction does for about a minute while Claude reports itself idle and shows nothing on screen. So while Claude has not recorded the prompt and reports itself idle, either with no status change since the write or with the prompt still in its input box, Wakterm presses Enter again, every 2 seconds during the confirmation window and then every 5 seconds for up to 3 minutes while the prompt stays in the box. Input to the pane from anyone else stops it. A frozen agent is thawed and given a second to run before the prompt is typed, and a target that has drawn nothing since the write, such as an agent whose memory is being paged back in, has not read the prompt yet, so Wakterm waits up to 10 seconds for it to draw before the first Enter. When Wakterm stops with the prompt still visible in Claude's input box, the receipt's detail says that Claude did not take it. For a Claude agent, Claude's own status must also change after the write, because Claude can record a prompt without working on it. If the prompt is not recorded within 15 seconds, the receipt is indeterminate with prompt_written: true and a detail, which says when the agent recorded different input instead, such as this prompt combined with text already in its input box, and the caller should report that delivery is unconfirmed rather than retry under a new request ID.
Every live catalog entry has a unique agent ID. Wakterm assigns that ID when an agent is registered and persists it across restoration. Admission resolves the exact catalog agent and incarnation pair rather than selecting by agent ID alone. An indeterminate result is never safe to retry under a new request ID.
Admission is idempotent by request ID: Wakterm writes a prompt at most once per request_id. When a call times out or its connection fails without a receipt, the caller repeats it with the same request_id and the same arguments. If the server is still admitting that ID, the repeated call waits up to 10 seconds for the first attempt and returns its receipt. If the first attempt never reached the server, or stopped without writing the prompt, the repeated call admits it now. If the first attempt finished, the repeated call returns the same receipt without writing again. Reusing a request_id with a different prompt or target is refused as invalid. If the first attempt is still running after those 10 seconds, the repeated call returns indeterminate, without prompt_written, and a detail saying the first attempt is still running; repeating it again later with the same request_id remains safe. A claim that a previous server process left unfinished, because it stopped while admitting, returns indeterminate.
Each catalog entry also contains a fixed-width pane_id. It is the smallest
authoritative locator for joining a Panetone live route to the current Wakterm
catalog when route titles and agent names differ. Pane IDs are ephemeral mux
coordinates. Consumers must resolve them from a fresh catalog and must never
persist them as agent identity, process identity, or an idempotency key.
wakterm agent caller identifies the live registered agent that the command runs for and prints {"schema", "resolved_by", "agent", "tab"}, where agent is that agent's catalog entry and tab is the tab its pane is in, {"tab_id", "window_id", "title"}, or null when the pane is in no tab. title is the tab's effective title, the one wakterm cli list reports as effective_title: the tab's explicit title, else one derived from the folder of its agents, else its active pane's title or directory, with a number appended when another tab in the window already has it. The tab keeps its id and title when its agent is replaced, so a job that should reach whichever agent is in the tab later can record the tab rather than the agent. A pane's shell and the tools of a PTY harness inherit WAKTERM_PANE, which resolves to the agent in that pane (resolved_by: "wakterm_pane"). Tool commands of a managed Codex thread run in the shared app-server and carry no pane variable; their CODEX_THREAD_ID resolves to the one live managed agent bound to that provider thread (resolved_by: "codex_thread"). The command exits non-zero without output when neither variable is present, when the named pane has no live registered agent, when the thread matches no live managed agent or more than one, or when both variables are present and name different agents. --pane N and --codex-thread ID pass the same inputs explicitly; when either flag is given, the environment is ignored. Consumers should use the result to fill a source agent and pane for the current request only, under the same rules as any catalog pane_id.
The durable event page provides:
- durable increasing sequence order
- agent, current-incarnation, and exact turn identity
- distinct assistant, plan, turn, observer, and agent-lifecycle events
- catalog ordering through
as_of_event_sequence - explicit bounded-retention metadata and
cursor_too_oldrecovery - a classified incompatible-version failure, and event kinds that older consumers skip
Interactive requests#
Wakterm publishes a structured approval_requested event for managed Codex command approvals and blocking single-choice questions, and for every observer-backed Claude AskUserQuestion call. Its approval object carries the request kind, exact agent and incarnation, an opaque request ID, the provider turn and item IDs, the prompt or command context, and ordered choices. Consumers must present only the advertised choices and must treat the request ID as opaque.
Resolve a choice through the supported Agent API rather than writing terminal keys:
wakterm agent approval \
--request-id REQUEST_ID \
--agent-id AGENT_ID \
--incarnation INCARNATION_ID \
--choice CHOICE_ID
Wakterm answers Codex through the original app-server request, causing the native TUI to dismiss the same modal. Claude has no equivalent control API, so Wakterm validates that the exact tool call is still pending in the exact live session and submits the selected label to that pane's native question UI. Resolution requires the exact live agent incarnation and a choice from that request. A repeated response, a provider-side response, a replaced agent, or a completed request is rejected as stale. Pending interactions are provider state, not a second durable authority; the durable event exists so a transport can notify the user and recover exact identity.
Claude can write a question to its transcript only once it is answered. While Claude reports that it is waiting for the user's answer and its transcript has not asked the question, Wakterm reads a single single-choice question from the pane's screen and reports it as the same user_question request: its prompt and questions hold the question as the screen shows it, its item_id starts with claude-screen:, and resolving it requires that Claude still waits for an answer and the screen still shows that question with the same options. Each question is requested once per turn, from whichever source shows it first, and a question that the transcript shows only together with its answer is not requested.
approval_control.v1 covers these single-choice requests.
Claude question forms#
With question_form_answers.v1, every Claude AskUserQuestion can be answered through the same command, including several questions, multi-select questions and typed answers. Its approval_requested event has kind user_question for one single-choice question, which also advertises its options as choices, or user_question_form for any other form, which advertises no choices. Both carry questions, in the order Claude asks them:
"questions": [
{
"index": 0,
"header": "Browser",
"question": "Which way should the tool get exact Aeroplan prices automatically?",
"multi_select": false,
"options": [
{"id": "option_1", "label": "Sign in as you", "description": "Headless Firefox signs in…"},
{"id": "option_2", "label": "seats.aero API key", "description": "…"}
]
}
]
Every question also accepts a typed answer in place of its options, and every form can instead be sent back to Claude to chat about or be cancelled. Resolve a form with one of three choices:
submit, with--answersholding a JSON list of answers. Each answer names its questionindexand gives eitherchoices, a list of option IDs (exactly one for a single-choice question, one or more for a multi-select question), ortext, a typed answer for a single-choice question. A question left out is submitted unanswered, which Claude allows except in a form of one single-choice question.chat, which closes the form and tells Claude the user wants to discuss the questions.cancel, which rejects the question like Escape.
wakterm agent approval --request-id REQUEST_ID --agent-id AGENT_ID \
--incarnation INCARNATION_ID --choice submit \
--answers '[{"question":0,"choices":["option_2"]},{"question":1,"text":"ten days"}]'
For one single-choice question, its option ID as --choice still works as before.
Wakterm enters the answers with the question dialog's default keys and checks the pane's screen at every step: that the expected question is showing, that typed text appeared, that "Chat about this" is selected before choosing it, and, before submitting, that Claude's review lists exactly the intended answers and warns about unanswered questions exactly when some are left. At the first mismatch it stops without submitting and reports the reason, leaving the dialog for the user. It refuses before pressing any key when the request is no longer pending, when Claude does not report the dialog as waiting for input, or when ~/.claude/keybindings.json rebinds the dialog's list, tab or confirmation keys. The command returns once Claude has recorded the outcome in its transcript. A typed answer for a multi-select question is not supported yet.
With claude_refusal_menu.v1, Claude Code's "Session paused" menu is an approval_requested event of kind claude_refusal_fallback. Claude shows the menu when a model's safeguards refuse a response twice in one turn, and waits on it without a timeout. The event's prompt is the menu's title and explanation as the pane shows them, and its two choices are retry_fallback, labelled like "Switch to Opus 4.8", which continues the turn on the fallback model for the rest of the session, and edit_prompt, labelled like "Edit prompt and retry with Opus 5.5", which ends the turn and puts the prompt back in Claude's input box. Resolve it with one of them as --choice.
With claude_refusal_menu.discard_draft.v1, the menu also takes --choice edit_prompt_discard_draft, which is not one of its listed choices: it chooses edit_prompt and then clears the prompt Claude puts back in its input box, so the agent is left idle with an empty box and the caller's next prompt admission is not refused for a draft. Claude puts the prompt back when the turn ends, seconds after the menu closes, so the resolution answers once the box has been cleared and stays empty, or after 30 s when Claude puts nothing back. It fails when the box could not be cleared. A caller that cannot edit the pane's input box should use it in place of edit_prompt.
With claude_menu.v1, any other Claude Code confirmation menu is an approval_requested event of kind claude_menu. A menu is a title and an explanation under a rule, followed by at least two choices numbered from 1 with a cursor on one, shown while Claude reports a dialog open. A slash command can raise one outside a turn: /model in a session with history asks "Switch model?" with the choices "Yes, switch to Opus 5.5" and "No, go back". The event's prompt is the title and explanation as the pane shows them, each choice's label is its text, and each choice's id is its number, such as "1". Resolve it with a number as --choice. Its turn_id is the agent's most recent turn, or empty when it has none. A menu that closes and appears again is a new request.
Claude records nothing about this menu in its transcript or session record, so Wakterm reads it from the pane's screen while Claude reports a dialog open: the title followed by exactly those two choices. To answer, it moves the menu's cursor to the chosen row, confirms on screen that it is there, presses Enter and waits for the menu to close. If the screen no longer shows the same menu, or the cursor does not move, it presses nothing further and reports the reason. The menu does not appear when Claude's switchModelsOnFlag setting is true; Claude then switches models without asking.
With devin_permission.v1, Devin's permission prompt, which asks before running a tool, is an approval_requested event of kind devin_permission in the turn that raised it. The event's prompt reads "Devin asks to run: COMMAND", its command is the command the prompt shows, and its two choices are allow_once, labelled "Allow once", which runs the tool this once, and deny, labelled "Deny", which refuses it and ends the turn. Bypass mode and the scopes beyond Once change Devin's permissions for later requests, so they are left to the pane. Devin records nothing about the prompt while it is up, so Wakterm reads it from the pane's screen: the rows above the footer ending in "esc cancel", with the ❭ cursor on one. To answer, it moves the cursor to the chosen row, for allow_once sets the Allow row's scope to Once, presses Enter and waits for the prompt to close, checking the screen after every key. If the screen no longer shows the prompt for the same command, it presses nothing further and reports the reason.
With muse_permission.v1, Muse's permission prompt for a shell command is an approval_requested event of kind muse_permission in the turn that raised it. Muse records the request in its session log, and the event's request_id and item_id are the request's pending_action_id there. Its prompt reads "Muse asks to run: COMMAND", its command is the command, and its two choices are allow_once, labelled "Allow once", which runs the command this once, and deny, labelled "Reject", which aborts it. Always allowing the command persists a rule, so it is left to the pane, as are requests for other tools, commands with several stages, and requests Muse's approval judge decides. To answer, Wakterm checks that the log still shows the request pending and that the pane shows the prompt for the same command, presses y or Esc, and waits for Muse to log the decision.
Codex file changes, Claude plan approval, other harnesses' tool permission prompts and general permission methods remain owned by the native TUI until they receive an equally exact mapping.
The public contract does not expose the event database, provider paths, parser cursors, or transport implementation. Wakterm's experimental Codex output page remains available for side-effect-free shadow comparison, but it is not the durable event contract.
The catalog as_of_event_sequence is a conservative lower-bound cursor sampled
before the live catalog snapshot. Starting after that sequence can replay a
lifecycle state already visible in the snapshot, but cannot skip a concurrent
lifecycle change. Consumers must apply events idempotently by event ID and
agent incarnation.
The live stream starts each newly observed provider session at its tail. It
does not replay provider history from before the first durable lifecycle
baseline. Provider session replacement, truncation, or rewrite emits an
observer_failure and arms a new tail baseline instead of guessing across the
gap.
When an agent's process is replaced, for example by a resume after a mux
restart, the new incarnation continues the same provider session from where
the previous incarnation's projection stopped. Input that the provider records
before Wakterm observes the new process still gets its input_accepted and
turn_started events, attributed to the new incarnation.
Codex, Claude, Gemini, and OpenCode projections are live. Turn IDs come from
provider records: Codex turn IDs, Claude human-user UUIDs, Gemini user-message
IDs, and OpenCode assistant parentID values. Finals require provider completion
evidence: Codex task_complete, turn_aborted, or app-server turn completion,
Claude end_turn, a persisted Gemini response message, or OpenCode
finish: stop. OpenCode tool-calls is
intermediate and never a final. Plans are emitted separately when the provider
records an explicit plan artifact, currently Claude ExitPlanMode.
For observer-backed sessions, a durable provider turn transition updates the catalog and admission snapshot in the same observation. A committed waiting_on_user transition therefore makes the exact agent idle without waiting for terminal input or unrelated API activity.
turn_started carries input_sha256, the SHA-256 of the trimmed input that started the turn with each tab replaced by four spaces, when the provider records it. Claude records a pasted tab as four spaces, so the replacement makes the hash of a prompt as sent equal the hash of the prompt as recorded; a caller that matches its own prompts hashes them the same way. The input is the text inside a Claude <pasted_content> wrapper, or the first Codex user message that is not injected environment context. Because Codex records that input after task_started, a Codex turn_started is emitted with its first input, keeping the task_started time. A Codex turn that records no input starts with input_sha256: null, before its first message or final.
With input_accepted_events.v1, input_accepted reports input the provider recorded, with its input_sha256 and the turn_id it started or joined: the input that starts a turn, which also produces turn_started, and input that joins a running turn. Claude queues input typed during a turn and records it as soon as it shows the input queued; that event has reason: "queued", and background task notifications are not input. A Claude slash command is input as its command and arguments, such as /model opus, with reason: "command". Claude records a command under its own name when an alias was typed, so /new appears as /clear. Codex input that steers a running turn appears as a further user message, from the rollout or the managed app-server. A sender confirms delivery by waiting for the event with its input's hash, which arrives when the provider records the input. input_sha256 is null on events other than turn_started and input_accepted.
With input_request_ids.v1, every input_accepted also carries input_role and, when it can, request_id. input_role says what the input did to its turn: start for the input that started the turn, steer for input that joined the running turn, and queued for input the provider queued during the turn (which also keeps reason: "queued"). The starting input is named on input_accepted and not on turn_started, because a provider can record it after the turn starts, as Codex's app-server does; consumers join the two by turn_id and do not assume an order between them. OpenCode, ZCode and Gemini emit input_accepted for the input that starts a turn as well. request_id names the admission whose prompt the input is: before writing an admitted prompt, Wakterm records it as pending input of the exact agent incarnation, and when that incarnation records input with the same input_sha256, the event names the request and the request stops being pending. When more than one pending request of the incarnation has the same input, none is named and all of them stop being pending, since naming one could attribute another's input to it. Pending input of an earlier incarnation of the agent, and pending input not recorded within an hour, is dropped. Input typed into the pane, and input sent without a request, has request_id: null and is identified by input_sha256 alone.
Only output from the pane's user-visible primary provider session enters the normalized stream. Internal Codex worker sessions, including subagents, approval reviewers, model graders, summaries, and background feature sessions, cannot replace an observer-backed pane's primary session or emit assistant, final, or lifecycle events for it.
For Codex app-server TUI sessions, completed agent-message items and turns are committed from the live app-server notification stream. This includes sessions restored after a mux restart and does not require catalog or prompt activity. The authoritative status returned by app-server resume initializes the restored catalog entry, so an idle session can accept prompt admission immediately.
Terminal failure detail#
For managed Codex turns ending with provider status failed, turn_final keeps outcome: "aborted" and supplies a normalized category in the existing reason field plus a safe user-facing description in detail. These fields are present even when the turn has no assistant output. text remains assistant output and may be null. The policy_aborted_turn_final golden fixture demonstrates this case.
| Reason | Meaning |
|---|---|
policy_blocked | The provider blocked the response under its content policy. |
context_limit | The conversation exceeded the context limit. |
usage_limit | A session budget or usage limit was reached. |
rate_limited | The provider rate limit was reached. |
model_at_capacity | The selected model is at capacity; the user can try a different model. |
provider_unavailable | The provider service or connection failed. |
authentication_failed | The provider rejected authentication. |
invalid_request | The provider rejected the request. |
sandbox_error | The execution sandbox failed. |
provider_error | The failure has an unknown or absent provider error code. |
Descriptions come from Wakterm's fixed mapping of structured provider error codes. Raw provider messages, additional diagnostics, and policy continuation instructions are excluded. Clients should accept unknown reason values and render detail as plain text. recoverable stays null; the category does not authorize retries or changes to provider policy settings.
Codex serverOverloaded maps to model_at_capacity with the fixed detail “Selected model is at capacity. Please try a different model.” HTTP and stream connection failures retain provider_unavailable, including HTTP 503 errors without the explicit capacity code. The capacity_aborted_turn_final fixture covers the capacity notice. Consumers that display detail need no compatibility change.
A Claude turn starts at the input that Claude records. Input recorded while a turn runs starts a turn of its own, without ending the running one, since the transcript does not record whether Claude takes it into that turn. Notes Claude adds to a turn, such as a skill's instructions or a note about an image a tool read, continue it; a note that wakes Claude between turns, such as another session's message or a scheduled task, starts one. An interruption ends the turn with outcome: "aborted" and reason: "interrupted", with the turn's latest assistant text. Input after a turn stopped without a reply, after a provider error, a local command such as /model, or a response Claude's safety classifier stopped, ends that turn first: reason: "provider_error" with the error as its detail, reason: "no_reply", or reason: "policy_blocked". When Claude continues a stopped response on another model, its reply ends the turn as usual.
A Claude turn that starts from input Claude never works on, such as a notice it displays, has no reply to end it. When Claude reports its process idle and the transcript has been unchanged for 5 seconds, the turn ends with turn_final outcome: "aborted", reason: "no_reply" and the detail "Claude went idle without replying.", followed by waiting_on_user. When Claude reported a provider error in the turn first, such as "Login expired · Please run /login", the turn ends with reason: "provider_error" and that error as its detail instead.
Consumers may present an aborted terminal event's nonempty detail as a failure notice, including when text is null, and deduplicate it by event_id. It is not an assistant message. Successful turns and ordinary interrupted turns retain their existing behavior. A transient error notification does not itself produce a terminal event; failure detail comes from the authoritative turn-completion payload.
This uses existing Agent API v1 fields and requires no new event kind or capability. Events already committed without failure detail remain unchanged; the new normalization applies to newly recorded completions. Return-request receipts are a separate stream and retain their existing generic aborted detail.
A turn ends exactly once#
Every turn reported by turn_started gets one turn_final. When an agent becomes unavailable while a turn is open, because its process exited, another process took over the agent, the mux restarted, or the agent stopped being registered, as when its pane closed, the turn ends with turn_final outcome: "aborted", reason: "ended_with_agent", no text, and a detail saying why, such as "Wakterm's mux server restarted.". It comes just before the agent_lifecycle unavailable event, whose reason names the cause in machine-readable form, such as mux_restarted. A process that has just exited is read once more first, so a turn end it wrote before exiting is reported as written. A later start or end that a provider reports for a turn that has already ended, such as a repeated end or one read by the process that resumed the session, is not recorded.
The turn the agent works in after a restart is a new turn. Wakterm's own message asking it to continue starts it, so that turn's input_accepted carries Wakterm's request ID. Messages sent to a Claude agent while its interrupted turn ran, which Claude had queued but not read when the restart stopped it, follow that message, in the order they arrived: Claude holds queued input in memory, so the stopped process dropped them. They are read from the transcript as it stood when the restore was prepared: each message queued after the stopped process started, less those whose use the transcript records by their text, in a removal, the user record that starts a turn with them, possibly merged with others, or an attachment taking them into a running turn. If the agent takes other input after its restore, it is not asked to continue, and those messages are logged as not delivered.
A Claude or agy agent that was waiting for the user to answer a question it asked, with Claude's AskUserQuestion tool or agy's ask_question, when the restart stopped it comes back with the question closed unanswered. Wakterm asks it to ask again, with the message "Wakterm's mux server restarted while you waited for the user's answer to your question, which closed it unanswered. Ask it again.", which starts a new turn the same way. The question counts as unanswered when the transcript, as it stood when the restore was prepared, has the call without its result after it: for Claude, the AskUserQuestion call without a tool result; for agy, a last PLANNER_RESPONSE step that calls ask_question, followed by fewer steps than it has tool calls. An agent that takes other input after its restore is not asked.
Session continuity and event delivery#
Ordinary event mirroring follows the live pane when its managed Codex TUI starts, resumes, or forks to another provider thread. The stable Wakterm agent ID and pane route continue to receive assistant output, while the exact provider thread and derived incarnation change in the catalog and event provenance. Consumers do not need to replace an event cursor or rediscover the route. Exact prompt admission and return-final correlation still require the current catalog incarnation and provider turn.
Return-final admission uses the same request and receipt contract for observer-backed Codex PTYs and managed Codex app-server sessions. An observer-backed request is correlated through its exact process, provider session, cursor, prompt hash, and provider turn. A managed request arms the durable event sequence for its exact app-server thread and session, binds the first subsequent provider turn, and accepts only that turn's durable final.
For an already-bound observed Codex request, a newer live turn does not invalidate a terminal record retained in the same provider session. Reconciliation checks that bound turn's terminal record after the armed cursor and returns its completion or abortion, preserving the original completion timestamp. Missing terminal evidence or changed process or session identity remains indeterminate.
Codex, Claude, and agy JSONL records larger than 4 MiB, and complete lines that are not valid JSON, such as a write cut short by a full disk, produce one observer_failure describing the skipped byte range. Observation resumes at the next complete record, with cached turn identity and assistant text cleared to prevent attribution across the gap. For Claude, a later tool result that carries the earlier turn's promptId shows that the turn continued, and its later records are attributed to it again; one with a different promptId means a new turn began inside the skipped record, and the turn stays unknown until the next prompt. An incomplete oversized record waits for its terminating newline. Later records with sufficient turn identity continue to produce events; content inside the skipped record is unavailable through the event stream.
agy events come from the conversation's full step log, transcript_full.jsonl, whose fields agy does not truncate. Each user input starts a turn named <conversation>:<step>. A completed planner response with text is an assistant_message, and one that calls no tools also ends the turn with turn_final outcome: "completed". agy records no interruption, so a turn it leaves without such a response, such as one stopped during a tool step, ends only when the agent becomes unavailable.
Gemini observation accepts both legacy JSON conversation snapshots and the
current append-only JSONL format. Duplicate JSONL records update the same
durable provider message, incomplete trailing records wait for the next
refresh, and a legacy session that migrates to its .jsonl sibling keeps the
same provider session and cursor. Claude can persist separate thinking and text
records with end_turn on both; only the user-visible text record produces the
turn final. Gemini messages with toolCalls are intermediate assistant output,
not finals. OpenCode finals use the provider completion timestamp and never the
earlier assistant-message creation time. Explicit Claude and Gemini provider
errors emit observer_failure; they do not synthesize a terminal outcome.
The default retention bound is 100,000 events. A reader whose sequence precedes
retained history receives cursor_too_old and must take a fresh catalog
snapshot. Wakterm records previously available incarnations as unavailable
with reason mux_restarted when a new mux runtime opens the store, then emits a
new available lifecycle event only if that exact incarnation is observed again.
Provider parsing and SQLite commits run on the observer worker, not the mux reactor. Wakterm watches provider artifact roots for both detected and adopted panes. Artifact changes schedule the existing throttled observer path, and a confirmed adopted session receives a trailing refresh when a hint lands inside the throttle window. Event consumers only read the durable stream. They do not need to poll provider files or call the catalog to make the producer advance.
The CLI page operation is:
wakterm agent events --after 123 --limit 100
Long-lived consumers can reuse one mux connection and receive JSON-lines pages:
wakterm agent events --after 123 --limit 100 --follow
Follow mode emits one line per page and drains retained pages without delay. At
the stream head it holds one bounded ReadAgentEvents request until a durable
commit or --wait-ms timeout, then repeats from the returned sequence. It exits
after cursor_too_old so the consumer can perform the documented
catalog-snapshot recovery.
ReadAgentEvents.wait_ms is additive, defaults to zero when absent, and is
clamped to 30 seconds by the server. Existing events and retention gaps return
immediately.
Unknown additive fields must be tolerated. A consumer must skip an event of a kind it does not know, after the same sequence and identity checks as any other event, and continue past it, so that Wakterm can add event kinds without a coordinated consumer deploy. A kind that consumers must act on is announced by a capability, as input_accepted_events.v1 announces input_accepted; a consumer that relies on such a kind checks for the capability. An incompatible major schema must fail explicitly. Provider paths and parser cursors are not public identities.
Wakterm tests validate the current DTO examples, receipt invariants, sequence ordering, lifecycle relationship, retention gap, and required error classes. Panetone should consume this same file rather than copying the examples.