chore: remove legacy copilot message endpoints#2957
chore: remove legacy copilot message endpoints#2957nighca wants to merge 2 commits 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 focuses on modernizing the Copilot integration by deprecating and removing older API endpoints and simplifying the client-side interaction. The changes consolidate message generation to a single, structured Server-Sent Events (SSE) endpoint, reducing complexity and improving maintainability of the Copilot feature. 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
|
There was a problem hiding this comment.
Code Review
This pull request streamlines the Copilot API by removing the non-streaming /copilot/message and legacy /copilot/stream/message endpoints from the OpenAPI specification and client-side code. The CopilotScope type and generateMessage function are also removed. The generateSSEMessage function is updated to no longer require a scope parameter, hardcoding it to 'standard' for the /copilot/sse/message endpoint. Additionally, the /workflow/stream/message endpoint's response content type in the OpenAPI documentation is updated from application/stream to text/plain.
There was a problem hiding this comment.
Pull request overview
Removes legacy Copilot message endpoints from the documented/public API surface and simplifies the spx-gui Copilot API wrapper to only use the structured SSE endpoint.
Changes:
- Remove
/copilot/messageand/copilot/stream/messagefromdocs/openapi.yaml(and remove rollout language referencing the legacy stream endpoint). - Update the frontend Copilot message generation call path to use
generateSSEMessage(messages, options)(scope no longer passed by callers). - Update unit tests to match the updated
generateSSEMessagesignature and option type.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spx-gui/src/components/copilot/copilot.ts | Updates Copilot round generation to call generateSSEMessage without a scope argument. |
| spx-gui/src/components/copilot/copilot.test.ts | Updates mock generator signatures to match the new generateSSEMessage API. |
| spx-gui/src/apis/copilot.ts | Removes legacy scope/type + legacy non-SSE API, and hardcodes SSE requests to /copilot/sse/message. |
| spx-gui/src/apis/copilot.test.ts | Updates tests to call generateSSEMessage([]) and validate the request payload. |
| docs/openapi.yaml | Removes legacy Copilot endpoints from the spec and updates related descriptions; also adjusts workflow stream response content type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Clean, well-scoped removal. No dangling references to |
| "403": | ||
| description: Insufficient permissions to perform this operation. | ||
|
|
||
| /copilot/message: |
There was a problem hiding this comment.
这个接口其实早就用不到了,只是之前一直没删
Summary
/copilot/sse/messageonlyscopedetail insidegenerateSSEMessageso callers only pass messages and optionsTesting
Closes #2928