Skip to content

fix: 修复旧版 macOS 的 Grok Bot 后台钥匙串弹窗 - #138

Closed
shezhiyuan wants to merge 2 commits into
cclank:mainfrom
shezhiyuan:patch-1
Closed

shezhiyuan wants to merge 2 commits into
cclank:mainfrom
shezhiyuan:patch-1

Conversation

@shezhiyuan

@shezhiyuan shezhiyuan commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #137
Related #136

v1.0.48 为兼容 macOS 26 移除了进程级钥匙串交互抑制后,在 macOS 15.1 上,后台 --grok-bot-verify 会每约 5 分钟触发一次“Grok Bot Safe Storage”系统授权窗口。

这次按系统版本恢复非交互保护:

  • macOS 26 以前的后台读取临时关闭进程级钥匙串交互,读取成功或返回 nil 后均恢复原状态;无法建立保护时直接返回 nil。
  • macOS 26 及以后的系统继续使用现有 LAContext.interactionNotAllowed / kSecUseAuthenticationUI 路径,避免旧接口导致已授权读取报 errSecAuthFailed。
  • 用户主动授权的 allowInteraction: true 路径继续允许交互。

扩展现有原生 Swift bridge 检查,验证旧版本分支的成功/失败读取、原状态恢复、原先已禁止交互的情况、macOS 26+ 分支,以及主动授权。测试读取实际进程交互状态,版本参数用于在同一 runner 上覆盖不同策略。

验证在 GitHub Actions 对提交 2cc0c6b 执行:

  • macOS 全量测试通过,包含扩展后的原生 Swift 检查。
  • Ubuntu 全量测试通过,Ubuntu Collector 也通过。
  • Windows Collector 的 3 个用例通过,但 tearDownClass 清理 scan_cache.json.lock 时发生 WinError 32;Windows 全量测试 执行 820 个测试,同一清理错误导致 1 个 error、58 个 skipped。对应的 Python 文件未在本 PR 中修改。
  • Windows installer 因上述依赖失败而跳过,整体 workflow 未全绿。

Restore process-level interaction suppression for legacy keychain ACL reads on older macOS. Preserve the macOS 26 query-only policy and restore the previous interaction state after each read.
Exercise real process interaction flags, successful and failed legacy reads, restoration of an already disabled flag, explicit authorization, and the macOS 26+ bypass in the existing native bridge fixture.
@shezhiyuan shezhiyuan closed this by deleting the head repository Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] v1.0.48 在 macOS 15.1 后台每约 5 分钟弹出 Grok Bot 钥匙串授权窗口

1 participant