Skip to content

fix: propagate threaded provider errors - #558

Open
Iams4kura wants to merge 1 commit into
GreyDGL:mainfrom
Iams4kura:bugfix/propagate-threaded-provider-errors-20260920t040133z
Open

Iams4kura wants to merge 1 commit into
GreyDGL:mainfrom
Iams4kura:bugfix/propagate-threaded-provider-errors-20260920t040133z

Conversation

@Iams4kura

Copy link
Copy Markdown

Summary

  • Preserve provider exception types and messages when run_sync() is called from an active asyncio loop.
  • Replace the manual thread result dictionary with a single-worker future, whose result() re-raises worker exceptions in the caller.
  • Add a deterministic regression for the previous RuntimeError → KeyError("value") failure.

Fixes #503.

Regression evidence

  • Before: uv run python -m pytest tests/legacy/test_client.py -q exited 1 with KeyError: 'value'.
  • After: the same command exited 0 with 5 passed.

Verification

  • make ci
    • root tests: 134 passed
    • maintained-agent tests: 118 passed, 1 skipped
    • Ruff lint and format checks passed
    • Mypy passed
    • root and maintained-agent package builds passed

Scope

  • 2 files changed, +13 / -11 lines
  • no dependency, lockfile, generated-file, or unrelated changes

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.

run_sync masks provider exceptions as KeyError in async contexts

1 participant