Make thread item timestamps optional in TypeScript exports (#57420)

## Why

Older servers can omit thread item timestamps. The TypeScript contract should accept those responses while still allowing explicit `null` values.

## What changed

Mark `ThreadItem.startedAtMs` and `ThreadItem.completedAtMs` as optional nullable fields. Update the generated TypeScript and precomputed stable and experimental exports, and allow these fields in the optional-nullable export check.

GitOrigin-RevId: 186be7aa45a3e7c65f133b1e320809a9912ff1f3
This commit is contained in:
Keyan Zhang
2026-10-27 10:05:37 +00:00
committed by copyberry
parent 6fe77fc123
commit 124e4e5bfa
5 changed files with 6 additions and 4 deletions
@@ -38,11 +38,11 @@ export type ThreadItem = {
/**
* Unix timestamp in milliseconds when the item started, if recorded.
*/
startedAtMs: number | null,
startedAtMs?: number | null,
/**
* Unix timestamp in milliseconds when the item completed, if recorded.
*/
completedAtMs: number | null, } & ({ "type": "userMessage", id: string, clientId: string | null, content: Array<UserInput>, } | { "type": "hookPrompt", id: string, fragments: Array<HookPromptFragment>, } | { "type": "agentMessage", id: string, text: string, phase: MessagePhase | null, memoryCitation: MemoryCitation | null, delivery: AgentMessageDelivery | null, questions: Array<AsyncUserInputQuestion> | null, } | { "type": "functionCallOutput", id: string, name: string, namespace: string | null, output: FunctionCallOutputBody, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array<string>, content: Array<string>, } | { "type": "commandExecution", id: string,
completedAtMs?: number | null, } & ({ "type": "userMessage", id: string, clientId: string | null, content: Array<UserInput>, } | { "type": "hookPrompt", id: string, fragments: Array<HookPromptFragment>, } | { "type": "agentMessage", id: string, text: string, phase: MessagePhase | null, memoryCitation: MemoryCitation | null, delivery: AgentMessageDelivery | null, questions: Array<AsyncUserInputQuestion> | null, } | { "type": "functionCallOutput", id: string, name: string, namespace: string | null, output: FunctionCallOutputBody, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array<string>, content: Array<string>, } | { "type": "commandExecution", id: string,
/**
* Trusted first-party plugin id when this command resolves to one plugin script.
*/