diff --git a/src/shared/agent-status-observation.ts b/src/shared/agent-status-observation.ts index 0eeb60e4bb3..521f2de1cc4 100644 --- a/src/shared/agent-status-observation.ts +++ b/src/shared/agent-status-observation.ts @@ -62,6 +62,17 @@ export type AgentStatusObservation = { * body, so a hook or OSC writer cannot declare its own provenance. */ export type WithAgentStatusObservation = { observation?: AgentStatusObservation } +/** Renderer-local count of ACCEPTED status writes this pane's row has taken. Incremented only by + * the store's accept branch, off the row it replaces, and carried through by every field-level + * rewrite — so it answers "did the pane report again?", which `updatedAt` cannot, because the + * accept rule admits equal timestamps. Lives on the row rather than in a side table so no + * teardown path can reset it out from under a reader (STA-4612). Never sent over IPC or + * persisted to last-status.json. + * + * Declared here beside the observation facet because both are per-write facets mixed into + * `AgentStatusEntry` rather than fields a reporter supplies. */ +export type WithAcceptedStatusSeq = { acceptedStatusSeq?: number } + // ─── THE ORDERING RULE ────────────────────────────────────────────────────── // `(authorityId, incarnation, revision)` is a total order ONLY within one authorityId. // A different authorityId means "incomparable", not "older" — the id is regenerated per diff --git a/src/shared/agent-status-types.ts b/src/shared/agent-status-types.ts index 33b01821d48..21cf4c931b5 100644 --- a/src/shared/agent-status-types.ts +++ b/src/shared/agent-status-types.ts @@ -3,7 +3,7 @@ // a narrow interrupt fallback synthesizes a final `done` when an agent misses its cancellation hook. import type { AgentProviderSessionMetadata } from './agent-session-resume' -import type { WithAgentStatusObservation } from './agent-status-observation' +import type { WithAcceptedStatusSeq, WithAgentStatusObservation } from './agent-status-observation' import { normalizeInteractivePromptField, normalizeOptionalField, @@ -152,14 +152,8 @@ export type AgentStatusEntry = { * the transition may have been missed while no receiver was up, so freshness gates * treat the row as stale immediately. Cleared by any accepted live event. */ restoredUnconfirmed?: boolean - /** Renderer-local count of ACCEPTED status writes this pane's row has taken. Incremented only by - * the store's accept branch, off the row it replaces, and carried through by every field-level - * rewrite — so it answers "did the pane report again?", which `updatedAt` cannot, because the - * accept rule admits equal timestamps. Lives on the row rather than in a side table so no - * teardown path can reset it out from under a reader (STA-4612). Never sent over IPC or - * persisted to last-status.json. */ - acceptedStatusSeq?: number -} & WithAgentStatusObservation +} & WithAgentStatusObservation & + WithAcceptedStatusSeq export type MigrationUnsupportedPtyEntry = { ptyId: string