Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(test): throttle test slice no longer swallows the flash_timeout branch

purple0f6705a88871
diff --git a/src/hooks/__tests__/throttled-run-waits-it-out.test.ts b/src/hooks/__tests__/throttled-run-waits-it-out.test.ts
index edfd1c39..58b89746 100644
--- a/src/hooks/__tests__/throttled-run-waits-it-out.test.ts
+++ b/src/hooks/__tests__/throttled-run-waits-it-out.test.ts
@@ -68,9 +68,14 @@ describe('and giving up says when to come back', () => {
})
it('a throttle does not kill a /loop, unlike an empty wallet', () => {
+ // R5-53 added the flash_timeout branch right after this one, which DOES
+ // set loopHalt (a flash timeout is final, unlike a throttle) — so the end
+ // anchor is that branch's own start, not the next NAMED branch further
+ // down, or this slice would swallow flash_timeout's loopHalt too and
+ // read as a false regression here.
const branch = agent.slice(
agent.indexOf('} else if (httpStatusOf(err) === 429) {'),
- agent.indexOf('} else if (/failed to fetch'),
+ agent.indexOf("} else if ((err as { code?: string })?.code === 'flash_timeout') {"),
)
expect(branch).not.toContain('loopHalt =')
})