fix(types): use typing.Callable instead of lowercase 'callable' - #45641
fix(types): use typing.Callable instead of lowercase 'callable'#45641KeyArgo wants to merge 2 commits into
Conversation
|
Thanks for identifying the invalid lowercase Problems
Suggested changes
Automated hermes-sweeper review. |
Replace the runtime builtin 'callable' used in type annotations with typing.Callable, which is the correct type annotation for callbacks. Matches the existing import in run_agent.py and adds Callable to the delegate_tool import.
63a6483 to
5982b3f
Compare
|
Rebuilt onto current main as a single clean commit ( The fix is unchanged from your 2026-07-14 review: lowercase Verified the invalid lowercase annotation is still present on current main at all 4 sites before rebuilding. |
|
@teknium1 — following up on your 2026-07-14 hermes-sweeper review (salvageability=high). The fix is unchanged — lowercase |
Summary
Fix from issue #32848 audit (item 13). The lowercase
callableisthe builtin
any()-style predicate function, not a type. Theintended type was
typing.Callable.Changes
run_agent.py:48— addedCallableto typing importrun_agent.py:5098, 5105—callable→Callabletools/delegate_tool.py:31— addedCallableto typing importtools/delegate_tool.py:728—callable→CallableBehavior
The Python interpreter doesn't catch this at runtime (callable is
always truthy when used as an annotation under PEP 563 deferred
evaluation). But static type checkers (mypy, pyright) flag it as
invalid, and IDE autocomplete/intellisense is degraded.
Risk
None. Type-only fix. No runtime behavior change. Test suite should
pass unchanged (and does, locally).
Fixes #32848 (part 13)