Skip to content

Commit 3c25750

Browse files
committed
fix(search): treat a provider 408 as a retryable read timeout
1 parent 71767ed commit 3c25750

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/sim/lib/sim-search/live/application.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,11 @@ describe('authorized live retrieval', () => {
796796
new McpError(ErrorCode.RequestTimeout, 'TimeoutError'),
797797
{ retryable: true, message: expect.stringContaining('took too long') },
798798
],
799+
[
800+
'a provider request timeout response',
801+
new NativeSearchError('unavailable', 'Provider request failed (408).', undefined, 408),
802+
{ retryable: true, message: expect.stringContaining('timed out') },
803+
],
799804
[
800805
'a native request socket timeout',
801806
Object.assign(new Error('Request timed out after 10000ms'), { code: 'ETIMEDOUT' }),

‎apps/sim/lib/sim-search/live/application.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ function liveReadFailure(error: unknown, provider: string, deadline?: AbortSigna
777777
)
778778
if (error.status === 'rate_limited')
779779
return new LiveReadError(error.message, true, error.retryAfterSeconds)
780-
if (error.status === 'timeout')
780+
if (error.status === 'timeout' || error.httpStatus === 408)
781781
return new LiveReadError(`${name} timed out reading this document. Try again.`, true)
782782
if (error.httpStatus === 404 || error.httpStatus === 410)
783783
return new OrchestrationError(

0 commit comments

Comments
 (0)