Repository navigation
fix(task): name a messageless error on a failed run - #644
Draft
revan-aleti wants to merge 1 commit into
Draft
revan-aleti wants to merge 1 commit into
revan-aleti wants to merge 1 commit into
Conversation
record_task_failure stored str(error), which is empty for TimeoutError(),
httpx.ConnectError('') and other exceptions without a message, so the run
was recorded as failed with no error text. Record the exception's class,
and its cause's, when the message is empty. Runs with a message record it
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Tl;dr
A failed run whose exception has no message (
TimeoutError(),httpx.ConnectError('')) was recorded with an emptyerror. It now records the exception's class, and its cause's, so these failures can be told apart.For Reviewers
record_task_failure_syncwritesfailure_text(error)instead ofstr(error). Whenstr(error)is non-empty, the stored text is unchanged. Only an empty message changes, toTimeoutErrororTimeoutError (from ConnectionResetError: peer reset).__cause__, else from__context__unless__suppress_context__is set (raise ... from None). It goes one level deep only.pytest tst/unit/task/task_failure_write_retry_test.py tst/unit/task/step_journal_test.py: 58 passed.pytest -n 16 tst/unit: 13,503 passed, 7 skipped.make lint: clean.test_a_run_failed_by_a_messageless_error_records_its_classfails on the old code (error == '').For Agents
src/agent_env/task/store.pyaddsfailure_text(), andrecord_task_failure_syncuses it for theerrorfield.tst/unit/task/task_failure_write_retry_test.pyadds a formatting test (message kept, bare class, explicit cause, implicit context, suppressed context) and an end-to-end write throughLocalSqliteDocumentStore.record_task_cancelledalready falls back withstr(exc) or "cancelled".step_attempt_failuresandcontext.metadata.failed_stepsalready carry the error class.str()of an exception raised with no arguments is''. That's Python semantics, and the reason those runs showed no error.🤖 Generated with Claude Code