Repository navigation
fix(antigravity): scratch 沙箱下不再对 /fork 声称支持 - #3057
Merged
Merged
Conversation
scratch 全根 COW overlay 不应用 authPaths bind,agy 写在 ~/.gemini 下的 --log-file 落在 overlay 上层,worker 读宿主路径拿不到分叉回执,/fork 只能 超时失败。isForkCapableSession 现在对 antigravity 且会话实际跑在 scratch (含机器级 BOTMUX_SANDBOX=scratch)时直接拒绝。 Fixes #2762
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 12:14
This was referenced Nov 8, 2026
|
🚀 Released in v3.59.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2762
只处理 issue 建议 1(能力判定显式拒绝 antigravity × scratch);建议 2(让日志读取走 scratch 映射、完整支持)属于新能力,附带的契约注释不在本 PR 范围。
现象
Antigravity 会话跑在
sandbox: 'scratch'(含机器级BOTMUX_SANDBOX=scratch)时,/fork会被接受并进入分叉流程,但 worker 永远读不到 agy 的分叉回执,30 秒后以超时失败;用户看到的是「分叉失败/超时」而不是「不支持」。根因
agy 的
--log-file写在~/.gemini/antigravity-cli/botmux/下。scratch 是全根 COW overlay,不应用适配器的authPaths目录 bind(worker 的 scratch 启动分支不读authPaths,零注入闸也因同一原因拒绝 antigravity × scratch),写入落在 overlay 上层;worker 侧AntigravitySessionLog读的是宿主路径,看不到回执。isForkCapableSession只拒绝了 antigravity × 远端后端,没有拒绝 scratch。修复
isForkCapableSession对 antigravity 且会话实际沙箱为 scratch 时返回 false,/fork直接给出现有的「当前会话尚未接入 fork」提示(与 antigravity × 远端后端同一处理)。沙箱模式用 worker-pool 里已有的sessionCardSandboxMode(ds.session.sandbox, ds.reportedIdentityModel?.sandboxEngaged):它合并了会话冻结值与不会落进会话的机器级BOTMUX_SANDBOX强制,与 worker 实际解析一致。oncall 沙箱下~/.gemini是真实 bind,仍可分叉;其他 CLI 不受影响。验证
test/fork-session.test.ts新增:antigravity × 会话 scratch、antigravity ×BOTMUX_SANDBOX=scratch均拒绝(在未修改的 master 上红);antigravity × oncall、claude-code × scratch 仍可分叉。tsc --noEmit、npm run build通过;fork-session、command-handlervitest 624/624 通过(这两个文件使用importOriginal,按scripts/run-bun-tests.mjs的计算规则不在 bun 腿运行)。