chat/send: allow null message on tool_call_results path#188
Merged
Conversation
Pairs with 57c4c32 — that commit added route-level acceptance of the parallel-tool-call body shape (tool_call_results + persist_only with no message), but left the service-layer guard requiring message to be non-null. Result: every salem-engine request using the new shape was rejected with 400 BAD_REQUEST: Required fields: from_agent, message, killing every NPC tick at iter=1 and the chronicler harness too. Split the combined fromAgent/message guard into two and gate the message check on toolCallResults being null. Route already enforces mutual exclusivity between message and tool_call_results, so allowing message=null on the tool-results path is safe — rowSpecs uses spec.message from each tool-result entry, and handleDirectChat's tool-use branch builds the user message from history rather than dereferencing the inline messageText. Co-Authored-By: Home <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_call_results/persist_onlybody shape (introduced for parallel tool calls) was rejected with400 BAD_REQUEST: Required fields: from_agent, message.messagewhentoolCallResultsis null. Route already enforces mutual exclusivity, so the tool-results path is safe —rowSpecsusesspec.messagefrom each tool-result entry, andhandleDirectChat's tool-use branch builds the user message from history rather than dereferencing the inlinemessageText.Impact
NPC ticks and chronicler harness are entirely broken in production right now (every iter=1 + every persistToolResults call returns 400). Confirmed via salem journalctl: chronicler dispatch, agent ticks, terminal commits all dying with this error since the deploy at 22:16 UTC.
Test plan
messageon the tool-results pathjournalctl -u salem-enginefor the 400 errors to stopdonerow lands inagent_action_log— Home
🤖 Generated with Claude Code