程序员阿江(Relakkes) 28b1ccf0d2 fix(desktop): 移除 canonical .app 重签名,避免 Keychain ACL 失配导致 403
症状: 桌面端激活 Claude Official provider 后所有请求报
403 "Request not allowed",Tauri 原生产物(target/.../bundle/macos/)
能跑,但脚本输出的 canonical 产物(build-artifacts/macos-arm64/)报错。

根因: 脚本里的 sign_app_bundle() 用 `codesign --force --deep --sign -`
对 sidecar 和外层 .app 重签,想统一 signing identifier,但这会改变
sidecar binary 的 code signature hash。macOS Keychain ACL 按 hash
识别 caller —— 重签后的 sidecar 对 Keychain 来说是"陌生 binary",
弹"允许访问"对话框但 sidecar 无 UI 弹不出,被静默拒绝,CLI 读不到
OAuth token,SDK 构造空 Authorization,Anthropic 返回 403。

修复: 移除 sign_app_bundle 及其调用。Tauri 的 --no-sign flag 只是不做
Developer ID 签名,ad-hoc 签名 Tauri 自己已经做好了,再签一次纯属
多此一举,还破坏了 Tauri 签好的 Keychain ACL 关系。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:13:43 +08:00
..