Skip to content

Conversation

@declanjackson
Copy link
Collaborator

@declanjackson declanjackson commented Jan 29, 2026

Improve error handling

Errors from E2B sandbox and web tools were propagating as unhandled exceptions, causing models to get stuck or receive misleading feedback.

Changes:

  1. E2B sandbox (src/stirrup/tools/code_backends/e2b.py)
    - Added catch-all exception handler to run_command() that returns CommandResult with
    error_kind="execution_error"
    - Matches existing pattern in Docker and Local backends
  2. Web fetch (src/stirrup/tools/web.py)
    - Extended exception handling to also catch httpx.InvalidURL and ValueError
  3. Web search (src/stirrup/tools/web.py)
    - Wrapped search execution in try/except to handle httpx.HTTPError
    - Returns proper error XML with success=False instead of crashing
  4. Tests (tests/test_e2b_execution.py)
    - Added test case for unexpected exception handling in E2B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants