Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Oct 17, 2025

Related GitHub Issue

Closes: #8687

Description

Limit Z AI provider to the two official coding endpoints:

Changes:

  • Schema restricted to coding-only options.
  • Provider config keeps only the two coding endpoints with proper labels/URLs.
  • Settings UI lists only these two choices; defaults to International.

Note: No migration is applied. Legacy non-coding values are not recognized (they do not work anyway). Users should select one of the coding endpoints.

Test Procedure

  • npx vitest run src/api/providers/tests/zai.spec.ts
  • npx vitest run src/core/config/tests/ProviderSettingsManager.spec.ts
  • Full suite: cd src && npx vitest run (all passing)

Checklist

  • Linked issue
  • Scope limited to linked issue
  • Tests updated/passing
  • No docs updates required

Additional Notes

Removed prior migration approach per maintainer feedback.


Important

Restrict Z AI provider to two coding endpoints, update configurations, tests, and UI to reflect this change.

  • Behavior:
    • Restrict Z AI provider to "international_coding" and "china_coding" endpoints in provider-settings.ts and zai.ts.
    • Update zaiApiLineSchema to only include "international_coding" and "china_coding".
    • Default to "international_coding" if no endpoint is specified.
  • Tests:
    • Update tests in zai.spec.ts to reflect new endpoint restrictions.
    • Ensure tests check for correct URL and API key usage for both endpoints.
  • UI:
    • Update ApiOptions.tsx to list only the two coding endpoints.
    • Adjust useSelectedModel.ts to handle model selection based on the new endpoint restrictions.

This description was created by Ellipsis for 94f6abe. You can customize this summary. It will automatically update as commits are pushed.

Copilot AI review requested due to automatic review settings October 17, 2025 01:34
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 17, 2025
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

This PR simplifies the Z AI provider configuration by restricting it to only two official coding endpoints as recommended by the vendor, removing the non-coding variants that were previously available.

  • Removes non-coding endpoint options ("international", "china") and keeps only coding variants
  • Implements automatic migration from legacy values to new coding-only options
  • Updates all references throughout the codebase to use the new coding endpoint identifiers

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/types/src/provider-settings.ts Restricts Z AI API line schema to only coding endpoints
packages/types/src/providers/zai.ts Removes non-coding endpoint configurations
src/core/config/ProviderSettingsManager.ts Adds migration logic for legacy endpoint values
webview-ui/src/components/ui/hooks/useSelectedModel.ts Updates China region check to use new coding endpoint identifier
webview-ui/src/components/settings/ApiOptions.tsx Updates default model selection logic for new endpoint identifier
src/api/providers/tests/zai.spec.ts Updates all test cases to use new coding endpoint identifiers and URLs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@roomote
Copy link
Contributor

roomote bot commented Oct 17, 2025

Code Review Complete ✅

I've completed a thorough review of this PR and found no issues to report.

What Was Reviewed (Latest Changes)

  • ✅ Migration logic cleanly removed per maintainer feedback
  • ✅ Schema properly restricts Z AI entrypoint enum to coding-only options (international_coding, china_coding)
  • ✅ UI components correctly updated to use new endpoint values
  • ✅ Tests comprehensively updated across all affected files
  • ✅ Default fallback behavior is correct (international_coding)
  • ✅ Type safety maintained throughout
  • ✅ No broken references or orphaned code from migration removal

Summary

The implementation successfully restricts Z AI to the two official coding endpoints. The migration logic has been removed as requested, meaning legacy non-coding values will not be recognized (users will need to select one of the two coding endpoints).

No action items identified. The PR is ready for merge.

@dosubot dosubot bot added the Enhancement New feature or request label Oct 17, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Review] in Roo Code Roadmap Oct 17, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 17, 2025
@mrubens mrubens merged commit 0e7a878 into main Oct 17, 2025
15 checks passed
@mrubens mrubens deleted the feat/issue-8687-zai-coding-endpoints branch October 17, 2025 04:33
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 17, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Oct 17, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Oct 17, 2025
* Make Posthog telemetry the default (RooCodeInc#7909)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Fix: Preserve first message during conversation condensing (RooCodeInc#7910)

* In-app announcement for Roo Code Cloud (RooCodeInc#7914)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* chore: add changeset for v3.28.1 (RooCodeInc#7916)

* Changeset version bump (RooCodeInc#7917)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>

* Remove Roo Code 3.25 release announcement

Removed the section about Roo Code 3.25 release notes.

* fix: restrict @-mention parsing to line-start or whitespace boundaries (RooCodeInc#7876)

Co-authored-by: Roo Code <[email protected]>

* Fix message queue re-queue loop in Task.ask() (RooCodeInc#7823)

* fix: preserve original first message context during conversation condensing (RooCodeInc#7939)

* Add a little padding to the cloudview (RooCodeInc#7954)

* test: increase test timeout configuration

* test(ci): enable translation check and optimize test workflow

* fix: make nested git repository warning persistent with path info (RooCodeInc#7885)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* fix: include API key in Ollama /api/tags requests (RooCodeInc#7903)

Co-authored-by: Roo Code <[email protected]>

* feat: add Qwen3 Next 80B A3B models to chutes provider (RooCodeInc#7948)

* ux: Smaller and more subtle auto-approve UI (RooCodeInc#7894)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Hannes Rudolph <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: Bruno Bergher <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: ItsOnlyBinary <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>
Co-authored-by: John Richmond <[email protected]>

* Disable Roomote Control on logout (RooCodeInc#7976)

* Remove chevrons from chat buttons (RooCodeInc#7970)

* chore: add changeset for v3.28.2 (RooCodeInc#7979)

* Changeset version bump (RooCodeInc#7980)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>

* ux: Makes text area buttons appear only when there's text (RooCodeInc#7987)

* fix: corrected C# tree-sitter query (RooCodeInc#7813)

* feat: Move slash commands to Settings tab with gear icon for discoverability (RooCodeInc#7988)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Bruno Bergher <[email protected]>
Co-authored-by: Mubeen Zulfiqar <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>

* Add Z.ai coding plan support (RooCodeInc#8003)

* chore(deps): bump axios from 1.9.0 to 1.12.0 (RooCodeInc#7963)

Bumps [axios](https://github.com/axios/axios) from 1.9.0 to 1.12.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.9.0...v1.12.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.12.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix context menu is obscured when edit message. (RooCodeInc#7951)

* feat: add keyboard shortcut for "Add to Context" action (RooCodeInc#7908)

Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>

* fix: handle ByteString conversion errors in OpenAI embedders (RooCodeInc#8008)

* CONTRIBUTING.md tweaks and issue template rewrite (RooCodeInc#8014)

* feat: Reposition Add Image button inside ChatTextArea (RooCodeInc#7989)

* feat: move Add Image button inside ChatTextArea

- Moved Add Image button from bottom toolbar to top-right inside text area
- Repositioned Enhance Prompt button to be above Send button (bottom-right)
- Both buttons now follow similar positioning pattern as Send button
- Maintains consistent button styling and transitions

* fix: corrected C# tree-sitter query (RooCodeInc#7813)

* feat: Move slash commands to Settings tab with gear icon for discoverability (RooCodeInc#7988)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Bruno Bergher <[email protected]>
Co-authored-by: Mubeen Zulfiqar <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>

* Add Z.ai coding plan support (RooCodeInc#8003)

* chore(deps): bump axios from 1.9.0 to 1.12.0 (RooCodeInc#7963)

Bumps [axios](https://github.com/axios/axios) from 1.9.0 to 1.12.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.9.0...v1.12.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.12.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix context menu is obscured when edit message. (RooCodeInc#7951)

* feat: add keyboard shortcut for "Add to Context" action (RooCodeInc#7908)

Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: Matt Rubens <mruben