From e5f7e73a185108c043bef60e7847ea05d8148fda Mon Sep 17 00:00:00 2001 From: ThreeFish Date: Sun, 6 Dec 2026 00:24:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?docs(README):=20=E6=9E=B6=E6=9E=84=E5=85=A8?= =?UTF-8?q?=E6=99=AF=E5=9B=BE=E7=94=B1=20mermaid=20=E6=8D=A2=E4=B8=BA=20Ar?= =?UTF-8?q?chify=20=E5=9B=BE=EF=BC=88docs/diagrams/routing-n-tier/?= =?UTF-8?q?=EF=BC=89;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang --- README.md | 51 +- .../routing-n-tier/routing-n-tier.html | 13781 ++++++++++++++++ .../routing-n-tier/routing-n-tier.json | 46 + .../routing-n-tier/routing-n-tier.svg | 638 + .../routing-n-tier.visual-check.json | 962 ++ 5 files changed, 15428 insertions(+), 50 deletions(-) create mode 100644 docs/diagrams/routing-n-tier/routing-n-tier.html create mode 100644 docs/diagrams/routing-n-tier/routing-n-tier.json create mode 100644 docs/diagrams/routing-n-tier/routing-n-tier.svg create mode 100644 docs/diagrams/routing-n-tier/routing-n-tier.visual-check.json diff --git a/README.md b/README.md index 57ec849..819e604 100644 --- a/README.md +++ b/README.md @@ -132,56 +132,7 @@ Open `http://127.0.0.1:3392/dashboard` for real-time token spend, latency and ci When a request inevitably hits the fan, the `RequestRouter` slides gracefully down the N-tier tree, juggling circuit breakers and token quotas to decide the ultimate destination: -```mermaid -graph RL - %% 样式定义 (支持明暗双色模式的高对比色彩) - classDef client fill:#1E3A8A,stroke:#60A5FA,stroke-width:2px,color:#EFF6FF,rx:8,ry:8 - classDef router fill:#4C1D95,stroke:#A78BFA,stroke-width:2px,color:#F5F3FF,rx:8,ry:8 - classDef gateway fill:#7C2D12,stroke:#FB923C,stroke-width:2px,color:#FFF7ED - classDef api fill:#14532D,stroke:#4ADE80,stroke-width:2px,color:#F0FDF4 - classDef fallback fill:#27272A,stroke:#A1A1AA,stroke-width:2px,color:#F4F4F5 - - Client["💻
Client (Claude Code)"]:::client - - subgraph CodingProxy["coding-proxy"] - direction RL - - Router["RequestRouter
routing/router.py"]:::router - - Router -->NTier - - subgraph NTier["N-tier"] - direction TB - - subgraph Tier0 ["Tier 0: Zhipu"] - direction RL - G0{"CB / Quota"}:::gateway -- "✅ Pass" --> API0(("GLM API")):::api - end - - subgraph Tier1 ["Tier 1: Anthropic"] - direction RL - G1{"CB / Quota"}:::gateway -- "✅ Pass" --> API1(("Anthropic API")):::api - end - - subgraph Tier2 ["Tier 2: GitHub Copilot"] - direction RL - G2{"CB / Quota"}:::gateway -- "✅ Pass" --> API2(("Copilot API")):::api - end - - subgraph Tier3 ["Tier 3: Google Antigravity"] - direction RL - API3(("Gemini API")):::fallback - end - - Tier0 -. "❌ Blocked / API Error" .-> Tier1 - Tier1 -. "❌ Blocked / API Error" .-> Tier2 - Tier2 -. "🆘 Safety Net Downgrade" .-> Tier3 - end - - end - - Client -->|"POST /v1/messages"| CodingProxy -``` +![N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor](docs/diagrams/routing-n-tier/routing-n-tier.svg) *For a deep dive into the architecture and under-the-hood wizardry, consult [framework.md](./docs/framework.md) (Currently in Chinese).* diff --git a/docs/diagrams/routing-n-tier/routing-n-tier.html b/docs/diagrams/routing-n-tier/routing-n-tier.html new file mode 100644 index 0000000..49f6a76 --- /dev/null +++ b/docs/diagrams/routing-n-tier/routing-n-tier.html @@ -0,0 +1,13781 @@ + + + + + + + + N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor + + + + + + + + +
+ +
+
+
+

N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor

+
+
+ + + + +
+ + N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor + 由 Archify 生成的架构图。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Client (Claude Code) · Anthropic 协议客户端 · 架构组件 + + + + Client (Claude Code) + Anthropic 协议客户端 + + + + RequestRouter · routing/router.py · coding-proxy 进程内 + + + + RequestRouter + routing/router.py + + + + CB / Quota · Tier 0 · Zhipu · coding-proxy 进程内 + + + + CB / Quota + Tier 0 · Zhipu + + + + CB / Quota · Tier 1 · Anthropic · coding-proxy 进程内 + + + + CB / Quota + Tier 1 · Anthropic + + + + CB / Quota · Tier 2 · GitHub Copilot · coding-proxy 进程内 + + + + CB / Quota + Tier 2 · GitHub Copilot + + + + GLM API · Zhipu · 架构组件 + + + + GLM API + Zhipu + + + + Anthropic API · 官方端点 · 架构组件 + + + + Anthropic API + 官方端点 + + + + Copilot API · GitHub · 架构组件 + + + + Copilot API + GitHub + + + + Gemini API · Tier 3 · Google Antigravity · 架构组件 · 无门控 · 兜底 + + + + Gemini API + Tier 3 · Google Antigravity + 无门控 · 兜底 + + + + + + POST /v1/messages + + + + + + + ✅ Pass + + + + ✅ Pass + + + + ✅ Pass + + + + ❌ Blocked / API Error + + + + ❌ Blocked / API Error + + + + 🆘 Safety Net Downgrade + + + + + + coding-proxy 进程内 + + + + + 图例 + + + 后端 + + + + 云服务 + + + + 安全 + + + + 外部系统 + + + +

+ + + + + + + + + +
+ + + +
+ + + + diff --git a/docs/diagrams/routing-n-tier/routing-n-tier.json b/docs/diagrams/routing-n-tier/routing-n-tier.json new file mode 100644 index 0000000..aec4a64 --- /dev/null +++ b/docs/diagrams/routing-n-tier/routing-n-tier.json @@ -0,0 +1,46 @@ +{ + "schema_version": 1, + "diagram_type": "architecture", + "meta": { + "title": "N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor", + "locale": "zh-CN", + "output": "routing-n-tier.html", + "quality_profile": "showcase", + "repository": { + "url": "https://github.com/ThreeFish-AI/coding-proxy", + "provider": "github", + "revision": "b10fceca081cf130e22235cd6d380f6a8c0cebb8" + } + }, + "components": [ + { "id": "client", "type": "external", "label": "Client (Claude Code)", "sublabel": "Anthropic 协议客户端", "pos": [40, 300], "size": [150, 60] }, + { "id": "router", "type": "backend", "label": "RequestRouter", "sublabel": "routing/router.py", "pos": [330, 285], "size": [150, 90], "sources": [{ "path": "src/coding/proxy/routing/router.py", "line": 32 }, { "path": "src/coding/proxy/server/routes.py", "line": 74 }] }, + { "id": "g0", "type": "security", "label": "CB / Quota", "sublabel": "Tier 0 · Zhipu", "pos": [620, 90], "size": [150, 60], "sources": [{ "path": "src/coding/proxy/routing/tier.py", "line": 49 }] }, + { "id": "g1", "type": "security", "label": "CB / Quota", "sublabel": "Tier 1 · Anthropic", "pos": [620, 230], "size": [150, 60], "sources": [{ "path": "src/coding/proxy/routing/tier.py", "line": 49 }] }, + { "id": "g2", "type": "security", "label": "CB / Quota", "sublabel": "Tier 2 · GitHub Copilot", "pos": [620, 370], "size": [150, 60], "sources": [{ "path": "src/coding/proxy/routing/tier.py", "line": 49 }] }, + { "id": "api0", "type": "cloud", "label": "GLM API", "sublabel": "Zhipu", "pos": [860, 90], "size": [150, 60] }, + { "id": "api1", "type": "cloud", "label": "Anthropic API", "sublabel": "官方端点", "pos": [860, 230], "size": [150, 60] }, + { "id": "api2", "type": "cloud", "label": "Copilot API", "sublabel": "GitHub", "pos": [860, 370], "size": [150, 60] }, + { "id": "api3", "type": "cloud", "label": "Gemini API", "sublabel": "Tier 3 · Google Antigravity", "tag": "无门控 · 兜底", "pos": [860, 510], "size": [150, 60], "sources": [{ "path": "src/coding/proxy/routing/tier.py", "line": 35 }] } + ], + "boundaries": [ + { "kind": "region", "label": "coding-proxy 进程内", "wraps": ["router", "g0", "g1", "g2"] } + ], + "connections": [ + { "id": "client-in", "from": "client", "to": "router", "label": "POST /v1/messages", "variant": "emphasis" }, + { "id": "router-g0", "from": "router", "to": "g0", "fromSide": "top", "toSide": "left", "via": [[405, 120]] }, + { "id": "router-g1", "from": "router", "to": "g1", "fromSide": "right", "toSide": "left" }, + { "id": "router-g2", "from": "router", "to": "g2", "fromSide": "right", "toSide": "left", "via": [[550, 330], [550, 400]] }, + { "id": "pass0", "from": "g0", "to": "api0", "label": "✅ Pass", "variant": "emphasis" }, + { "id": "pass1", "from": "g1", "to": "api1", "label": "✅ Pass", "variant": "emphasis" }, + { "id": "pass2", "from": "g2", "to": "api2", "label": "✅ Pass", "variant": "emphasis" }, + { "id": "fo0", "from": "g0", "to": "g1", "label": "❌ Blocked / API Error", "variant": "dashed", "fromSide": "bottom", "toSide": "top" }, + { "id": "fo1", "from": "g1", "to": "g2", "label": "❌ Blocked / API Error", "variant": "dashed", "fromSide": "bottom", "toSide": "top" }, + { "id": "fo2", "from": "g2", "to": "api3", "label": "🆘 Safety Net Downgrade", "variant": "dashed", "fromSide": "bottom", "toSide": "left" } + ], + "cards": [ + { "dot": "violet", "title": "路由", "items": ["RequestRouter 按 tier 顺序逐级尝试,是所有 /v1/messages 请求的唯一入口"] }, + { "dot": "amber", "title": "门控", "items": ["每个非末位 tier 挂 CircuitBreaker 与 QuotaGuard", "任一不放行或上游报错,即跳到下一 tier"] }, + { "dot": "slate", "title": "兜底", "items": ["末位 tier 不挂门控(is_terminal)", "作为 Safety Net 接住全部降级流量"] } + ] +} diff --git a/docs/diagrams/routing-n-tier/routing-n-tier.svg b/docs/diagrams/routing-n-tier/routing-n-tier.svg new file mode 100644 index 0000000..14c1172 --- /dev/null +++ b/docs/diagrams/routing-n-tier/routing-n-tier.svg @@ -0,0 +1,638 @@ + + + N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor + 由 Archify 生成的架构图。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Client (Claude Code) · Anthropic 协议客户端 · 架构组件 + + + + Client (Claude Code) + Anthropic 协议客户端 + + + + RequestRouter · routing/router.py · coding-proxy 进程内 + + + + RequestRouter + routing/router.py + + + + CB / Quota · Tier 0 · Zhipu · coding-proxy 进程内 + + + + CB / Quota + Tier 0 · Zhipu + + + + CB / Quota · Tier 1 · Anthropic · coding-proxy 进程内 + + + + CB / Quota + Tier 1 · Anthropic + + + + CB / Quota · Tier 2 · GitHub Copilot · coding-proxy 进程内 + + + + CB / Quota + Tier 2 · GitHub Copilot + + + + GLM API · Zhipu · 架构组件 + + + + GLM API + Zhipu + + + + Anthropic API · 官方端点 · 架构组件 + + + + Anthropic API + 官方端点 + + + + Copilot API · GitHub · 架构组件 + + + + Copilot API + GitHub + + + + Gemini API · Tier 3 · Google Antigravity · 架构组件 · 无门控 · 兜底 + + + + Gemini API + Tier 3 · Google Antigravity + 无门控 · 兜底 + + + + + + POST /v1/messages + + + + + + + ✅ Pass + + + + ✅ Pass + + + + ✅ Pass + + + + ❌ Blocked / API Error + + + + ❌ Blocked / API Error + + + + 🆘 Safety Net Downgrade + + + + + + coding-proxy 进程内 + + + + + 图例 + + + 后端 + + + + 云服务 + + + + 安全 + + + + 外部系统 + + + \ No newline at end of file diff --git a/docs/diagrams/routing-n-tier/routing-n-tier.visual-check.json b/docs/diagrams/routing-n-tier/routing-n-tier.visual-check.json new file mode 100644 index 0000000..60137ec --- /dev/null +++ b/docs/diagrams/routing-n-tier/routing-n-tier.visual-check.json @@ -0,0 +1,962 @@ +{ + "schemaVersion": 1, + "ok": true, + "command": "visual-check", + "evidenceKind": "automated-browser", + "status": "pass", + "visualReview": "pending", + "provenance": "current", + "deliveryReceiptId": "3daeeba6-7760-4085-bbf5-8cc140f2ab4a", + "artifact": { + "path": "/Users/cm.huang/orca/workspaces/coding-proxy/redhorse/docs/diagrams/routing-n-tier/routing-n-tier.html", + "sha256": "4bf28f2cd2b879a93e59b1e11792ac3345123aceeef1fec916d025de2e875a3c", + "bytes": 762030 + }, + "state": { + "detail": "read", + "motion": "still" + }, + "chrome": { + "status": "available", + "executable": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" + }, + "diagnostics": [], + "containment": { + "status": "pass", + "policy": "fit-or-reader-declared-readable-vertical-scroll", + "viewports": [ + { + "width": 1440, + "height": 900, + "theme": "light", + "innerWidth": 1440, + "innerHeight": 900, + "scrollWidth": 1440, + "scrollHeight": 900, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1258, + "diagramWidth": 1228, + "pageComposition": { + "bodyPaddingPx": 12, + "headerPx": 52, + "diagramChromePx": 78, + "svgPx": 746, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1600, + "height": 1000, + "theme": "light", + "innerWidth": 1600, + "innerHeight": 1000, + "scrollWidth": 1600, + "scrollHeight": 1000, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1314, + "diagramWidth": 1284, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 780, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1920, + "height": 1080, + "theme": "light", + "innerWidth": 1920, + "innerHeight": 1080, + "scrollWidth": 1920, + "scrollHeight": 1080, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1445, + "diagramWidth": 1415, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 860, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 2048, + "height": 1320, + "theme": "light", + "innerWidth": 2048, + "innerHeight": 1320, + "scrollWidth": 2048, + "scrollHeight": 1320, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1831, + "diagramWidth": 1781, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 68, + "diagramChromePx": 94, + "svgPx": 1082, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 44, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + } + ] + }, + "themeStates": { + "status": "pass", + "viewports": [ + { + "width": 1440, + "height": 900, + "requestedTheme": "light", + "resolvedTheme": "light", + "ok": true + }, + { + "width": 1600, + "height": 1000, + "requestedTheme": "light", + "resolvedTheme": "light", + "ok": true + }, + { + "width": 1920, + "height": 1080, + "requestedTheme": "light", + "resolvedTheme": "light", + "ok": true + }, + { + "width": 2048, + "height": 1320, + "requestedTheme": "light", + "resolvedTheme": "light", + "ok": true + }, + { + "width": 1440, + "height": 900, + "requestedTheme": "dark", + "resolvedTheme": "dark", + "ok": true + }, + { + "width": 2048, + "height": 1320, + "requestedTheme": "dark", + "resolvedTheme": "dark", + "ok": true + } + ] + }, + "readability": { + "status": "pass", + "minimumProjectedNodeTextPx": 6, + "viewports": [ + { + "width": 1440, + "height": 900, + "theme": "light", + "innerWidth": 1440, + "innerHeight": 900, + "scrollWidth": 1440, + "scrollHeight": 900, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1258, + "diagramWidth": 1228, + "pageComposition": { + "bodyPaddingPx": 12, + "headerPx": 52, + "diagramChromePx": 78, + "svgPx": 746, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1600, + "height": 1000, + "theme": "light", + "innerWidth": 1600, + "innerHeight": 1000, + "scrollWidth": 1600, + "scrollHeight": 1000, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1314, + "diagramWidth": 1284, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 780, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1920, + "height": 1080, + "theme": "light", + "innerWidth": 1920, + "innerHeight": 1080, + "scrollWidth": 1920, + "scrollHeight": 1080, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1445, + "diagramWidth": 1415, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 860, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 2048, + "height": 1320, + "theme": "light", + "innerWidth": 2048, + "innerHeight": 1320, + "scrollWidth": 2048, + "scrollHeight": 1320, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1831, + "diagramWidth": 1781, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 68, + "diagramChromePx": 94, + "svgPx": 1082, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 44, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + } + ] + }, + "viewerChrome": { + "status": "pass", + "viewports": [ + { + "width": 1440, + "height": 900, + "theme": "light", + "innerWidth": 1440, + "innerHeight": 900, + "scrollWidth": 1440, + "scrollHeight": 900, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1258, + "diagramWidth": 1228, + "pageComposition": { + "bodyPaddingPx": 12, + "headerPx": 52, + "diagramChromePx": 78, + "svgPx": 746, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1600, + "height": 1000, + "theme": "light", + "innerWidth": 1600, + "innerHeight": 1000, + "scrollWidth": 1600, + "scrollHeight": 1000, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1314, + "diagramWidth": 1284, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 780, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 1920, + "height": 1080, + "theme": "light", + "innerWidth": 1920, + "innerHeight": 1080, + "scrollWidth": 1920, + "scrollHeight": 1080, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1445, + "diagramWidth": 1415, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 60, + "diagramChromePx": 84, + "svgPx": 860, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + }, + { + "width": 2048, + "height": 1320, + "theme": "light", + "innerWidth": 2048, + "innerHeight": 1320, + "scrollWidth": 2048, + "scrollHeight": 1320, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1831, + "diagramWidth": 1781, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 68, + "diagramChromePx": 94, + "svgPx": 1082, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 44, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light" + } + ] + }, + "captures": { + "status": "pass", + "screenshots": [ + { + "width": 1440, + "height": 900, + "theme": "light", + "innerWidth": 1440, + "innerHeight": 900, + "scrollWidth": 1440, + "scrollHeight": 900, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1258, + "diagramWidth": 1228, + "pageComposition": { + "bodyPaddingPx": 12, + "headerPx": 52, + "diagramChromePx": 78, + "svgPx": 746, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light", + "file": "routing-n-tier.visual-check.1440x900.light.png" + }, + { + "width": 1440, + "height": 900, + "theme": "dark", + "innerWidth": 1440, + "innerHeight": 900, + "scrollWidth": 1440, + "scrollHeight": 900, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1258, + "diagramWidth": 1228, + "pageComposition": { + "bodyPaddingPx": 12, + "headerPx": 52, + "diagramChromePx": 78, + "svgPx": 746, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 54, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "dark", + "file": "routing-n-tier.visual-check.1440x900.dark.png" + }, + { + "width": 2048, + "height": 1320, + "theme": "light", + "innerWidth": 2048, + "innerHeight": 1320, + "scrollWidth": 2048, + "scrollHeight": 1320, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1831, + "diagramWidth": 1781, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 68, + "diagramChromePx": 94, + "svgPx": 1082, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 44, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "light", + "file": "routing-n-tier.visual-check.2048x1320.light.png" + }, + { + "width": 2048, + "height": 1320, + "theme": "dark", + "innerWidth": 2048, + "innerHeight": 1320, + "scrollWidth": 2048, + "scrollHeight": 1320, + "overflowX": false, + "overflowY": false, + "verticalScrollAccepted": false, + "overflowDisposition": "contained", + "readerLayout": "adaptive", + "readerOverflow": null, + "readerFit": "intrinsic-height", + "ok": true, + "readerWidth": 1831, + "diagramWidth": 1781, + "pageComposition": { + "bodyPaddingPx": 64, + "headerPx": 68, + "diagramChromePx": 94, + "svgPx": 1082, + "cardsPx": 0, + "viewBoxHeight": 638 + }, + "viewBoxWidth": 1050, + "minimumProjectedNodeTextPx": 8, + "minimumProjectedNonEdgeTextPx": 8.7, + "minimumProjectedEdgeTextPx": 8, + "minimumProjectedNodeText": "POST /v1/messages", + "minimumProjectedNodeTextDetail": "edge", + "minimumProjectedNodeTextOwner": { + "kind": "edge", + "id": "client-in", + "from": "client", + "to": "router" + }, + "minimumRequiredNodeTextPx": 6, + "readabilityOk": true, + "hasLegend": true, + "hasNavigationDock": true, + "legendDockIntersectionArea": 0, + "dockStageIntersectionArea": 0, + "dockStageGap": 10, + "requiredDockStageGap": 10, + "viewerChromeStageOk": true, + "viewerChromeReserve": 44, + "viewerChromeActive": true, + "viewerChromeOk": true, + "resolvedTheme": "dark", + "file": "routing-n-tier.visual-check.2048x1320.dark.png" + } + ], + "contactSheet": "routing-n-tier.visual-check.html" + }, + "sidecars": { + "directory": "/tmp/rnt-vc", + "receipt": "routing-n-tier.visual-check.json", + "contactSheet": "routing-n-tier.visual-check.html", + "files": [ + { + "sha256": "66df26beefaa888ecef7d4425e89c4b9b148f309fd42e6159cc292c5c562d4d8", + "bytes": 1928, + "file": "routing-n-tier.visual-check.html" + }, + { + "sha256": "59168cac2790d9043dca834bb431b9c9d3c017d3039ef47c3d9be05dd9ac17b1", + "bytes": 116528, + "file": "routing-n-tier.visual-check.1440x900.light.png" + }, + { + "sha256": "b68694b48d61666ff6974b79783247b61d0489fff21968772f656c4c631c3fcb", + "bytes": 123186, + "file": "routing-n-tier.visual-check.1440x900.dark.png" + }, + { + "sha256": "8924b4b906df03fd478ca2aa545503bd5ce2237e5e4ffd12e911849a4769e081", + "bytes": 169842, + "file": "routing-n-tier.visual-check.2048x1320.light.png" + }, + { + "sha256": "2ad64b91dc9c49bde909066b12edb99d6ea0b46521ef92f79472d3ebbf9201ee", + "bytes": 182962, + "file": "routing-n-tier.visual-check.2048x1320.dark.png" + } + ] + } +} From b3fa34de799902e0dfcaf59f217779ecc42b8b9b Mon Sep 17 00:00:00 2001 From: ThreeFish Date: Sun, 6 Dec 2026 00:26:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?docs(README):=20=E4=B8=AD=E6=96=87=20README?= =?UTF-8?q?=20=E6=9E=B6=E6=9E=84=E5=85=A8=E6=99=AF=E5=9B=BE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=8D=A2=E4=B8=BA=20Archify=20=E5=9B=BE=EF=BC=8C?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=20routing-n-tier=20=E5=9B=BE=E6=BA=90;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang --- docs/zh-CN/README.md | 51 +------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index c5a5e5d..23d3d1f 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -121,56 +121,7 @@ open http://127.0.0.1:3392/dashboard 当请求到达时,`RequestRouter` 会顺着 N-tier 树形层级,结合熔断与计算配额,决定发往哪一具体通道: -```mermaid -graph RL - %% 样式定义 (支持明暗双色模式的高对比色彩) - classDef client fill:#1E3A8A,stroke:#60A5FA,stroke-width:2px,color:#EFF6FF,rx:8,ry:8 - classDef router fill:#4C1D95,stroke:#A78BFA,stroke-width:2px,color:#F5F3FF,rx:8,ry:8 - classDef gateway fill:#7C2D12,stroke:#FB923C,stroke-width:2px,color:#FFF7ED - classDef api fill:#14532D,stroke:#4ADE80,stroke-width:2px,color:#F0FDF4 - classDef fallback fill:#27272A,stroke:#A1A1AA,stroke-width:2px,color:#F4F4F5 - - Client["💻
Client (Claude Code)"]:::client - - subgraph CodingProxy["coding-proxy"] - direction RL - - Router["RequestRouter
routing/router.py"]:::router - - Router -->NTier - - subgraph NTier["N-tier"] - direction TB - - subgraph Tier0 ["Tier 0: Zhipu"] - direction RL - G0{"CB / Quota"}:::gateway -- "✅ Pass" --> API0(("GLM API")):::api - end - - subgraph Tier1 ["Tier 1: Anthropic"] - direction RL - G1{"CB / Quota"}:::gateway -- "✅ Pass" --> API1(("Anthropic API")):::api - end - - subgraph Tier2 ["Tier 2: GitHub Copilot"] - direction RL - G2{"CB / Quota"}:::gateway -- "✅ Pass" --> API2(("Copilot API")):::api - end - - subgraph Tier3 ["Tier 3: Google Antigravity"] - direction RL - API3(("Gemini API")):::fallback - end - - Tier0 -. "❌ Blocked / API Error" .-> Tier1 - Tier1 -. "❌ Blocked / API Error" .-> Tier2 - Tier2 -. "🆘 Safety Net Downgrade" .-> Tier3 - end - - end - - Client -->|"POST /v1/messages"| CodingProxy -``` +![N-tier 链式路由:一次 /v1/messages 请求怎么选 vendor](../diagrams/routing-n-tier/routing-n-tier.svg) *详细架构设计与机制,请深入阅读 [framework.md](../framework.md)* From 2049fc6852e5ef493007054cd653d418477e18d9 Mon Sep 17 00:00:00 2001 From: ThreeFish Date: Sun, 6 Dec 2026 00:41:15 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat(dashboard):=20Sessions=20=E9=A1=B5?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=8A=98=E5=8F=A0=E8=BE=85=E5=8A=A9=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=EF=BC=8CAPI=20=E5=A2=9E=20auxiliary=20=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=EF=BC=88v0.6.21=EF=BC=89;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang --- CHANGELOG.md | 4 ++ pyproject.toml | 2 +- src/coding/proxy/routing/session_title.py | 8 ++++ src/coding/proxy/server/dashboard.py | 29 +++++++++++-- tests/test_dashboard_sessions_render.py | 51 ++++++++++++++++++++++- tests/test_session_title_auxiliary.py | 43 +++++++++++++++++++ uv.lock | 2 +- 7 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 tests/test_session_title_auxiliary.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 30587ae..9db7558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ 本文件基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/) 规范维护,版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。 +## [v0.6.21](https://github.com/ThreeFish-AI/coding-proxy/releases/tag/v0.6.21) - 2026-12-06 + +- feat(dashboard): **Sessions 页默认折叠辅助会话**:harness 注入式调用(会话命名 / 分支命名 / 记忆压缩 / 单命令等)各自成会话,标题与用户主对话同源,排查时极易误认(如 Orca 的分支命名走 Claude Code、主对话走 PI,同一 id 下模型对不上);现 `/api/dashboard/sessions` 每行增 `auxiliary` 标记(按标题家族标签判定,与标题提取共用 `session_title` 家族表),Sessions 页默认隐藏并提示「已隐藏 N 个辅助会话」,分页栏勾选「显示辅助会话」后带「辅助」tag 展示; + ## [v0.6.20](https://github.com/ThreeFish-AI/coding-proxy/releases/tag/v0.6.20) - 2026-12-05 > 本版主轴:Models 页配价即进 Model Bind 下拉(anthropic 新型号不再需要改内置目录或 `bindable_models`),Models 页新增 Label 列美化下拉展示名,下拉按 vendor 分组排序;Model Mapping 子页签按 target 设置每模型并发度。 diff --git a/pyproject.toml b/pyproject.toml index 1584622..2c60a8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "coding-proxy" -version = "0.6.20" +version = "0.6.21" description = "A High-Availability, Transparent, and Smart Multi-Vendor Proxy for Claude Code. Support Claude Plans, GitHub Copilot, Google Antigravity, ZAI/GLM, MiniMax, Qwen, Xiaomi, Kimi, Doubao..." readme = "README.md" requires-python = ">=3.12" diff --git a/src/coding/proxy/routing/session_title.py b/src/coding/proxy/routing/session_title.py index f369a74..1467b82 100644 --- a/src/coding/proxy/routing/session_title.py +++ b/src/coding/proxy/routing/session_title.py @@ -171,6 +171,14 @@ def sanitize_user_text(raw: str) -> str: True, ), ) +AUXILIARY_TITLE_TAGS: tuple[str, ...] = tuple( + tag for _, tag, _, _, _ in _INJECTED_PROMPT_FAMILIES +) + + +def is_auxiliary_title(title: str) -> bool: + """标题是否为 harness 注入式辅助调用(会话命名、分支命名、记忆压缩等)的产物.""" + return any(title.startswith(f"{tag} ") for tag in AUXILIARY_TITLE_TAGS) # task-notification 载荷凝缩:注入载荷常为 harness 的任务通知 XML 块, diff --git a/src/coding/proxy/server/dashboard.py b/src/coding/proxy/server/dashboard.py index 0e30642..a9c148d 100644 --- a/src/coding/proxy/server/dashboard.py +++ b/src/coding/proxy/server/dashboard.py @@ -27,6 +27,7 @@ from ..config.schema import ProxyConfig from ..config.ui_registry import REGISTRY from ..logging.db import TimePeriod +from ..routing.session_title import is_auxiliary_title from .security import ADMIN_TOKEN_HEADER, admin_token_matches # ── 品牌图标:Tabler prompt 核心笔划(> 与 _)+ 通透青绿圆环 ────────────── @@ -1298,6 +1299,9 @@ def file_response(self, *args: Any, **kwargs: Any) -> Response:
+