Repository navigation
[Bug] messages protocol: prepare undefined crash on tool_use, then INVALID_REQUEST on retry #7120
Replies: 1 comment
|
Your hypothesis is testable against the source, and it does not hold: this is neither protocol-specific nor a race. The The crash happens before any serializationThe throw site is const prepared = await ctx.tools[TOOL_RUNTIME_SCHEDULER].prepare(call.exec)That file imports nothing protocol-related. Its complete value-import list is Nothing here is a race, and nothing is partially initialized: the scheduler is a plain computed class field assigned at construction, Why
|
Uh oh!
There was an error while loading. Please reload this page.
Environment
0.1.6-alpha.2(source deploy)deepseek-official(defaultdeepseek-flash)messages(default)Steps to Reproduce
pnpm dsh web, open Web UItool_useblocksCannot read properties of undefined (reading 'prepare')INVALID_REQUEST: DeepSeek Messages tool calls need immediate resultsExpected Behavior
Tool result should be prepared and sent back to the API as
tool_resultblocks following thetool_useassistant message.Actual Behavior
Cannot read properties of undefined (reading 'prepare')— the tool result preparation step crashesINVALID_REQUEST: tool calls need immediate results(the messages protocol requirestool_resultblocks immediately aftertool_use)Root Cause Hypothesis
In
messages(Anthropic) protocol mode, the tool result serialization path references apreparemethod on an object that isundefined. This may be a missing null-check or a race condition where the tool handler isn't fully initialized before results are expected.Workaround
Switch to
chat-completionsprotocol (works fine):Logs
All reactions