Expose lifecycle timestamps on app-server thread items (#57172)

## What changed

- Add nullable `startedAtMs` and `completedAtMs` fields to `ThreadItem` in live notifications and turn history. Values are Unix milliseconds when recorded.
- Preserve recorded item times through history reconstruction, pagination, and resume, including command start times recorded during approval.
- Separate the Rust item payload into `ThreadItemPayload` while keeping the JSON payload flat, and update consumers, schemas, and generated TypeScript and Python types.

## Testing

Extend coverage for timestamp serialization, history reconstruction, paginated reads and resume, and persisted Python SDK items.

GitOrigin-RevId: ecbcee95af52db7c807b46a6e9deb30e5fba1f80
This commit is contained in:
Charlie Marsh
2026-10-26 18:13:00 +00:00
committed by copyberry
parent cf29971d93
commit a797dd7c6f
206 changed files with 4691 additions and 3089 deletions
@@ -1406,6 +1406,7 @@
"type": "string"
},
"ThreadItem": {
"description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire.",
"oneOf": [
{
"properties": {
@@ -2308,7 +2309,28 @@
"title": "ContextCompactionThreadItem",
"type": "object"
}
]
],
"properties": {
"completedAtMs": {
"default": null,
"description": "Unix timestamp in milliseconds when the item completed, if recorded.",
"format": "int64",
"type": [
"integer",
"null"
]
},
"startedAtMs": {
"default": null,
"description": "Unix timestamp in milliseconds when the item started, if recorded.",
"format": "int64",
"type": [
"integer",
"null"
]
}
},
"type": "object"
},
"ThreadSection": {
"description": "An independently persisted, user-visible thread section.",