You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In at least one user screenshot, the top bar shows the active model as opus-4-7, while the currently active provider card in Settings shows claude-3-5-haiku-20241022 and is still marked 当前.
That suggests the UI may be exposing two different model states at once (top-bar active vs provider-card default/resolved state). If true, this could make 403 debugging much harder because the user may think the generate request is using one model while the app internally resolves another.
403 + body 含 Your request was blocked / blocked / Cloudflare ray id → 新增 gatewayWafBlocked hint(专门给本 issue 这种 WAF 拦截场景,避免被误归到 keyInvalid 让用户白查 API key)
Activity
Sun-sunshine06 commentedon Apr 22, 2026
正在修复此问题。测试连接和实际调用的请求方式可能存在差异(如 model 参数、请求头、endpoint 不同),导致 403 策略拦截。
github-actions commentedon Apr 22, 2026
感谢反馈,复现描述很清楚。
从当前代码看,这个现象是可能出现的:“测试连接”与“正常对话生成”走的是不同请求路径。
/models可达性与鉴权。codesign:v1:generate,再进入真实的生成请求(模型推理调用)。所以会出现“测试连接通过,但生成时报 403(Your request was blocked)”的情况:
/models可用不代表生成端点一定放行。另外,当前诊断里会把
403和401归到同一类(密钥/权限问题),因此提示可能偏泛化。Relevant code:
apps/desktop/src/renderer/src/components/Settings.tsx:286— 设置页“测试连接”调用connection.testProvider(...)apps/desktop/src/main/connection-ipc.ts:410—runProviderTest仅对/models做 GET 探测apps/desktop/src/main/connection-ipc.ts:426— 非 2xx 时按 HTTP 状态返回连接测试错误apps/desktop/src/main/index.ts:448— 对话生成走codesign:v1:generateapps/desktop/src/main/index.ts:581— 生成调用runGenerate(...)(真实模型请求)apps/desktop/src/main/connection-ipc.ts:205—403被归类为401类别packages/shared/src/diagnostics.ts:61— 诊断里401/403同归keyInvalidREADME.md:119— 当前发布仍是v0.1.x早期阶段Need more info:
baseUrl(以及是否配置了额外请求头)?main.log里对应generate.fail的日志(包含 provider、modelId、baseUrl、message)。open-codesign Bot
Sun-sunshine06 commentedon Apr 22, 2026
补一条同类现场证据,和本 issue 高度一致:
无论是 codex 还是 claude 都不行,是 cpa 反代的这条证据进一步支持当前判断:
codex和claude两条链路都可能触发同类 403 blocked建议把这类 case 一并纳入该问题,而不是按单个模型拆散处理。若后续需要,可再补 diagnostics zip / main.log 佐证。
Sun-sunshine06 commentedon Apr 22, 2026
Another potentially related signal: see #136.
In at least one user screenshot, the top bar shows the active model as
opus-4-7, while the currently active provider card in Settings showsclaude-3-5-haiku-20241022and is still marked当前.That suggests the UI may be exposing two different model states at once (top-bar active vs provider-card default/resolved state). If true, this could make 403 debugging much harder because the user may think the generate request is using one model while the app internally resolves another.
hqhq1025 commentedon Apr 22, 2026
@Sun-sunshine06 同步一下进度 —— 你 4/22 02:51 提到正在修复,请问目前进度如何?
我这边正在并行做一个更通用的修复 PR(暂编号 #130 范围),把生成失败路径接到现有的
diagnose()hypothesis 系统,覆盖范围包括:missingV1hint + auto-fixYour request was blocked/blocked/ Cloudflare ray id → 新增gatewayWafBlockedhint(专门给本 issue 这种 WAF 拦截场景,避免被误归到keyInvalid让用户白查 API key)keyInvalidnot implemented→ 网关不支持 Messages API hint(与 bug: 第三方中转服务测试连接通过但生成返回 500 not implemented #158 联动)instructions are required→ 提示切换 wire 到 openai-chat(与 bug(desktop): macOS generation fails with Instructions are required and no visible output #134 联动)如果你那边的修复方向不同/已经动手,麻烦贴一下 PR 链接或当前思路,避免重复工作。如果还没起手,我这个 PR 落地后会顺带 close 本 issue,你来 review 即可。
cc @hqhq1025
Sun-sunshine06 commentedon Apr 22, 2026
明白了!我这边只是做了问题整理和分析,还没有实际动手改代码。这个问题你已经分析得很清楚了,尽管放开手去改,我来帮你 review 合并 👍
fix(renderer): Settings active card no longer misrepresents model whe…
fix(renderer): Settings active card no longer misrepresents model whe…
feat(diagnostics): bridge generate failures to diagnose() hypotheses (#…
github-actions commentedon May 1, 2026
感谢提交这个详细的报告。
从已有讨论看,问题已经定位:测试连接(
connection.testProvider)仅探测/models端点,而实际对话生成走codesign:v1:generate→runGenerate会触发真实的模型推理请求,两个路径可能被上游网关/反代区别对待,因此出现“测试通过但生成 403”的现象。当前代码中
403被归为keyInvalid类别(packages/shared/src/diagnostics.ts:61),导致诊断提示不够精确。团队正在推进修复(如 PR #130 范围),会将 WAF/网关拦截等场景分离出独立的诊断提示。需要的补充信息(如果尚未提供):
main.log中对应generate.fail的完整日志这些数据能帮助验证修复逻辑的覆盖范围。
Open-CoDesign Bot
fix(shared): diagnose blocked 403 generation errors
Sun-sunshine06 commentedon May 3, 2026
已在 PR #297 中修复并合并到 main。
这次把生成请求返回的
403 Your request was blocked识别为网关 / 反代 / WAF 拦截诊断,避免误提示为 API key 无效;普通 403 仍保留原有鉴权诊断。验证包含 targeted Biome、shared diagnostics 单测、desktop store 单测、desktop typecheck、全仓 typecheck 和 desktop 测试。