Skip to content

fix(agents): distinguish missing tools from execution KeyErrors - #478

Open
00200200 wants to merge 2 commits into
anthropics:mainfrom
00200200:codex/quickstart-tool-keyerror-diagnostics
Open

00200200 wants to merge 2 commits into
anthropics:mainfrom
00200200:codex/quickstart-tool-keyerror-diagnostics

Conversation

@00200200

@00200200 00200200 commented Sep 14, 2026

Copy link
Copy Markdown

A KeyError raised inside an existing tool is currently reported as Tool not found, hiding the actual failure and misleading the next agent turn. Separate tool lookup from execution, preserving the missing-tool message and reporting execution exceptions through the existing error path.

Validation: PYTHONPATH=agents python -m pytest tests/agents/test_tool_keyerror_diagnostics.py -q (3 passed in 0.01s). The regression tests fail on the unchanged main branch. Tests use local fixtures; no paid API calls.

Prepared with Codex assistance; the final diff and regression behavior were checked locally.

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.

1 participant