docs(worktree): state that a worktree's Git directory needs a sandbox grant

This commit is contained in:
LegGasai committed 2026-11-17 19:51:55 +08:00
1 parent f9eb524891
commit 1292f95a13
6 files changed
+8 -4

No files matched your search

@@ -30,8 +30,8 @@
en: 2bc25a99e17789c4
zh: 4bec723fbf249d28
/deepseek-ai-dsh-experimental-client-ui-forge/known-limitations-and-deferred-work:
en: b4291ebabaec7b51
zh: ef6f4a707b104df0
en: b8bdacfa939a4aea
zh: 056c231dda99e764
/deepseek-ai-dsh-experimental-client-ui-forge/known-limitations-and-deferred-work/dev-note:
en: e67f633dc6fe7773
zh: 3bb0c20c93f16f98
@@ -157,6 +157,7 @@ None for a new worktree, as its notice belongs to the first request of the Sessi
- **Messages during a turn** — a message that enters while the Agent runs a turn or other maintenance gets no hold: a requested worktree is then created at the first step, where a failure ends the turn without the message, and a removed worktree is not checked, so the working-directory service moves the Session back to the project directory.
- **Waiting messages** — while a message waits, the Agent stays idle in maintenance and the composer offers no stop; the card's actions, the Agent's cancellation, or the Remote's stop release it, and callers that wait for the Agent to become idle wait as well.
- **Restoring** — restoring recreates the checkout from the branch, or from the commit the branch started from when the branch is gone; changes that were never committed are lost with the removed directory. The [worktree service](../worktree/README.md#use-this-package) validates the recorded target and removes only its missing, unlocked registration. An existing or incomplete directory stays blocked; preserve its files and remove the directory before retrying, or continue in the source project.
- **Linked-worktree projects** — the option is unavailable when the project is itself a linked worktree: under workspace-write its Git directory lies outside the writable root, so neither the new branch nor later commits could be written, and a sandbox-policy grant for that directory does not enable the option. Commits inside a created worktree need such a grant too, as the [worktree service](../worktree/README.md#known-limitations-and-deferred-work) describes.
- **Changes scopes** — deferred: a scope for the last turn. The Branch scope's Default needs a remote whose default branch HEAD shares history with, or a worktree the Session created; otherwise a base branch must be chosen.
- **Very many branches** — the base branch menu reads every ref before it filters, so a search can reach any branch. Refs over `maxDiffBytes`, about 165,000 at the default, or a listing over `gitTimeoutMs`, leave the menu saying that branches could not be read; Default keeps working.
- **Large changes** — a local patch over `maxDiffBytes` shows no files, and a change request diff over the size limit of the host or its provider shows no files and offers only View in browser. Without wrapping, the side-by-side view cuts long lines at the column edge.
@@ -157,6 +157,7 @@ Session 在所创建的 worktree 中工作时,`localDiff` 以它的 `baseCommi
- **一轮进行中的消息**——Agent 正在运行一轮或其他维护任务时进入的消息不会被暂留:所请求的 worktree 改为在第一步创建,失败时这一轮结束且不带这条消息;已删除的 worktree 不会被检查,工作目录服务会把 Session 移回项目目录。
- **等待中的消息**——消息等待期间,Agent 以空闲状态处于维护任务中,输入框不提供停止;只有卡片上的操作、Agent 的取消或 Remote 的停止能放行它,等待 Agent 空闲的调用方也会一并等待。
- **恢复**——恢复会从分支重新检出;分支也已删除时,从它开始时的提交重新创建。从未提交的修改随被删除的目录一起丢失。[worktree 服务](../worktree/README.zh.md#use-this-package)校验记录的目标,只移除该目标缺失且未锁定的登记。已有或未恢复完成的目录仍会阻止恢复;请先保存其中的文件并移除目录再重试,或在源项目继续。
- **链接 worktree 项目**——项目本身是链接 worktree 时该选项不可用:在 workspace-write 下它的 Git 目录位于可写根之外,新分支与之后的提交都无法写入,沙箱策略对该目录的授权也不会启用该选项。在创建出的 worktree 内提交同样需要这样的授权,见 [worktree 服务](../worktree/README.zh.md#known-limitations-and-deferred-work)的说明。
- **变更范围**——待办:上一轮的范围。“分支”范围的“默认”需要一个默认分支与 HEAD 有共同历史的远端,或 Session 创建的 worktree;否则必须选择基准分支。
- **分支极多**——基准分支菜单在筛选前读取全部引用,这样搜索才能找到任意分支。引用超过 `maxDiffBytes`(默认约 165,000 个)或列出时间超过 `gitTimeoutMs` 时,菜单提示无法读取分支;“默认”仍可使用。
- **大型变更**——本地补丁超过 `maxDiffBytes` 时不显示任何文件;超过托管平台或其提供方大小上限的变更请求 diff 不显示任何文件,只提供“在浏览器中查看”。不自动换行时,左右对比会在栏边截断长行。
@@ -30,8 +30,8 @@
en: 6826dfaadb24f3da
zh: 2e2ee715247fc015
/deepseek-ai-dsh-experimental-worktree/known-limitations-and-deferred-work:
en: d095a74827c8457d
zh: 7ec986f6426543a6
en: 63f85dec5f540e67
zh: 1d1b92e0462df41d
/deepseek-ai-dsh-experimental-worktree/known-limitations-and-deferred-work/dev-note:
en: ad12746a6cc96d8a
zh: 66275f30a35c88e4
+1
View File
@@ -97,6 +97,7 @@ This package contributes no prompt text. Its consumers own the appended tool res
- **Local revisions unless asked** — creation fetches only the one remote branch a request asks for; it does not fetch other commits or missing partial-clone objects, initialize submodules, install dependencies, or copy uncommitted files. On Git that meets the execution requirements, missing local objects cause creation to fail.
- **Filtered representations** — checkout skips configured filters to avoid executing repository-configured programs or triggering implicit downloads. Git LFS pointers and encrypted blobs stay in their stored representation; hydration or decryption is a separate user-controlled operation.
- **Execution requirements** — the subprocess provider must offer Git and Node in the same execution world as the filesystem provider. Git must honor `GIT_NO_LAZY_FETCH`, which Git 2.45 and the 2.39.4, 2.40.2, 2.41.1, 2.42.2, 2.43.4, and 2.44.1 maintenance releases do; older releases ignore it and proceed instead of failing, so creation can fetch missing partial-clone objects from a promisor remote. The `git --no-lazy-fetch` option would reject these releases, but it exists only in Git 2.45 and later and also rejects the patched maintenance releases. The existing sandbox must permit all checkout and shared Git metadata writes.
- **Commits inside a worktree** — the repository's Git directory lies outside a linked worktree, so under `workspace-write` a Session that works in one cannot run `git add` or `git commit`, or create another worktree from it, until the [sandbox policy](../../sandbox/sandbox-policy/README.md#use-this-package) grants that directory through `additionalWritableRoots` or `registerWritableRoot`. This service registers no grant, and Windows processes ignore such grants.
<a id="dev-note"></a>
### Dev Note
@@ -97,6 +97,7 @@ Git 与目录分配通过挂载的子进程及沙箱提供方执行,沿用调
- **默认仅限本地提交**——创建操作只获取请求指定的那一个远程分支,不会获取其他远端提交或部分克隆中缺失的对象、初始化子模块、安装依赖或复制未提交文件。Git 满足执行要求时,本地对象缺失会导致创建失败。
- **过滤器处理前的内容**——检出时跳过已配置的过滤器,以避免执行仓库配置的程序或隐式下载。Git LFS 指针与加密 blob 保持存储时的形式;拉取实体内容或解密由用户另行执行。
- **执行要求**——子进程提供方必须在与文件系统提供方相同的执行环境中提供 Git 与 Node。Git 必须识别 `GIT_NO_LAZY_FETCH`:Git 2.45 及 2.39.4、2.40.2、2.41.1、2.42.2、2.43.4、2.44.1 维护版本均支持;更早的版本会忽略该变量并继续执行而不报错,因此创建操作可能从 promisor 远程获取缺失的部分克隆对象。`git --no-lazy-fetch` 选项会拒绝这些版本,但它仅在 Git 2.45 及以后存在,也会拒绝上述已修补的维护版本。现有沙箱必须允许写入检出目录与共享 Git 元数据。
- **在工作树内提交**——仓库的 Git 目录位于链接工作树之外,因此在 `workspace-write` 下,在其中工作的 Session 不能运行 `git add` 或 `git commit`,也不能从中再创建工作树,直到[沙箱策略](../../sandbox/sandbox-policy/README.zh.md#use-this-package)通过 `additionalWritableRoots` 或 `registerWritableRoot` 授权该目录。本服务不注册任何授权,Windows 的进程忽略这类授权。
<a id="dev-note"></a>
### 开发备注