mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
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:
@@ -2411,6 +2411,8 @@ mod tests {
|
||||
&& field_prefix.trim() == "threadUsage?")
|
||||
|| (path == Path::new("v2/ThreadUsage.ts")
|
||||
&& field_prefix.trim() == "nativeUsageUsdMicros?")
|
||||
|| (path == Path::new("v2/ThreadItem.ts")
|
||||
&& matches!(field_prefix.trim(), "startedAtMs?" | "completedAtMs?"))
|
||||
|| (path == Path::new("v2/McpServerOauthLoginCompletedNotification.ts")
|
||||
&& field_prefix.trim() == "loginId?")
|
||||
|| (path == Path::new("v2/MisalignmentErrorDetails.ts")
|
||||
|
||||
@@ -240,11 +240,11 @@ pub struct ThreadItem {
|
||||
pub payload: ThreadItemPayload,
|
||||
/// Unix timestamp in milliseconds when the item started, if recorded.
|
||||
#[serde(default)]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
pub started_at_ms: Option<i64>,
|
||||
/// Unix timestamp in milliseconds when the item completed, if recorded.
|
||||
#[serde(default)]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(type = "number | null", optional)]
|
||||
pub completed_at_ms: Option<i64>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user