My safety guard was checked in 6 places. Nothing ever set it.
说明与用途
Safari MCP 服务器在守护进程重启后发出的标签所有权令牌因浏览器会话纪元过期而失效,导致标签卡被卡住并导致命令失败。解决方案是在签发令牌时验证纪元并更新生成计数器。
问题
Safari MCP server issued tab‑ownership tokens that became invalid after a daemon restart, causing stranded tabs and failed commands.
结果
The issue was caused by a dead guard that failed to detect epoch rotation during a daemon restart, leading to stale tokens and stranded tabs. The fix involves re‑verifying the epoch at mint time and updating a generation counter.
工作流
- 1. Daemon restarts and extension re‑handshakes. 2. Background worker resolves a browser‑session epoch and caches it. 3. New tokens are minted using the cached epoch. 4. Epoch rotates in session storage during the restart window. 5. Cached epoch remains stale, so new tokens carry old epoch. 6. Later commands using these tokens are rejected, leaving tabs stranded.
- 7. Rehydration discards all stored tokens with stale epoch, causing simultaneous failures.
- 8. Bug analysis reveals dead guard that never increments epoch counter.
- 9. Proposed fix: re‑verify epoch against storage at mint time and increment counter when mismatched.
证据
Tokens are stamped with a browser-session epoch: a random identifier that ties a token to one continuous run of the browser.
The cached copy is treated as the truth.
A variable that is compared must be assigned somewhere other than its declaration.
- 记录日期: 2026-09-15T22:30:41.159Z