RunStreamState
@forge/monorepo / backend/src / RunStreamState
Type Alias: RunStreamState
RunStreamState =
object
Defined in: backend/src/core/events.ts:266
The deterministic projection of a run's event stream: the assistant message parts plus the
accounting/interaction state a client needs to render. It is a pure fold over RunEvents, so the
server (worker checkpoint) and any client rebuild identical state from the same events — the
single source of truth that makes reconnect produce no missing or duplicated parts.
Properties
connectionRequest?
readonlyoptionalconnectionRequest?:object
Defined in: backend/src/core/events.ts:284
Present while the run is waiting for somebody to connect a provider — task #264.
On the stream state rather than as a message part, because it is not a thing the model said: it is the
platform telling a client this run is stopped and here is the way to unstick it. Cleared by
connection.completed, so a client that reconnects mid-consent still sees the button and one that
reconnects after it does not.
expiresAt
readonlyexpiresAt:string
loginUrl
readonlyloginUrl:string
provider
readonlyprovider:string
scopes
readonlyscopes: readonlystring[]
toolName?
readonlyoptionaltoolName?:string
error?
readonlyoptionalerror?:PlatformError
Defined in: backend/src/core/events.ts:275
lastEventType?
readonlyoptionallastEventType?:RunEventType
Defined in: backend/src/core/events.ts:272
parts
readonlyparts: readonlyMessagePart[]
Defined in: backend/src/core/events.ts:267
pendingToolCalls
readonlypendingToolCalls: readonlyStreamPendingToolCall[]
Defined in: backend/src/core/events.ts:268
retry?
readonlyoptionalretry?:object
Defined in: backend/src/core/events.ts:274
Present between retry attempts, cleared as soon as the run makes progress again.
attempt
readonlyattempt:number
maxAttempts
readonlymaxAttempts:number
nextAttemptAt
readonlynextAttemptAt:string
sequence
readonlysequence:number
Defined in: backend/src/core/events.ts:271
Highest sequence folded in. Use as the reconnect cursor.
terminal
readonlyterminal:boolean
Defined in: backend/src/core/events.ts:291
usage
readonlyusage:object
Defined in: backend/src/core/events.ts:269
costMinorUnits
readonlycostMinorUnits:number
inputTokens
readonlyinputTokens:number
outputTokens
readonlyoutputTokens:number