fix: correct new_answer argument name in Copilot backend synthetic tool call#863
Closed
Copilot wants to merge 3 commits intocopilot-sdkfrom
Closed
fix: correct new_answer argument name in Copilot backend synthetic tool call#863Copilot wants to merge 3 commits intocopilot-sdkfrom
Copilot wants to merge 3 commits intocopilot-sdkfrom
Conversation
18 tasks
…ol call
The Copilot backend's fallback mechanism was using "answer" instead of "content"
as the argument name when synthesizing a new_answer tool call. The new_answer
tool definition expects "content" (as defined in new_answer.py), causing the
orchestrator to retry and fail with "Agent failed to use workflow tools after 3 attempts".
Changed line 311 in copilot.py from:
"arguments": {"answer": full_answer}
to:
"arguments": {"content": full_answer}
Also updated test_copilot.py to reflect the correct expected argument name.
Co-authored-by: AbhimanyuAryan <8083613+AbhimanyuAryan@users.noreply.github.com>
Co-authored-by: AbhimanyuAryan <8083613+AbhimanyuAryan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for Copilot SDK
fix: correct new_answer argument name in Copilot backend synthetic tool call
Feb 7, 2026
|
This PR is marked as stale because there has been no activity for 30 days. Remove stale label or add new comments or this PR will be closed in 3 day. |
|
Close this stale PR. |
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.
Description
Fixed parameter mismatch in Copilot backend's fallback mechanism. When the model responds with text but doesn't call workflow tools, the backend synthesizes a
new_answertool call. However, it was using"answer"as the parameter name instead of"content", causing the orchestrator to reject it and retry with "You must use workflow tools" errors.Type of change
fix:) - Non-breaking change which fixes an issuefeat:) - Non-breaking change which adds functionalitybreaking:) - Fix or feature that would cause existing functionality to not work as expecteddocs:) - Documentation updatesrefactor:) - Code changes that neither fix a bug nor add a featuretest:) - Adding missing tests or correcting existing testschore:) - Maintenance tasks, dependency updates, etc.perf:) - Code changes that improve performancestyle:) - Changes that do not affect the meaning of the code (formatting, missing semi-colons, etc.)ci:) - Changes to CI/CD configuration files and scriptsChecklist
Pre-commit status
How to Test
Test CLI Command
Expected Results
new_answertool callAdditional context
Root cause: The
new_answertool schema definescontentas the required parameter (seemassgen/tool/workflow_toolkits/new_answer.py), and the orchestrator extracts it viatool_args.get("content", ...). The synthetic tool call was using the wrong key.Changes:
massgen/backend/copilot.py:310: Changed{"answer": full_answer}→{"content": full_answer}massgen/tests/backend/test_copilot.py:129: Updated test assertion to expect correct parameter nameexceptclause to catch specific exceptions (json.JSONDecodeError,ValueError)noqa: E402for intentional post-mock import💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.