Repository navigation
[BUG] ask_followup_question fails with "missing required parameter follow_up" #690
Description
Description
The ask_followup_question tool intermittently fails with the error
missing required parameter follow_up, even though the model did supply a
follow_up value. The failure occurs when a model emits follow_up as a single
bare object (one suggestion) instead of wrapping it in an array:
// What the model sometimes emits (rejected):
{ "question": "Proceed?", "follow_up": { "text": "Yes", "mode": null } }
// What the tool requires (accepted):
{ "question": "Proceed?", "follow_up": [{ "text": "Yes", "mode": null }] }The tool's JSON schema (src/core/prompts/tools/native-tools/ask_followup_question.ts)
declares follow_up as type: "array" with minItems: 1 -- so a single
suggestion is valid. The problem is the missing array wrapper, not the number
of suggestions. The tool description text ("a list of 2-4 suggested answers")
likely nudges some models into thinking a single answer does not need an array.
Root Cause
There are two parser surfaces, but only one is responsible for the runtime error:
NativeToolCallParser.parseToolCall(line ~825) -- the finalized tool call
path that produces thenativeArgsactually passed to tool execution. It sets
follow_up: args.follow_upwith no coercion, so a bare object passes through
unchanged.AskFollowupQuestionTool.execute(line ~38) -- guards with
!follow_up || !Array.isArray(follow_up)and, on failure, calls
recordMissingParamError("follow_up"). Because the value is a non-array object,
this guard fires and produces the misleading "missing parameter" message even
though the parameter was present.
The streaming/partial path
(NativeToolCallParser.createPartialToolUse, line ~480) also drops a non-array
follow_up to undefined, but its output is only consumed by
AskFollowupQuestionTool.handlePartial, which reads question only and never
touches follow_up. It is therefore not a cause of the observed error, only
a cosmetic inconsistency in partial UI rendering.
Affected Files
src/core/assistant-message/NativeToolCallParser.ts(lines ~480, ~825)src/core/tools/AskFollowupQuestionTool.ts(lines ~38, ~46)
Proposed Fix
- In
NativeToolCallParser.parseToolCall, coerce a bare-objectfollow_upinto a
single-element array before assigningnativeArgs(checkArray.isArrayfirst
so an existing array is never re-wrapped). - Apply the same coercion in
createPartialToolUsefor partial-render consistency. - Correct the misleading error: when
follow_upis present but not an array,
report a malformed-parameter error rather than "missing required parameter". - (Optional robustness) Filter out suggestions lacking a
textfield so a
malformed single suggestion fails clearly rather than producing an empty answer.
Test Procedure
- Add a unit test for
NativeToolCallParser.parseToolCallasserting that a bare
objectfollow_upis coerced to a single-element array innativeArgs. - Add a unit test for
AskFollowupQuestionTool.executeasserting that a single
valid suggestion (array of one) succeeds and reachestask.ask. - Verify that an existing multi-suggestion array still works unchanged.
- Manual: trigger a follow-up question in F5 development mode and confirm a
single-suggestion response renders and is accepted.
Activity
awschmeder commentedon Jun 23, 2026
See #695 -- likely root cause after further investigation - not related to tool use error or instructions
[-][BUG] ask_followup_question fails with "missing required parameter follow_up" when a single suggestion is provided as a bare object[/-][+][BUG] ask_followup_question fails with "missing required parameter follow_up"[/+]