Repository navigation
fix(batch-evaluation): use a 60 s timeout for observation page fetches - #2096
Merged
hassiebp merged 1 commit intoNov 5, 2026
Merged
Conversation
The observations v2 API can scan for up to 45 s before returning a page, but page fetches used the client-wide default timeout of 5 s. Timeouts are not retried, so the run stopped, and resuming repeated the same request. Send a per-request timeout above the server budget without changing the global timeout, and drop the 'after N retries' wording from the fetch failure log, since timeouts and 422s are never retried.
This was referenced Nov 5, 2026
DavidTraina
marked this pull request as ready for review
November 5, 2026 07:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Since langfuse/langfuse#19043, the observations v2 API keeps scanning until it fills the page or reaches its 45 s budget, so slow pages are expected. This is especially true for selective filters on large projects. Batch evaluation fetched pages with the client-wide timeout, which defaults to 5 s.
Fern retries only 408/409/429/5xx responses, not
httpxtimeouts. So the run stopped on the first slow page withcompleted=False. Resuming sent the identical request and timed out the same way, so the run never made progress. The error log also saidFailed to fetch batch after 3 retriesafter a single attempt.Fix
timeout_in_seconds=60per request on observation page fetches.LANGFUSE_TIMEOUTwould also lengthen the OTLP export deadline, and with itflush()andshutdown()when the host is unreachable.Failed to fetch batch: <error>without the misleading retry count.The per-request option also applies when the user passes a custom
httpx_client.Related PRs
Independent follow-ups to langfuse/langfuse#19043, mergeable in any order: #2097 (batch evaluation stops on empty pages), #2098 (docs), #2099 (test helpers), #2101 (pagination helper).
Type of change
Verification
List the main commands you ran:
I also ran
run_batched_evaluationagainst a local stub server that answers after 7 s. Before the change it failed after 5.0 s with one request (completed=False). Withtimeout_in_seconds=60the same call succeeded after 7.0 s.Checklist
code_review.md..env.templateif needed.

Confidence Score: 5/5
This PR appears safe to merge.Summary
Batch evaluation now gives each observation page request a 60-second timeout without changing the client-wide timeout.
Reviews (1) · Last reviewed commit: "fix(batch-evaluation): use a 60 s timeou..." · Reviewed by Greptile