Repository navigation
fix(eval): give each local model call the task's time budget - #562
Merged
Merged
Conversation
The benchmark's loopback Ollama client used a fixed 25 s socket timeout. A non-streaming /api/chat sends nothing until the whole reply is ready, so a cold model load or a long reply was reported as model_error at 25 s, far inside the task's 90 s budget. That dominated real-model runs (6 of 8 qwen3:8b failures were model_error at about 25.1 s). One constant, TASK_SECONDS, now sets both the task's wall-clock budget and the read timeout, so a slow model fails on its time limit instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
With real local models, the agent benchmark (
tools/agent_eval.py --model ...) reported most failures asmodel_errorat about 25 seconds. With qwen3:8b, 6 of 8 failures weremodel_errorat 25.06 to 25.08 s. With nemotron-3-nano:4b, 3 of them hit 25.06 s on the first call.Root cause
LoopbackOllamaClient._requestopensHTTPConnection(..., timeout=25)for a non-streaming/api/chat. Ollama sends nothing until the whole reply is ready, so that one socket read has to cover model load and the entire generation. A cold load or a long reply therefore times out long before the task's 90 s wall-clock budget.Change
One constant,
TASK_SECONDS = 90, now sets both the task'sLoopBudgets.max_secondsand the HTTP read timeout. A slow model now fails on the task's time limit, not as a transport error. Check mode, loopback-only transport and response size limits are unchanged.Tests
test_agent_eval.py: the fake-connection test now records the timeout and asserts both requests useTASK_SECONDS. It fails onmain(25).tests/test_agent_eval.py(56 passed, 6 skipped).tools/agent_eval.py --checkpasses 10/10. ruff and mypy are clean.Risk and rollback
Benchmark tooling only. Rollback is reverting this commit.
🤖 Generated with Claude Code