The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | /** |
| 2 | * workerd logs every error a step callback throws as an uncaught promise |
| 3 | * rejection, even when the workflow catches it. The timer quota regression |
| 4 | * test in engine.test.ts fails 5,100 steps on purpose, which floods the |
| 5 | * output with 10,000+ identical stack lines, so drop that test's error. |
| 6 | */ |
| 7 | const FLOOD = "Error: immediate step failure"; |
| 8 | |
| 9 | export default function setup() { |
| 10 | // oxlint-disable-next-line typescript/unbound-method -- saved only to restore the original on teardown; calls go through the bound `forward` |
| 11 | const write = process.stdout.write; |
| 12 | const forward = write.bind(process.stdout) as (...args: Array<unknown>) => boolean; |
| 13 | process.stdout.write = ((chunk: unknown, ...rest: Array<unknown>) => |
| 14 | String(chunk).includes(FLOOD) || forward(chunk, ...rest)) as typeof process.stdout.write; |
| 15 | return () => { |
| 16 | process.stdout.write = write; |
| 17 | }; |
| 18 | } |