Skip to content

Commit cf3935d

Browse files
Sync public snapshot from freebuff-private
Source: CodebuffAI/freebuff-private@0beb459620b8c16fca01907cc113c7cdd5e55e29
1 parent 5174dcc commit cf3935d

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎sdk/src/impl/__tests__/late-failure-chunk.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,28 @@ describe('late failure delivered in band', () => {
126126
)
127127
})
128128

129+
it('ends the turn with the message of a final capacity refusal, without a retry', async () => {
130+
// The server's Space Bunny queue refusal once its wait budget is spent
131+
// (web/.../space-bunny-queue.ts `spaceBunnyAtCapacityChunk`). A retry
132+
// would only queue the step for another five minutes, so it carries no
133+
// status and a non-numeric code, and must not be classified as one.
134+
const message =
135+
'Space Bunny is at capacity right now. Please try again in a few minutes or pick another model.'
136+
await withServer(
137+
errorChunk({ message, code: 'model_at_capacity', type: 'capacity_error' }),
138+
(error) => {
139+
expect(String(error)).toContain(message)
140+
expect(isTransientNetworkError(error)).toBe(false)
141+
expect(
142+
classifyThrownStreamRecovery({ aborted: false, error }),
143+
).toBeNull()
144+
expect(
145+
classifyProviderErrorRecovery({ aborted: false, error }),
146+
).toBeNull()
147+
},
148+
)
149+
})
150+
129151
it('is why a bare connection cut is not good enough', () => {
130152
// The behaviour the in-band chunk exists to avoid. Erroring the response
131153
// body mid-stream reaches Bun's fetch as this message (confirmed against a

0 commit comments

Comments
 (0)