Skip to content

fix: don't drop empty tool results from working memory - #41

Merged
jordanauge merged 1 commit into
mainfrom
fix/empty-tool-result-orphan
Aug 26, 2026
Merged

fix: don't drop empty tool results from working memory#41
jordanauge merged 1 commit into
mainfrom
fix/empty-tool-result-orphan

Conversation

@msardara

@msardara msardara commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Completed tool calls with empty output (e.g. a delegate_to_* call whose sub-agent returns no final text) were silently skipped when syncing tool results into working memory, leaving the assistant's tool_calls id unpaired. That malformed history causes providers (Bedrock/Anthropic) to reject the next request with "Expected toolResult blocks ... for the following Ids: call_N". Removed the empty-text guard in _sync_tool_result_memory; the existing call_id check already covers the genuine "nothing to sync" case.

Added a regression test driving a full kernel turn with a tool returning an empty string, asserting every declared tool_calls id has a matching tool-role message. Full test suite passes.

…memory

A completed tool call with empty output (e.g. a delegate_to_* call whose
sub-agent produced no final text) was silently skipped, leaving its
assistant tool_calls id unpaired in the message history. Providers like
Bedrock/Anthropic reject that payload on the next turn with "Expected
toolResult blocks ... for the following Ids".
@msardara
msardara force-pushed the fix/empty-tool-result-orphan branch from d3c6f59 to 8070a91 Compare August 26, 2026 13:59
@msardara
msardara marked this pull request as ready for review August 26, 2026 16:39
@msardara
msardara requested a review from jordanauge August 26, 2026 16:40

@jordanauge jordanauge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@jordanauge
jordanauge merged commit 2f02353 into main Aug 26, 2026
3 checks passed
@jordanauge
jordanauge deleted the fix/empty-tool-result-orphan branch August 26, 2026 17:53
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.

2 participants