Copilot: migrate tool-use from custom XML format to provider's standard tool-call API#2926
Copilot: migrate tool-use from custom XML format to provider's standard tool-call API#2926nighca merged 1 commit intogoplus:devfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a significant upgrade to the main Copilot's interaction model by transitioning from a proprietary XML-based tool invocation system to a standard tool-call API. This change introduces a new Server-Sent Events (SSE) streaming endpoint, allowing for more structured and efficient communication between the frontend and backend. The primary goal is to improve the robustness and flexibility of Copilot's tool-use capabilities, support more complex conversational flows, and ensure a smooth, backward-compatible rollout across different deployment environments. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Solid migration — replacing the custom XML tool-use protocol with the provider's standard tool-call API is the right architectural move. The new |
There was a problem hiding this comment.
Pull request overview
This PR migrates the GUI Copilot tool-use flow from legacy custom XML markup parsing to a provider-style structured tool-call interface, using an SSE event stream (text_delta / tool_call_delta) and explicit tool definitions passed via request options.
Changes:
- Replaced legacy
<tool-use ... />parsing with structuredtoolCalls+toolrole messages, streamed via SSE events. - Added tool-call delta accumulation/finalization utilities and expanded unit tests to cover tool-call-only turns and tool-call/tool-result history sampling.
- Updated tutorial and UI plumbing to handle
copilotmessages that may havecontent: nullwhen a turn contains only tool calls.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spx-gui/src/components/tutorials/tutorial-course-abandon.ts | Simplifies tutorial abandon/dismiss tag instructions. |
| spx-gui/src/components/tutorials/TutorialRoot.vue | Registers tutorial custom elements/providers based on active course via watch cleanup. |
| spx-gui/src/components/copilot/tool-call.ts | New helpers to accumulate streamed tool_call_delta fragments and finalize tool calls. |
| spx-gui/src/components/copilot/tool-call.test.ts | Unit tests for tool-call delta accumulation and finalization errors. |
| spx-gui/src/components/copilot/custom-elements/ToolUse.ts | Removes the legacy custom-element-based tool invocation mechanism. |
| spx-gui/src/components/copilot/copilot.ts | Core migration: SSE event handling, structured tool calls/results, tool schema export via API options, and tool-call-aware history sampling. |
| spx-gui/src/components/copilot/copilot.test.ts | Extensive new tests for SSE streaming, tool-call-only turns, tool loop continuation, and prompt/tool separation. |
| spx-gui/src/components/copilot/CopilotRound.vue | Avoids rendering null copilot text content. |
| spx-gui/src/components/copilot/CopilotRoot.vue | Stops registering the legacy tool-use custom element. |
| spx-gui/src/apis/copilot.ts | Introduces structured message/tool-call types and SSE message generation API. |
| spx-gui/src/apis/copilot.test.ts | Tests SSE streaming termination behavior and tool payload forwarding. |
| spx-gui/src/apis/common/client.ts | Adds postJSONSSE helper for JSON-SSE POST requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
close #2901.
Related API spec update: #2922