fix(proxy): send ask_followup_question questions as array, not string - #1108
Open
Hughhhhcoder wants to merge 1 commit into
Open
Conversation
CodeBuddy's ask_followup_question tool schema requires the questions
parameter to be an array. buildFollowupQuestionArgs() was wrapping the
questions list in JSON.stringify(), producing a JSON string like
{"title":"...","questions":"[...]"}. Newer CodeBuddy clients reject the
tool call with 'invalid argument type for questions, expected array,
received string', which aborts session-init and bypasses the memory
pipeline.
Return the questions array directly and type the downstream response
builders (OpenAI/Anthropic, streaming and non-streaming) accordingly.
The other client form builders (claude-code, codex, dsh, workbuddy)
already emit questions as a real array; this aligns CodeBuddy with them.
Signed-off-by: HughChaw <146055770+Hughhhhcoder@users.noreply.github.com>
Collaborator
|
Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion. |
Author
|
Thanks for the quick update and for queueing the internal review — much appreciated. I’ll keep an eye on this thread and am happy to make any follow-up changes promptly once feedback comes in. |
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.
Problem
Fixes #1101.
CodeBuddy's
ask_followup_questiontool schema requires thequestionsparameter to be an array. HoweverMemoryProxy/src/session/codebuddy/form.ts'sbuildFollowupQuestionArgs()wraps the question list withJSON.stringify(), producing:{"title":"...","questions":"[{\"id\":\"team\",...}]"}Newer CodeBuddy clients reject this tool call with:
As a result the session-init form never renders, the user cannot pick an agent/task, retries exhaust (
asset-confirm max retries, abandoning), and the whole conversation bypasses the memory pipeline.Root cause
The only CodeBuddy form builder stringifies
questions, while every other client form builder (claude-code,codex,dsh,workbuddy) already emitsquestionsas a real array (e.g.return { questions }/JSON.stringify({ questions })).Fix
questionsarray directly frombuildFollowupQuestionArgs().FollowupQuestioninterface and type the downstream response builders (OpenAI/Anthropic, streaming and non-streaming) withquestions: FollowupQuestion[]instead ofquestions: string.Verification
tsc --noEmit— no new type errors insrc/session/codebuddy/(remaining errors are pre-existing and unrelated).buildFormResponse()for OpenAI non-streaming / OpenAI streaming / Anthropic non-streaming:questionsis now serialized as a JSON array in all three paths.{"title":"...","questions":[{"id":"team","question":"...","options":["OTA-Platform (h45wed8k)"],"multiSelect":false}]}