#558
fix: propagate threaded provider errors
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 -qexited1withKeyError: 'value'. - After: the same command exited
0with5 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