Skip to content

chore: remove legacy copilot message endpoints#2957

Open
nighca wants to merge 2 commits intogoplus:devfrom
nighca:issue-2928
Open

chore: remove legacy copilot message endpoints#2957
nighca wants to merge 2 commits intogoplus:devfrom
nighca:issue-2928

Conversation

@nighca
Copy link
Collaborator

@nighca nighca commented Mar 17, 2026

Summary

  • remove the legacy Copilot message endpoints from the public OpenAPI spec
  • simplify the frontend Copilot API to use /copilot/sse/message only
  • hide the scope detail inside generateSSEMessage so callers only pass messages and options

Testing

  • npx vitest --run src/apis/copilot.test.ts src/components/copilot/copilot.test.ts

Closes #2928

Copilot AI review requested due to automatic review settings March 17, 2026 07:22
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • API Endpoint Removal: Removed the legacy /copilot/message and /copilot/stream/message endpoints from the public OpenAPI specification, streamlining the Copilot API surface.
  • Frontend API Simplification: Simplified the frontend Copilot API by removing the scope parameter from the generateSSEMessage function, now exclusively using /copilot/sse/message with a hardcoded 'standard' scope internally.
  • Codebase Cleanup: Updated related test files and the main Copilot component to reflect the simplified generateSSEMessage signature, ensuring consistency and removing deprecated code.

🧠 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
  • docs/openapi.yaml
    • Removed the definition for the /copilot/message POST endpoint.
    • Removed the definition for the /copilot/stream/message POST endpoint.
    • Updated the description for /copilot/sse/message to remove references to legacy endpoints.
    • Modified the content type for /workflow/stream/message's 201 response from application/stream to text/plain with a string schema.
  • spx-gui/src/apis/copilot.test.ts
    • Updated calls to generateSSEMessage to remove the scope argument in various test cases.
  • spx-gui/src/apis/copilot.ts
    • Removed the CopilotScope type definition.
    • Removed the generateMessage function.
    • Modified the generateSSEMessage function signature to remove the scope parameter and hardcoded 'standard' scope in the internal API call.
  • spx-gui/src/components/copilot/copilot.test.ts
    • Updated generateSSEMessage method signatures in MockMessageEventGenerator, MockSingleBatchMessageEventGenerator, and MockBatchedMessageEventGenerator to remove the scope parameter.
  • spx-gui/src/components/copilot/copilot.ts
    • Updated the call to this.copilot.generator.generateSSEMessage to remove the scope argument.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/message and /copilot/stream/message from docs/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 generateSSEMessage signature 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.

@xgopilot
Copy link
Contributor

xgopilot bot commented Mar 17, 2026

Clean, well-scoped removal. No dangling references to CopilotScope or generateMessage remain in the codebase, and all three mock classes in copilot.test.ts are updated consistently with the correct GenerateSSEMessageOptions type. Two minor nits: the hardcoded 'standard' scope string loses its type guard, and the /workflow/stream/message content-type fix should be verified against the actual response format.

"403":
description: Insufficient permissions to perform this operation.

/copilot/message:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个接口其实早就用不到了,只是之前一直没删

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot: remove legacy /copilot/stream/message after SSE rollout

2 participants