Skip to content

fix(agent): handle missing final_response on error paths - #55880

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-55822
Closed

fix(agent): handle missing final_response on error paths#55880
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-55822

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

Fixes #55822.\n\nAIAgent.chat() and the direct run_agent.py main() path now tolerate run_conversation error/exhaustion results that contain error without final_response. chat() returns the error string instead of raising KeyError, and main() prints the error summary.\n\nTests:\n- scripts/run_tests.sh tests/run_agent/test_error_results.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels Jun 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing fix for #55822, same defensive-.get() mechanism as #55821 (chat()+main()) and #34770 (earliest, chat()-only). #39345 fixes it at the run_conversation source instead. Related cluster — not a duplicate; maintainer to pick canonical (caller-guard vs source-fix).

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Stale — 14-24 days without merge activity.

@kyssta-exe kyssta-exe closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AIAgent.chat() and main() raise KeyError('final_response') on run_conversation error/exhaustion paths

3 participants