fix(settings): surface actionable OAuth failures - #3319
Conversation
Generated-by: Codex
|
After:
Maka Desktop diagnostic report Error Environment Recent main-process logs (1) Runtime Host |
Scope and recovery-path reviewThe direction is valuable: preserving actionable OAuth failure reasons and giving users a direct path to Network Settings fixes a real UX gap. However, I think the current PR combines two different problems and expands well beyond the minimum change needed for OAuth recovery. 1. The problem statement should be corrected#1301 describes a configured Maka proxy being bypassed during Codex OAuth token exchange/refresh. That issue was already closed by #1302, which routed those requests through the active proxy. This PR addresses a different problem:
Proxy discovery is a separate feature request:
These should be defined and evaluated independently. The “Before” evidence currently proves only that the UI displayed a generic authentication failure; it does not by itself establish that proxy discovery is required to fix the failure. 2. Occam's razor: the minimum sufficient fix is much smallerFor the OAuth recovery issue, the minimum sufficient change appears to be:
Automatic environment/system proxy discovery, candidate adoption, restoring proxy defaults, credential deletion, a new Host operation, and a new remote-owner grant are not necessary to solve the error-reporting/recovery-path problem. I recommend keeping the failure projection + recovery navigation in this PR and moving proxy discovery/reset into separately designed changes. 3. Side effects and gaps to resolveThe current proxy test does not verify OAuth recovery. Proxy discovery exposes more than credentials. Only the first parseable candidate is returned. System/PAC discovery has no explicit timeout. Reset is a multi-step, non-atomic mutation. The compatibility impact is broader than the OAuth fix. RecommendationI recommend splitting the change:
This keeps the OAuth recovery fix focused while allowing the proxy-discovery security and product behavior to be reviewed on their own merits. 中文范围与恢复路径审视这个方向有价值:保留可操作的 OAuth 失败原因,并给用户一个直接进入网络设置的入口,确实补上了真实的 UX 缺口。但当前 PR 混合了两个不同的问题,而且明显超出了 OAuth 恢复所需的最小改动。 1. 建议修正问题定义#1301 描述的是:Maka 已配置代理,但 Codex OAuth token exchange/refresh 绕过了代理。这个问题已经由 #1302 修复并关闭。 当前 PR 实际解决的是:
而代理发现属于另一个独立需求:
这两个问题应当分别定义、分别验证。目前的 Before 证据只能证明 UI 显示了通用鉴权失败,不能单独证明“自动发现代理”是修复该问题的必要条件。 2. 从奥卡姆剃刀看,最小充分修复应该小得多对于 OAuth 恢复问题,最小充分变更应当是:
环境/系统代理自动发现、候选采用、恢复代理默认值、删除凭据、新增 Host operation 和 remote-owner grant,都不是解决“错误报告与恢复入口”问题的必要条件。建议本 PR 只保留失败投影与恢复导航,把代理发现和 reset 拆到独立变更中。 3. 需要处理的副作用和缺口当前代理测试不能证明 OAuth 已恢复。 代理发现暴露的不只是凭据。 只返回第一个可解析候选。 系统/PAC 检测没有显式超时。 恢复默认是非原子的多步变更。 兼容性影响大于 OAuth 修复本身。 建议建议拆分为:
这样既能尽快修复 OAuth 恢复体验,也能让代理发现相关的安全边界和产品行为得到独立、充分的审查。 |
Generated-by: Codex
|
Thanks for the detailed review. I agree that this PR conflated the follow-up OAuth recovery problem with proxy discovery and reset. I have narrowed the branch locally to:
I also agree that the existing generic proxy probe cannot establish OAuth recovery. The recovery copy now tells the user to update Network Settings and retry sign-in. That retry performs the destination-correct Epoch 29 remains necessary because the OAuth failure codes extend the closed projection schema; upstream already uses epoch 28. Proxy discovery should be a separately designed change with a local/privacy boundary, bounded user-initiated detection, and ordered fallback behavior. Reset should likewise be separate and Host-owned so policy and credential changes have honest atomic semantics. The reduced patch is 16 files / 331 additions instead of 32 files / 1,014 additions. Local lint, format, build, typecheck, Knip, Runtime (2,967 passed / 13 skipped), Runtime Host (1,033 passed), and Desktop (979 passed) are green. A focused recovery-navigation E2E was added, but its local run was blocked during Electron fixture startup before the assertion; I will not claim it as locally passing. The branch update is prepared locally and will be pushed after contributor sign-off. Prepared and posted with OpenAI Codex at the contributor request. |
Generated-by: Codex


Summary
Follow-up to #1301 and #1302. This does not change the proxy-routing fix from #1302.
Verification
npm run lintnpm run format:checknpm run buildnpm run typechecknpx knip --workspace apps/desktopnpx knip --workspace packages/uinpm --workspace @maka/runtime test— 2,967 passed, 13 skippednpm --workspace @maka/runtime-host test— 1,033 passednpm --workspace @maka/desktop test— 979 passedThe focused recovery-navigation E2E is included, but its local run timed out while setting up the Electron fixture before product assertions. The same local branch build/typecheck validation used the three-line fix now merged upstream as #3332.
Before: #3319 (comment)
After: #3319 (comment)
Compatibility
Runtime Host compatibility epoch 29 carries the two new closed OAuth failure codes. Epoch 28 is already used by the Fast service-tier profile change.
AI use
Select exactly one:
Tool(s) and scope: OpenAI Codex assisted with analysis, implementation, tests, verification, review response, and PR preparation. The human contributor reviewed the result and authorized submission.
Checklist
Does this PR entail a change in behavior?