test(native-chat): clarify that lifecycle field is optional

Add type assertion and comment documenting that lifecycle field is optional and can be omitted in truncation-gating test fixtures.
This commit is contained in:
Jinjing
2026-07-16 20:51:21 -07:00
parent 4a9965e227
commit b99cd37a8f
@@ -8,9 +8,17 @@ const OVERSIZED = 'x'.repeat(5000)
const cachedResult = vi.hoisted(() => ({
value: {
messages: [] as NativeChatMessage[],
// Optional so truncation-gating fixtures can omit it; lifecycle tests set it explicitly.
lifecycle: undefined as
| { state: 'working' | 'completed' | 'interrupted'; turnId: string; timestamp: number | null }
| undefined
} as {
messages: NativeChatMessage[]
lifecycle?: {
state: 'working' | 'completed' | 'interrupted'
turnId: string
timestamp: number | null
}
}
}))
const watcher = vi.hoisted(() => ({