Skip to content

feat(v0.7.4): C1 auth bypass fix, Forge/TokenRouter/Qwen/Alibaba/hcns…#5

Merged
rsalmn merged 1 commit into
mainfrom
v0.7.4
Jul 21, 2026
Merged

feat(v0.7.4): C1 auth bypass fix, Forge/TokenRouter/Qwen/Alibaba/hcns…#5
rsalmn merged 1 commit into
mainfrom
v0.7.4

Conversation

@rsalmn

@rsalmn rsalmn commented Jul 21, 2026

Copy link
Copy Markdown
Owner

…ec providers, GitHub Copilot /v1/messages, opencode effort tiers, xAI quota handler, ModelAccessModal crash fix

Features:

  • New providers: Forge Workspace (33 models, 3 tiers), TokenRouter (with management key + Quota Tracker), Huancheng (hcnsec), Qwen Cloud + Qwen Cloud Token Plan, Alibaba + Alibaba CN
  • GitHub Copilot native /v1/messages routing for Claude models (targetFormat:claude, anthropic-version header)
  • GitHub Copilot model catalog synced to OmniRoute fea1d54 (20 models)
  • opencode-go effort-tier aliases (9 models) + EFFORT_TIERS table (port of OmniRoute 1843b34)
  • Qwen3.8 Max Preview on Qwen Web (Subscription) with REQUIRED_THINKING_MODELS

Fixes:

  • C1 Critical: dashboardGuard method-based auth routing (mutations always require JWT/CLI token even when requireLogin=false)
  • Cline/GLM 500 stream_options (inject stream_options on streaming requests)
  • HuggingChat HTML 200 (DEFAULT_MODEL omni + preprompt + native fetch)
  • xAI Quota Tracker empty card (billing API removed; show informative message)
  • ModelAccessModal crash (Cannot read properties of null (reading 'length'))
  • TokenRouter quota null plan crash
  • Playground value/key/object Object crashes (3 separate fixes)

Improvements:

  • SanitizeHtml utility + unit tests
  • Playground MessageContent markdown renderer
  • AddApiKeyModal TokenRouter management key field
  • 8 new provider SVG icons

Bumps package.json + cli/package.json to 0.7.4

Summary by CodeRabbit

  • New Features
    • Added support for Forge Workspace, TokenRouter, Qwen Cloud, Alibaba, and Huancheng providers.
    • Added TokenRouter quota tracking and optional management-key configuration.
    • Expanded model catalogs, including Qwen, GitHub Copilot, and effort-tier model options.
  • Bug Fixes
    • Improved authentication protection for write actions.
    • Fixed streaming errors, model routing, quota display crashes, and provider request handling.
  • Improvements
    • Strengthened HTML sanitization and link safety.
    • Updated provider icons and Playground rendering.
  • Chores
    • Released version 0.7.4.

…ec providers, GitHub Copilot /v1/messages, opencode effort tiers, xAI quota handler, ModelAccessModal crash fix

Features:
- New providers: Forge Workspace (33 models, 3 tiers), TokenRouter (with
  management key + Quota Tracker), Huancheng (hcnsec), Qwen Cloud + Qwen Cloud
  Token Plan, Alibaba + Alibaba CN
- GitHub Copilot native /v1/messages routing for Claude models
  (targetFormat:claude, anthropic-version header)
- GitHub Copilot model catalog synced to OmniRoute fea1d54 (20 models)
- opencode-go effort-tier aliases (9 models) + EFFORT_TIERS table
  (port of OmniRoute 1843b34)
- Qwen3.8 Max Preview on Qwen Web (Subscription) with REQUIRED_THINKING_MODELS

Fixes:
- C1 Critical: dashboardGuard method-based auth routing (mutations always
  require JWT/CLI token even when requireLogin=false)
- Cline/GLM 500 stream_options (inject stream_options on streaming requests)
- HuggingChat HTML 200 (DEFAULT_MODEL omni + preprompt + native fetch)
- xAI Quota Tracker empty card (billing API removed; show informative message)
- ModelAccessModal crash (Cannot read properties of null (reading 'length'))
- TokenRouter quota null plan crash
- Playground value/key/object Object crashes (3 separate fixes)

Improvements:
- SanitizeHtml utility + unit tests
- Playground MessageContent markdown renderer
- AddApiKeyModal TokenRouter management key field
- 8 new provider SVG icons

Bumps package.json + cli/package.json to 0.7.4
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Version 0.7.4 adds Forge, TokenRouter, Alibaba, Qwen Cloud, and Huancheng providers; updates GitHub, HuggingChat, OpenCode, and Qwen execution; adds TokenRouter quota tracking; hardens API mutations and HTML sanitization; fixes dashboard state handling; and updates release metadata.

Changes

Provider catalogs and capability metadata

Layer / File(s) Summary
Provider catalogs and registry wiring
open-sse/providers/registry/*, open-sse/providers/registry/index.js
Adds Forge, TokenRouter, Qwen Cloud, Alibaba, and Huancheng providers, expands GitHub, HuggingChat, Qwen Web, and OpenCode catalogs, and registers provider icons.
Capability and pricing metadata
open-sse/providers/capabilities.js, open-sse/providers/pricing.js
Adds MAI-Code capabilities and Forge model pricing.
Executor routing and request transformations
open-sse/executors/base.js, open-sse/executors/github.js, open-sse/executors/huggingchat.js, open-sse/executors/opencode-go.js
Adds Claude-native GitHub routing, native HuggingChat fetches, and OpenCode effort-tier aliases.
Qwen streaming and thinking behavior
open-sse/executors/qwen-web.js
Adds required thinking models, parses new SSE envelopes, and propagates upstream errors in streaming and non-streaming responses.
TokenRouter quota flow
open-sse/services/usage.js, open-sse/services/usage/tokenrouter.js, src/app/.../AddApiKeyModal.js, src/app/.../ProviderLimits/*
Collects TokenRouter wallet balances with a management key and renders normalized quota rows.
Security and dashboard stability
src/dashboardGuard.js, src/app/.../EndpointPageClient.js
Requires authentication for API mutations and stabilizes model-access and quota state handling.
HTML sanitization and validation
src/shared/utils/sanitizeHtml.js, tests/unit/sanitize-html.test.js, package.json
Replaces regex sanitization with DOMPurify and adds adversarial checks with DOM test support.
Release metadata and xAI usage behavior
CHANGELOG.md, cli/package.json, package.json, open-sse/services/usage/xai.js
Publishes version 0.7.4, records the release changes, and replaces xAI billing scraping with informational responses.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant GitHubExecutor
  participant GitHubCopilot
  Client->>GitHubExecutor: send Claude-targeted model request
  GitHubExecutor->>GitHubCopilot: route to messagesUrl with anthropic-version
  GitHubExecutor->>GitHubCopilot: preserve Claude-native request body
  GitHubCopilot-->>Client: return model response
Loading
sequenceDiagram
  participant Dashboard
  participant UsageService
  participant TokenRouter
  participant QuotaView
  Dashboard->>UsageService: submit TokenRouter credentials
  UsageService->>TokenRouter: fetch wallet usage with management key
  TokenRouter-->>UsageService: return wallet balances
  UsageService->>QuotaView: normalize quota rows
  QuotaView-->>Dashboard: display wallet, top-up, and voucher quotas
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: the v0.7.4 release, the auth bypass fix, and new provider additions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v0.7.4

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/unit/sanitize-html.test.js (1)

41-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

process.exit() inside a test file risks killing the shared vitest worker.

This file is designed to double as a standalone script and a vitest test, but calling process.exit(0/1) directly (rather than throwing/expect()-failing) can abort the whole worker process mid-suite when run under vitest, potentially masking or truncating results from other tests sharing that worker.

Consider wrapping the cases in real it.each/expect assertions when sanitizeHtml is available, and reserving the manual console.log/process.exit path only for the standalone-script fallback.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/sanitize-html.test.js` around lines 41 - 90, Update the test flow
around the cases loop so vitest execution uses real it.each/expect assertions
when sanitizeHtml is available, allowing failures to be reported through the
test framework instead of process.exit. Keep the existing console.log and
process.exit behavior only in the standalone-script fallback, and ensure the
standalone mode still reports all case results.
open-sse/services/usage/xai.js (1)

30-38: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

void U; doesn't actually verify anything.

The comment says this "confirms the provider config still exists," but void U only references the imported function object — it never calls U('xai'), so no config lookup happens. It's a no-op that satisfies "unused import" concerns without doing what the comment claims. Either call U('xai') to genuinely validate the provider is registered, or drop the import/comment until it's actually needed.

♻️ Suggested tweak
-  // Sanity reference — confirms the provider config still exists. Intentionally
-  // unused for network calls while the handler is in the informational state.
-  void U;
+  // Sanity check — confirms the provider config is still registered.
+  void U("xai");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@open-sse/services/usage/xai.js` around lines 30 - 38, Remove the unused U
import and its misleading “Sanity reference” comment from getXaiUsage, since the
current void U statement performs no configuration lookup and the handler does
not need this validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@open-sse/providers/registry/github.js`:
- Around line 69-73: Update GithubExecutor.buildUrl() to select responsesUrl
whenever the resolved model’s targetFormat is "openai-responses", while
preserving the existing Claude routing and baseUrl behavior for other formats.
Ensure the GPT entries in the model registry are routed to the Responses
endpoint without changing their metadata.

In `@open-sse/providers/registry/hcnsec.js`:
- Around line 39-45: Update the provider configuration near modelsFetcher to
expose a selectable fallback when discovery fails or returns no models: seed
models with a verified HCNSEC model, or add the repository’s established
free-form/discovery-failure option. Preserve passthroughModels behavior while
ensuring the model picker has at least one usable choice without successful
discovery.

---

Nitpick comments:
In `@open-sse/services/usage/xai.js`:
- Around line 30-38: Remove the unused U import and its misleading “Sanity
reference” comment from getXaiUsage, since the current void U statement performs
no configuration lookup and the handler does not need this validation.

In `@tests/unit/sanitize-html.test.js`:
- Around line 41-90: Update the test flow around the cases loop so vitest
execution uses real it.each/expect assertions when sanitizeHtml is available,
allowing failures to be reported through the test framework instead of
process.exit. Keep the existing console.log and process.exit behavior only in
the standalone-script fallback, and ensure the standalone mode still reports all
case results.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e309bb44-3d9a-4ff8-963b-81ded7c0425f

📥 Commits

Reviewing files that changed from the base of the PR and between 31d220c and 9aa0c0e.

⛔ Files ignored due to path filters (7)
  • public/providers/alibaba-cn.svg is excluded by !**/*.svg
  • public/providers/alibaba.svg is excluded by !**/*.svg
  • public/providers/forge.svg is excluded by !**/*.svg
  • public/providers/hcnsec.svg is excluded by !**/*.svg
  • public/providers/qwen-cloud-token-plan.svg is excluded by !**/*.svg
  • public/providers/qwen-cloud.svg is excluded by !**/*.svg
  • public/providers/tokenrouter.svg is excluded by !**/*.svg
📒 Files selected for processing (34)
  • CHANGELOG.md
  • cli/package.json
  • open-sse/executors/base.js
  • open-sse/executors/github.js
  • open-sse/executors/huggingchat.js
  • open-sse/executors/opencode-go.js
  • open-sse/executors/qwen-web.js
  • open-sse/providers/capabilities.js
  • open-sse/providers/pricing.js
  • open-sse/providers/registry/alibaba-cn.js
  • open-sse/providers/registry/alibaba.js
  • open-sse/providers/registry/forge.js
  • open-sse/providers/registry/github.js
  • open-sse/providers/registry/hcnsec.js
  • open-sse/providers/registry/huggingchat.js
  • open-sse/providers/registry/index.js
  • open-sse/providers/registry/opencode-go.js
  • open-sse/providers/registry/qwen-cloud-token-plan.js
  • open-sse/providers/registry/qwen-cloud.js
  • open-sse/providers/registry/qwen-web.js
  • open-sse/providers/registry/tokenrouter.js
  • open-sse/providers/registry/xai.js
  • open-sse/services/usage.js
  • open-sse/services/usage/tokenrouter.js
  • open-sse/services/usage/xai.js
  • package.json
  • src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js
  • src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js
  • src/app/(dashboard)/dashboard/quota/components/ProviderLimits/index.js
  • src/app/(dashboard)/dashboard/quota/components/ProviderLimits/utils.js
  • src/dashboardGuard.js
  • src/shared/utils/providerIcon.js
  • src/shared/utils/sanitizeHtml.js
  • tests/unit/sanitize-html.test.js

Comment on lines +69 to +73
{ id: "gpt-5.5", name: "GPT-5.5", targetFormat: "openai-responses", contextWindow: 1050000, maxOutput: 128000 },
{ id: "gpt-5.4", name: "GPT-5.4", targetFormat: "openai-responses", contextWindow: 1050000, maxOutput: 128000 },
{ id: "gpt-5.4-mini", name: "GPT-5.4 Mini", targetFormat: "openai-responses", contextWindow: 400000, maxOutput: 128000 },
{ id: "gpt-5.3-codex", name: "GPT-5.3 Codex", targetFormat: "openai-responses", contextWindow: 400000, maxOutput: 128000 },
{ id: "gpt-5-mini", name: "GPT-5 Mini", targetFormat: "openai-responses", contextWindow: 264000, maxOutput: 64000 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Route Responses-format models to responsesUrl.

targetFormat: "openai-responses" changes the request shape, but GithubExecutor.buildUrl() only special-cases Claude and otherwise returns baseUrl (/chat/completions). These GPT requests will send a Responses payload to the chat-completions endpoint. Select responsesUrl when the model target format is openai-responses.

Proposed executor update
 if (getModelTargetFormat("gh", model) === "claude" && this.config.messagesUrl) {
   return this.config.messagesUrl;
 }
+if (getModelTargetFormat("gh", model) === "openai-responses" && this.config.responsesUrl) {
+  return this.config.responsesUrl;
+}
 return this.config.baseUrl;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@open-sse/providers/registry/github.js` around lines 69 - 73, Update
GithubExecutor.buildUrl() to select responsesUrl whenever the resolved model’s
targetFormat is "openai-responses", while preserving the existing Claude routing
and baseUrl behavior for other formats. Ensure the GPT entries in the model
registry are routed to the Responses endpoint without changing their metadata.

Comment on lines +39 to +45
// Live discovery only — /v1/models exposes whatever the key has access to.
// Empty seed catalog; passthroughModels allows any model id.
models: [],
passthroughModels: true,
modelsFetcher: {
url: "https://api.hcnsec.cn/v1/models",
type: "openai",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Provide a selectable fallback model when discovery is unavailable.

models: [] leaves this provider with no default model option if /v1/models fails or returns no data. passthroughModels bypasses validation, but the model picker still builds options from registered aliases and custom models. Seed a verified fallback model or provide an explicit free-form/discovery-failure path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@open-sse/providers/registry/hcnsec.js` around lines 39 - 45, Update the
provider configuration near modelsFetcher to expose a selectable fallback when
discovery fails or returns no models: seed models with a verified HCNSEC model,
or add the repository’s established free-form/discovery-failure option. Preserve
passthroughModels behavior while ensuring the model picker has at least one
usable choice without successful discovery.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Request timed out after 1200000ms (requestId=b9c20bd4-a38c-48dd-8059-b3125a554168)

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 2 unresolved review comments.

A stacked PR containing fixes has been created.

  • Stacked PR: #6
  • Files modified:
  • open-sse/executors/github.js
  • open-sse/providers/registry/hcnsec.js

Time taken: 10m 33s

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Request timed out after 1200000ms (requestId=9b955847-103f-48c0-8a94-d03873468345)

@rsalmn
rsalmn merged commit 178d867 into main Jul 21, 2026
4 checks passed
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 2 unresolved review comments.

A stacked PR containing fixes has been created.

  • Stacked PR: #7
  • Files modified:
  • open-sse/executors/github.js
  • open-sse/providers/registry/hcnsec.js

Time taken: 11m 57s

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 2 unresolved review comments.

Files modified:

  • open-sse/executors/github.js
  • open-sse/providers/registry/hcnsec.js

Commit: 404bd14b456fabcdd022eaa447d5b23f91720668

The changes have been pushed to the v0.7.4 branch.

Time taken: 8m 58s

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.

1 participant