Skip to content

fix(types): use typing.Callable instead of lowercase 'callable'#45641

Open
KeyArgo wants to merge 1 commit into
NousResearch:mainfrom
KeyArgo:work/issue-32848-types
Open

fix(types): use typing.Callable instead of lowercase 'callable'#45641
KeyArgo wants to merge 1 commit into
NousResearch:mainfrom
KeyArgo:work/issue-32848-types

Conversation

@KeyArgo

@KeyArgo KeyArgo commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Fix from issue #32848 audit (item 13). The lowercase callable is
the builtin any()-style predicate function, not a type. The
intended type was typing.Callable.

Changes

  • run_agent.py:48 — added Callable to typing import
  • run_agent.py:5098, 5105callableCallable
  • tools/delegate_tool.py:31 — added Callable to typing import
  • tools/delegate_tool.py:728callableCallable

Behavior

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)

…NousResearch#32848 NousResearch#13)

The lowercase 'callable' is the builtin 'any()'-style predicate
function, not the type. The intended type was 'typing.Callable'.

Files changed:
- run_agent.py:48 — added Callable to typing import
- run_agent.py:5098, 5105 — callable → Callable
- tools/delegate_tool.py:31 — added Callable to typing import
- tools/delegate_tool.py:728 — callable → Callable

The Python interpreter doesn't catch this at runtime (callable is
always truthy when used as an annotation and silently gets stored
as a string under PEP 563), but static type checkers (mypy, pyright)
rightly flag it as invalid. The previous tools/microsoft_graph_client.py
and others already use Callable correctly.

Fixes NousResearch#32848 (part 13)
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent loop, run_agent.py, prompt builder tool/delegate Subagent delegation P3 Low — cosmetic, nice to have labels Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have tool/delegate Subagent delegation type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collection of minor bugs, typos, and inconsistencies found during code audit

2 participants