(message: string)
| 78 | // `chunk.message ?? chunk.error?.message`). Once that fallback is removed, the |
| 79 | // `error` field can drop. |
| 80 | function createErrorChunks(message: string): Array<StreamChunk> { |
| 81 | return [ |
| 82 | { |
| 83 | type: EventType.RUN_STARTED, |
| 84 | runId: 'run-1', |
| 85 | threadId: 'thread-1', |
| 86 | timestamp: Date.now(), |
| 87 | }, |
| 88 | { |
| 89 | type: EventType.RUN_ERROR, |
| 90 | message, |
| 91 | // Legacy shape preserved for the fallback branch in generation-client.ts. |
| 92 | // AGUIEventSchema is `passthrough` so unknown keys are allowed at runtime; |
| 93 | // the strict TS union still requires a cast on this single chunk. |
| 94 | error: { message }, |
| 95 | } as StreamChunk, |
| 96 | ] |
| 97 | } |
| 98 | |
| 99 | describe('useGeneration', () => { |
| 100 | describe('initialization', () => { |
no test coverage detected