Skip to content

Validate tool execution results to prevent silent failures - #29

Merged
claude[bot] merged 1 commit into
mainfrom
improve/20260825-010550
Aug 25, 2026
Merged

Validate tool execution results to prevent silent failures#29
claude[bot] merged 1 commit into
mainfrom
improve/20260825-010550

Conversation

@ssevera1

Copy link
Copy Markdown
Owner

What

Add validation that tool execution results are not None before adding to conversation.

Why

Prevents silent failures when tools crash without returning a ToolResult object.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the guard against the surrounding control flow in agent/core/engine.py: it sits after the try/except/finally so the spinner is always stopped, mirrors the existing "Unknown tool" early-return pattern, and both call sites (lines 116 and 128) ignore the return value, so the early return changes nothing else. Without it, a tool that returns None instead of a ToolResult would hit format_tool_result's result.success and raise an AttributeError outside the try block, or record the literal string "None" into the conversation — the guard turns that into a recorded error message instead. All execute implementations are annotated -> ToolResult, so this only fires on a genuine tool bug; scoped to 7 lines in one file and matches the PR description.

@claude
claude Bot merged commit 7afab69 into main Aug 25, 2026
3 checks passed
@claude
claude Bot deleted the improve/20260825-010550 branch August 25, 2026 01:07
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