fix(beta): capture HTTP status + error into sweep_runs.notes#107
Merged
Augustas11 merged 1 commit intoJun 18, 2026
Merged
Conversation
When a sweep cell failed, sweep_runs recorded n_err > 0 but notes was NULL — the per-request HTTP status and error string from harness.py were dropped on the floor. Caused a ctx=2000 production-gateway misdiagnosis: a transient 503 provider_unavailable was misread as a gateway streaming read-idle bug, with no way to confirm without re-running. aggregate_cell now collects up to 3 distinct (status, error[:80]) pairs from the per-request results, joins them into a ~200-char summary, and exposes it via the existing notes column. notes stays NULL on cells where every request succeeded. Co-Authored-By: Claude Opus 4.8 <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
When a sweep cell fails,
sweep_runsrecordsn_err > 0but thenotescolumn is NULL — the per-request HTTP status and error string already captured byharness.fire_streamare dropped on the floor inaggregate_cell. This caused a real misdiagnosis last week: a ctx=2000 failure through the production gateway was misread as a "gateway streaming read-idle timeout bug" when gateway-path timeouts are all 280–360s. The actual cause was almost certainly a transient503 provider_unavailableon a marginal single-slot provider, but the harness gave no way to confirm without re-running.Base is
spike/provider-model-autotunebecause that is wherebeta/sweep.pylives today; it is not yet onmain.Fix
aggregate_cell, collect up to 3 distinct(http_status, error[:80])pairs while iterating per-request results, join them into a ~200-char summary, and expose it asnotes(NULL when every request succeeds). The cell-row builder usesagg["notes"]instead of the hardcodedNone. ≤20-line change; no schema migration needed (notescolumn already exists).Verification
Local smoke against
beta/mock_llm_server.py.100% error mock (per the verification plan in the task prompt) —
notespopulated:Green mock (0% errors) —
notesstays NULL:python3 -m py_compile beta/sweep.py beta/harness.py— OKbeta/sweep.py.harness.py, schema, and other phases untouched.🤖 Generated with Claude Code