[TASK-tsk_067be9f1e5f5fc18b1f6dd92][Frontend] feat: Provider选择默认选中Markus + subscription key展示#219
Closed
jsyqrt wants to merge 8 commits into
Closed
[TASK-tsk_067be9f1e5f5fc18b1f6dd92][Frontend] feat: Provider选择默认选中Markus + subscription key展示#219jsyqrt wants to merge 8 commits into
jsyqrt wants to merge 8 commits into
Conversation
… skeleton - Create packages/cloudflare-worker/ with wrangler.toml + tsconfig + package.json - Implement 5 middleware: CORS, auth, logging, rate-limit, timeout - Implement 2 routes: /health (GET) and /v1/chat/completions (POST stub) - Error utilities (errors.ts) and HTTP response helpers (response.ts) - Composable middleware chain with Env + Context request passing
… — real auth and LLM forwarding - Hub: POST /api/auth/token JWT endpoint with plan-based claims - Hub: JWT verify + refresh support - Worker: JWT verify (jose) middleware replacing auth stub - Worker: auth context extraction (userId/planType/quota) - Worker: Chat proxy route with upstream URL building + CU quota checks - Test: 19 tests across 3 files (jwt-verify, auth-context, chat route)
实现 CF Worker Proxy 双模式路由集成: 1. CUCache — 按 task type + model 的 CU 用量缓存模块 2. ProxyProvider — 通过 CF Worker Proxy 转发 LLM 请求的 Provider 类 3. LLMRouter 路由集成 — enableProxyMode/disableProxyMode 双模式切换 4. chat() 方法自动判断模式:Proxy 模式走 CF Worker,直连模式走原生 Provider 核心改动: - packages/core/src/llm/cu-cache.ts (new) — CU 用量缓存 - packages/core/src/llm/proxy-provider.ts (new) — Proxy 转发 Provider - packages/core/src/llm/router.ts — 双模式路由集成 - packages/core/src/llm/types.ts — 类型导出更新
… — CU_EXCEEDED, emitLog, auth degrade, retry+degrade, comprehensive proxy test
…quota, AbortController for streaming - Issue 1: Changed 403→429 for QUOTA_EXCEEDED and INSUFFICIENT_QUOTA - Issue 2: Added AbortController + DEFAULT_TIMEOUT_MS to streaming fetch path (catch AbortError as UPSTREAM_TIMEOUT 504, other errors as UPSTREAM_UNREACHABLE 502) - Non-blocking suggestions kept for future rounds
…525317e [TASK-tsk_5319d992235c56638525317e][Backend Developer] feat: JWT auth + Chat proxy route — real auth and LLM forwarding
…0b9957f [TASK-tsk_c69d3a9ecea19bdf30b9957f][Backend Developer] feat: LLM Router 双模式集成 + CU 用量缓存
…kus + subscription key展示 - Added 'markus' to PROVIDER_OPTIONS (no envKey needed - system auto-generates subscription_key) - Subscription key display: read-only input with copy button, shown when Markus provider is configured - Added keyReadOnly i18n translation for en/zh-CN
Contributor
Author
❌ Code Review — Revision RequiredReviewer: Code Reviewer (ID: agt_42fc22d8cd79900a089eea09) Verification Results
Decision⛔ Revision Required — 3 blocking issues Issues
Fix Required
|
Contributor
Author
|
Closing this PR. Replaced by a clean PR targeting feature/token-billing with only the 4 required web-ui files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 基本信息
🎯 背景与动机 (Why)
Desktop UI的Provider选择中需要默认选中「Markus」,并且在Markus Provider卡片中展示系统自动生成的subscription key(格式:markus_<48hex>)。
🔧 变更内容 (What)
✅ 验证方式 (How to Verify)
👤 评审人