diff --git a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.i18n.yaml b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.i18n.yaml
index 5a1a0d4b5a..48081d0c7b 100644
--- a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.i18n.yaml
+++ b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.i18n.yaml
@@ -9,11 +9,11 @@
en: 31fba384d90ce7d2
zh: f8b814868f3280c3
/agent-note-session-working-directory/decision:
- en: f8af193899e790ad
- zh: b3df4a59727ff3a3
+ en: b0b21465b53e7047
+ zh: db3bfced492dcefe
/agent-note-session-working-directory/alternatives-considered:
en: f0995feb9b6bcce8
zh: 97417085fd17f70f
/agent-note-session-working-directory/consequences:
- en: 2dd3a4de72ee6d74
- zh: be5d8a80c8eaac6e
+ en: da8ef050c25c7a7b
+ zh: 8c9c1ca7467f986e
diff --git a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.md b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.md
index bec052f9ec..0275fafb17 100644
--- a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.md
+++ b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.md
@@ -10,13 +10,13 @@ A fixed Session creation directory cannot represent a task that changes checkout
## Decision
-`dsh-working-directory` owns one logged effective directory per Session. Its projection initializes from the immutable original project and folds `working-directory/change`; consumers read that owner instead of deriving execution paths from the header or sandbox root. Directory changes validate through the filesystem provider, serialize within the Session, and publish only after the new directory is available. The [workspace-root note](2026-11-03-session-workspace-root.md) adds the workspace root and its anchors on top of this owner.
+`dsh-working-directory` owns one logged effective directory per Session. Its projection initializes from the immutable original project and folds `working-directory/change`; consumers read that owner instead of deriving execution paths from the header or sandbox root. Directory changes validate through the filesystem provider, serialize within the Session, and publish only after the new directory is available.
-The `dsh-base` composition mounts `working_directory({ cd? })` globally. The tool reads or changes the Session directory, so every Agent preset can select or recover it, including presets without file-editing tools. The Web composition keeps action tools in preset scopes.
+Only Host operations change the directory: worktree creation and exit, the forge panel, SDK requests, and child startup call the service. The [workspace-root note](2026-11-03-session-workspace-root.md) removed the model-facing `working_directory` tool and adds the workspace root on top of this owner.
Required user-context snapshots carry the current value; each committed change attempts to queue a notice through the ordinary Agent inbox. Cancellation or disposal may discard unadmitted notices while the directory event survives for subsequent requests. The original project is the recovery destination when the selected directory disappears. Missing recovery destinations produce an error. Write permissions remain independent.
-Subagents capture the parent's current directory or an explicit override and commit their selected directory after inherited history. Existing processes, terminals, and persistent shells keep their process-local directory. Project instructions, skills, and completion follow the effective directory without changing Session identity, grouping, or runtime composition.
+Subagents start in the parent's workspace root or a Host-chosen directory and commit that directory after inherited history. Existing processes, terminals, and persistent shells keep their process-local directory. Project instructions, skills, and completion follow the effective directory without changing Session identity, grouping, or runtime composition.
Live Session skill catalogs and file completion validate through the same directory owner. These reads can commit recovery and queue its notice before discovery, keeping discovered files and subsequent operations tied to the committed Session directory. Cold skill catalogs read the recorded projection without activating an Agent.
@@ -44,4 +44,4 @@ The runtime exposes one directory owner and preserves the original project. Cons
`{{cwd}}` has no loop-provided value; custom personas that depend on that built-in fail strict interpolation. Deployments remove those references using the [system-prompt migration guidance](../../../../packages/core/system-prompt/README.md). When both the current directory and its recovery destination are unavailable, prompt assembly rejects model turns; the [directory service recovery guidance](../../../../packages/session/working-directory/README.md#known-limitations-and-deferred-work) requires restoring the directory or selecting an existing absolute directory through the SDK or host service.
-Verification covers independent Sessions, relative changes, replay, cancellation, recovery, tool disposal, user-context rendering, provider inheritance, and real directory-based operations.
+Verification covers independent Sessions, relative changes, replay, cancellation, recovery, user-context rendering, provider inheritance, and real directory-based operations.
diff --git a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.zh.md b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.zh.md
index e5254d9525..90f55494e8 100644
--- a/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.zh.md
+++ b/.agents/notes/implemented/architecture/2026-09-13-session-working-directory.zh.md
@@ -10,13 +10,13 @@ Status: implemented
## Decision
-`dsh-working-directory` 拥有每个 Session 的一个日志化有效目录。投影从不可变的原始项目初始化,并折叠 `working-directory/change`;消费者读取该服务,而不是从 header 或沙箱根目录派生执行路径。目录变更通过文件系统 provider 验证,在 Session 内串行执行,并只在新目录可用后发布。[工作区根记录](2026-11-03-session-workspace-root.zh.md)在该服务之上增加工作区根及其锚。
+`dsh-working-directory` 拥有每个 Session 的一个日志化有效目录。投影从不可变的原始项目初始化,并折叠 `working-directory/change`;消费者读取该服务,而不是从 header 或沙箱根目录派生执行路径。目录变更通过文件系统 provider 验证,在 Session 内串行执行,并只在新目录可用后发布。
-`dsh-base` 组合在全局挂载 `working_directory({ cd? })`。该工具读取或改变 Session 目录,使每个 Agent preset 都能选择或恢复它,包括没有文件编辑工具的 preset。Web 组合把操作工具放在 preset 作用域中。
+只有 Host 操作改变目录:工作树的创建与退出、forge 面板、SDK 请求和子代理启动调用该服务。[工作区根记录](2026-11-03-session-workspace-root.zh.md)移除了面向模型的 `working_directory` 工具,并在该服务之上增加工作区根。
必需的用户上下文快照携带当前值;每次已提交变更都会尝试通过普通 Agent 收件箱排入通知。取消或销毁可能丢弃尚未进入请求的通知,但目录事件仍然保留,供后续请求使用。所选目录消失时恢复到原始项目。恢复目录也消失时返回错误。写权限保持独立。
-子代理捕获父代理当前目录或显式覆盖值,并在继承历史之后提交选定目录。已有进程、终端和持久 shell 保留进程局部目录。项目指令、技能和补全跟随有效目录,不改变 Session 身份、归属或运行时组合。
+子代理从父代理的工作区根或 Host 选定的目录启动,并在继承历史之后提交该目录。已有进程、终端和持久 shell 保留进程局部目录。项目指令、技能和补全跟随有效目录,不改变 Session 身份、归属或运行时组合。
活跃 Session 的技能目录与文件补全通过同一个目录 owner 验证目录。这些读取可在发现操作之前提交恢复并排入通知,使发现的文件与后续操作关联到已提交的 Session 目录。冷态技能目录读取已记录的投影,不激活 Agent。
@@ -44,4 +44,4 @@ Playwright MCP 和 Chrome DevTools MCP 在获取 Session 的 MCP 连接时验证
`{{cwd}}` 没有循环提供的值;依赖该内置变量的自定义 persona 会触发严格插值错误。部署方按照[系统提示词迁移说明](../../../../packages/core/system-prompt/README.zh.md)移除这些引用。当前目录与恢复目标均不可用时,提示词组装会拒绝模型轮次;[目录服务恢复说明](../../../../packages/session/working-directory/README.zh.md#known-limitations-and-deferred-work)要求恢复目录,或通过 SDK 或 Host 服务选择现有的绝对目录。
-验证覆盖 Session 相互独立、相对路径变更、回放、取消、恢复、工具卸载、用户上下文渲染、provider 继承和真实目录操作。
+验证覆盖 Session 相互独立、相对路径变更、回放、取消、恢复、用户上下文渲染、provider 继承和真实目录操作。
diff --git a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.i18n.yaml
index 4585409abf..c9c3f36fa5 100644
--- a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.i18n.yaml
+++ b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.i18n.yaml
@@ -6,17 +6,17 @@
en: f746e6645bc11001
zh: b7666200c98a96fc
/agent-note-session-workspace-root/problem:
- en: cb5864da99a92145
- zh: 210f8b4282f99c93
+ en: 6938aa715106bb99
+ zh: ea1497b337712f33
/agent-note-session-workspace-root/decision:
- en: 60855fdb6841d31b
- zh: 57aa5b7d6144b241
+ en: 3fcf4ed62fe298c3
+ zh: 777bc781a98e46dd
/agent-note-session-workspace-root/deferred:
en: d8167590081dfa4e
- zh: 208630aac853773b
+ zh: a030f78230192206
/agent-note-session-workspace-root/alternatives-considered:
- en: 9d267bf955897821
- zh: 45b7d2cddd34a811
+ en: 24bd791e873a2d77
+ zh: a438f9c32a248987
/agent-note-session-workspace-root/consequences:
- en: 4673562879041fdf
- zh: de26d6177e58d64e
+ en: e37708b555352f37
+ zh: cd7a00ae6d0e65c0
diff --git a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md
index b3726fb9c3..e22104d53e 100644
--- a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md
+++ b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md
@@ -6,15 +6,15 @@ English | [中文](2026-11-03-session-workspace-root.zh.md)
## Problem
-A Session that enters a Git worktree records only a changed current directory. The same event records an ordinary `cd` into a subdirectory, so a consumer cannot tell a moved cursor from a changed checkout: a file view, a change summary, or a write boundary either follows every `cd` or stays on the original project. The original project is the only directory the header records, and a Session opened inside a linked worktree records nothing about the checkout it is in. Peer products that support entering another checkout in one conversation keep an immutable session origin and record each relocation as an event, and they separate the shell cursor from the checkout it is in.
+A Session that enters a Git worktree records only a changed current directory. The `working_directory` tool recorded the same event for a model's `cd` into a subdirectory or out of the project, so a consumer could not tell a model-moved cursor from a changed checkout: a file view, a change summary, or a write boundary either followed every `cd` or stayed on the original project. Usage did not justify the cursor: in 58 recorded Sessions of one developer that offered the tool, the model called it once in 6,229 tool calls and prefixed 61% of its shell commands with `cd`.
## Decision
-Each Session has three directories with one owner each. `header.cwd` remains the immutable original project: Session identity, workspace grouping, and the recovery destination. `dsh-working-directory` owns the other two. The current directory is the cursor relative paths resolve from; its `workingDirectory` projection and `set` are unchanged. The workspace root is the checkout that cursor is in; the `workspaceRoot` projection folds it from the same `working-directory/change` events as the longest registered anchor containing the current directory. The anchors are the original project and every checkout `relocate(agent, root, { cwd? })` entered.
+A Session works in one directory, and only Host operations move it. The model-facing `working_directory` tool and the `cwd` parameter of the delegation tools are removed; the model reaches a subdirectory through paths and the shell's per-call `workdir`. `header.cwd` remains the immutable original project: Session identity, workspace grouping, and the recovery destination. `dsh-working-directory` owns the directory. Every change it records, through `set` or the recovery of `ensure`, carries `workspace: true`, and the `workspaceRoot` projection is the directory of the last marked change, or the original project before any. `rootOf` therefore equals `get` in every Session started from this version on.
-`relocate` validates the root and the directory inside it, then commits one `working-directory/change` whose optional `anchor` names the root. A `set` inside the root moves only the cursor; a `set` into another anchor selects that anchor as the root; a `set` outside every anchor moves the cursor and leaves the root. Recovery to the original project selects it again. The event's optional property is a same-version persistence change recorded in the [acknowledgement](../../../../docs/persistence-changes/2026-11-03-working-directory-anchor.md); a log without `anchor` folds to the original project as its only anchor.
+The marker is an optional property, recorded as a same-version persistence change in the [acknowledgement](../../../../docs/persistence-changes/2026-11-11-working-directory-workspace.md). A change without it, written while the model could move the directory, moves only the current directory, so a stored Session keeps the root it had.
-Worktree creation enters the checkout through `relocate`; leaving it is the existing `set` back into the original project, which the anchor rule turns into a root change. A child subagent keeps the parent's original project in its header and starts its directories through the service's `inherit`, which owns the decision: when the parent's root is another registered checkout and the child starts inside it, the child relocates into that root; otherwise only its directory is set. The child's root is then that checkout unless the original project its header registers already contains the child's directory, because the root is always the longest containing anchor; the child registers no other parent anchor, so a later `cd` into another checkout the parent entered leaves the child's root unchanged. The user-context snapshot adds a `Workspace root` line while the cursor differs from the root, and a change notice ends with the new root when the change selects another root. The SDK working-directory methods return `{ cwd, root }`, and `getWorkspaceRoot` (`get_workspace_root` in Python) reads the root.
+Worktree creation enters the checkout through `set`. `ctx.worktrees.exit`, exposed to the model as `exit_worktree`, returns the Session to the source checkout of the recorded worktree that contains its directory. A child subagent keeps the parent's original project in its header and starts, through `set`, in the parent's workspace root or a Host-chosen directory.
## Deferred
@@ -22,16 +22,18 @@ The sandbox write boundary, the workspace file service, desktop file drag, the c
## Alternatives considered
-**Rewrite the header on relocation.** The header is identity metadata for storage, grouping, and permission roots; the [working-directory note](2026-09-13-session-working-directory.md) rejected rewriting it, and every peer product keeps an immutable origin.
+**Keep the cursor and derive the root from registered anchors.** An optional `anchor` on the change, an anchor list, and a longest-containing-anchor rule separate a model's `cd` from a changed checkout, at the cost of three directories, a relocation operation, and an inheritance rule for children. Removing the only model-facing mover makes that separation unnecessary.
-**A new event type for relocation.** Adding an ordinary event type is also same-version, but an older reader refuses to reconstruct a log holding an unknown required event, so a Session that entered a worktree would not open there. An optional property on the existing event leaves older readers with the current directory they already understood.
+**Derive the root from the worktree plugin's creation record.** That record is an ignorable experimental plugin record, which a format migration keeps only on a best-effort basis; a released package must not derive a write boundary from it.
-**Let the root follow every `cd`.** A `cd` into `packages/foo` would re-root the file tree and shrink the write boundary to that subdirectory while the user still works on the same project.
+**Rewrite the header on relocation.** The header is identity metadata for storage, grouping, and permission roots; the [working-directory note](2026-09-13-session-working-directory.md) rejected rewriting it.
-**Derive the root from Git at read time.** The directory service would need Git and filesystem I/O inside a projection; anchors and lexical containment are pure and deterministic over the log.
+**A new event type for the workspace move.** An older reader refuses to reconstruct a log holding an unknown required event, and an ignorable event may carry only information whose loss cannot affect reconstruction. An optional property on the existing event leaves older readers with the current directory they already understood.
-**One new Session per worktree, never a relocation.** The model-facing worktree tool already continues one Session in the new checkout; forge's new-Session worktree path and that tool both resolve to the same relocation.
+**Persist the shell's `cd` between calls.** That is an implicit cursor. In that developer's Sessions, 68% of `cd` prefixes named a directory outside the Session directory and 30% the Session directory itself, so a persisted directory confined to the workspace would apply to about 2%.
+
+**Read stored changes as workspace moves.** A stored model `cd` would narrow or move the write boundary of an existing Session; a log that lacks a feature keeps its old behavior.
## Consequences
-Consumers can ask the directory service three questions with three answers: where the Session started, which checkout it works in, and where relative paths resolve. Existing logs change meaning for no reader: they hold no anchor, so the root is the original project. Anchors compare lexically, so the ACP, SDK, and Web producers record the original project by its canonical spelling, a Session without a recorded project registers the deployment fallback as its first anchor on first validation or relocation, and a recovery destination no anchor contains joins the anchors. A header recorded by another spelling before that change keeps the previous root after a `cd` back into the original project until recovery registers the canonical destination. The worktree snapshot fixture and the directory notices carry the root text. Moving the consumers listed under Deferred is a separate change.
+Consumers read one directory: `get` for relative paths and `rootOf` for everything that belongs to the workspace. The two differ only in a Session that holds unmarked changes, and the next Host move brings them together. A later cursor needs no format change, because an unmarked change already moves only the directory. The model can no longer enter a checkout it created through the shell; entering a checkout is a Host operation. The ACP, SDK, and Web producers record the original project by its canonical spelling, so a Host move back to it records no change. The worktree snapshot fixture covers entering, leaving, and losing a worktree. Moving the consumers listed under Deferred is a separate change.
diff --git a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md
index b4a858ab68..85d84d6574 100644
--- a/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md
+++ b/.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md
@@ -6,32 +6,34 @@ Status: implemented
## Problem
-进入 Git 工作树的 Session 只记录了当前目录的变化。同一事件也记录普通的 `cd` 进入子目录,因此消费方无法区分移动的光标与换掉的检出目录:文件视图、变更摘要或写边界要么跟随每次 `cd`,要么停留在原始项目上。header 只记录原始项目这一个目录,而直接在链接工作树内打开的 Session 不记录它所在的检出目录。支持在一段对话内进入另一个检出目录的同类产品都保留不可变的会话起点,把每次迁移记录为事件,并把 shell 光标与它所在的检出目录区分开。
+进入 Git 工作树的 Session 只记录当前目录的变化。`working_directory` 工具在模型 `cd` 进子目录或离开项目时记录的是同一种事件,消费方因此无法区分模型移动的光标和已切换的检出:文件视图、变更汇总或写边界要么跟随每一次 `cd`,要么停留在原始项目。实际用法也不支持保留光标:在一位开发者的 58 个提供该工具的已记录 Session 中,模型在 6,229 次工具调用里只调用了它一次,61% 的 shell 命令自带 `cd` 前缀。
## Decision
-每个 Session 有三个目录,各有一个所有者。`header.cwd` 仍是不可变的原始项目:Session 身份、工作区分组和恢复目的地。`dsh-working-directory` 拥有另外两个。当前目录是相对路径解析的光标;它的 `workingDirectory` 投影与 `set` 不变。工作区根是该光标所在的检出目录;`workspaceRoot` 投影从同样的 `working-directory/change` 事件折叠出它,取包含当前目录的最长已登记锚。锚是原始项目以及 `relocate(agent, root, { cwd? })` 进入过的每个检出目录。
+一个 Session 在一个目录中工作,只有 Host 操作移动它。面向模型的 `working_directory` 工具与委派工具的 `cwd` 参数被移除;模型通过路径和 shell 的单次调用参数 `workdir` 到达子目录。`header.cwd` 仍是不可变的原始项目:Session 身份、工作区归属和恢复目的地。`dsh-working-directory` 拥有该目录。它通过 `set` 或 `ensure` 的恢复记录的每次变更都带有 `workspace: true`,`workspaceRoot` 投影是最近一条带标记变更的目录,在此之前是原始项目。因此从这个版本起启动的每个 Session 中,`rootOf` 都等于 `get`。
-`relocate` 验证根及其内部的目录,然后提交一条可选 `anchor` 指向该根的 `working-directory/change`。根内部的 `set` 只移动光标;进入另一个锚的 `set` 把该锚选为根;所有锚之外的 `set` 移动光标并保留根。恢复到原始项目时再次把它选为根。事件的可选属性是一次同版本持久化变更,记录在[确认记录](../../../../docs/persistence-changes/2026-11-03-working-directory-anchor.zh.md)中;没有 `anchor` 的日志折叠后以原始项目为唯一的锚。
+该标记是可选属性,作为同版本持久化变更记录在[确认记录](../../../../docs/persistence-changes/2026-11-11-working-directory-workspace.zh.md)中。不带标记的变更写于模型还能移动目录的时期,它只移动当前目录,因此已存储的 Session 保持原有的根。
-工作树创建通过 `relocate` 进入检出目录;离开它就是既有的 `set` 回到原始项目,锚规则将其变为根的变化。子代理在 header 中保留父级的原始项目,并通过服务的 `inherit` 启动目录,由它做出决定:当父级的根是另一个已登记的检出目录且子级在其中启动时,子级迁入该根;否则只设置目录。子级的根随即是该检出目录,除非其 header 登记的原始项目本身已包含子级目录,因为根始终是包含目录的最长锚;子级不登记父级的其他锚,因此之后 `cd` 进父级进入过的另一个检出目录时子级的根不变。光标与根不同时,用户上下文快照增加一行 `Workspace root`,选中另一个根的变更在通知末尾给出新根。SDK 的工作目录方法返回 `{ cwd, root }`,`getWorkspaceRoot`(Python 中为 `get_workspace_root`)读取根。
+工作树创建通过 `set` 进入检出目录。`ctx.worktrees.exit` 以 `exit_worktree` 的形式提供给模型,它找到包含 Session 目录的已记录工作树,把 Session 送回其源检出。子代理的 header 保留父级的原始项目,并通过 `set` 从父级的工作区根或 Host 选定的目录启动。
## Deferred
-沙箱写边界、工作区文件服务、桌面文件拖拽、变更记录器,以及客户端的文件树、交付物、在应用中打开操作和 Session 行仍读取 `header.cwd`。侧栏终端、`@` 文件候选、技能目录、项目指令发现和 LSP 工作区仍读取当前目录,尽管它们属于根。在这些消费方迁移之前,它们的行为与本决策之前相同,原始项目之外的工作树仅在原始项目的边界已经允许之处可写。
+沙箱写边界、工作区文件服务、桌面文件拖拽、变更记录器,以及客户端文件树、交付物、在应用中打开的操作和 Session 行仍然读取 `header.cwd`。侧栏终端、`@` 文件候选、技能目录、项目指令发现和 LSP 工作区虽然属于根,仍然读取当前目录。在这些消费方迁移之前,它们的行为与本决策之前相同,位于原始项目之外的工作树只有在原始项目的边界已经允许时才可写。
## Alternatives considered
-**迁移时改写 header。** header 是用于存储、分组和权限根的身份元数据;[工作目录记录](2026-09-13-session-working-directory.zh.md)否决了改写它,所有同类产品也都保留不可变的起点。
+**保留光标,从已登记的锚推导根。** 在变更上增加可选的 `anchor`、维护锚列表并取包含目录的最长锚,可以区分模型的 `cd` 与检出切换,代价是三个目录、一个重定位操作和一条子会话继承规则。移除唯一面向模型的移动入口之后,这种区分不再必要。
-**为迁移新增事件类型。** 新增普通事件类型同样是同版本变更,但旧读者遇到未知的必需事件会拒绝重建日志,进入过工作树的 Session 在旧读者那里将无法打开。在既有事件上增加可选属性让旧读者保留它们本已理解的当前目录。
+**从工作树插件的创建记录推导根。** 该记录是可忽略的实验性插件记录,格式迁移只尽力保留;已发布的包不能据此推导写边界。
-**让根跟随每次 `cd`。** `cd` 进入 `packages/foo` 会把文件树重新定根并把写边界缩到该子目录,而用户仍在同一个项目上工作。
+**重定位时改写 header。** header 是存储、归属与权限根使用的身份元数据;[工作目录记录](2026-09-13-session-working-directory.zh.md)已否决改写它。
-**读取时从 Git 推导根。** 目录服务需要在投影内使用 Git 和文件系统 I/O;锚与词法包含关系对日志而言是纯粹且确定的。
+**为工作区移动新增事件类型。** 旧读者遇到未知的必需事件会拒绝重建日志,而可忽略事件只能承载丢失后不影响重建的信息。在现有事件上增加可选属性,旧读者得到的仍是它已经理解的当前目录。
-**每个工作树一个新 Session,从不迁移。** 面向模型的工作树工具已经让同一个 Session 在新检出目录中继续;forge 的新 Session 工作树路径与该工具最终都落到同一种迁移。
+**在调用之间保留 shell 的 `cd`。** 这是一个隐式的光标。在该开发者的 Session 中,68% 的 `cd` 前缀指向 Session 目录之外,30% 指向 Session 目录本身,限制在工作区内的保留只对约 2% 生效。
+
+**把已存储的变更读作工作区移动。** 已存储的模型 `cd` 会收窄或移动现有 Session 的写边界;缺少某项特性的日志保持旧行为。
## Consequences
-消费方可以向目录服务提出三个问题并得到三个答案:Session 从哪里开始、在哪个检出目录中工作、相对路径从哪里解析。既有日志对任何读者的含义都不变:它们没有锚,因此根就是原始项目。锚按词法比较,因此 ACP、SDK 与 Web 生产方以规范拼写记录原始项目,没有记录项目的 Session 在首次校验或迁移时把部署回退目录登记为第一个锚,恢复目的地不在任何锚内时也加入锚。在此之前以其他拼写记录的 header,在 `cd` 回原始项目后保留先前的根,直到恢复把规范目的地登记为锚。工作树快照夹具与目录通知携带根的文本。迁移 Deferred 中列出的消费方是另一次变更。
+消费方读取一个目录:相对路径用 `get`,属于工作区的一切用 `rootOf`。两者只在含有未标记变更的 Session 中不同,下一次 Host 移动会让它们重新一致。以后增加光标不需要改格式,因为未标记的变更本来就只移动目录。模型不能再进入它通过 shell 创建的检出;进入检出是 Host 操作。ACP、SDK 与 Web 的生产方以规范拼写记录原始项目,因此 Host 移回原始项目时不记录变更。工作树快照夹具覆盖进入、离开和失去工作树。迁移 Deferred 中列出的消费方是另一项变更。
diff --git a/apps/cli/composition.md b/apps/cli/composition.md
index 1fa22d5a13..a31ef1127f 100644
--- a/apps/cli/composition.md
+++ b/apps/cli/composition.md
@@ -68,8 +68,6 @@ flowchart LR
cfg --> plugin_dsh_base_session_query_sqlite
plugin_dsh_base_working_directory["working-directory
@deepseek-ai/dsh-working-directory"]
cfg --> plugin_dsh_base_working_directory
- plugin_dsh_base_tool_working_directory["tool-working-directory
@deepseek-ai/dsh-tool-working-directory"]
- cfg --> plugin_dsh_base_tool_working_directory
plugin_dsh_base_session_projection["session-projection
@deepseek-ai/dsh-session-projection"]
cfg --> plugin_dsh_base_session_projection
plugin_dsh_base_storage["storage
@deepseek-ai/dsh-storage"]
@@ -240,7 +238,6 @@ flowchart LR
| `attachment-local` | `@deepseek-ai/dsh-attachment-local` |
| `session-query-sqlite` | `@deepseek-ai/dsh-session-query-sqlite` |
| `working-directory` | `@deepseek-ai/dsh-working-directory` |
-| `tool-working-directory` | `@deepseek-ai/dsh-tool-working-directory` |
| `session-projection` | `@deepseek-ai/dsh-session-projection` |
| `storage` | `@deepseek-ai/dsh-storage` |
| `storage-json` | `@deepseek-ai/dsh-storage-json` |
diff --git a/apps/cli/reference/README.i18n.yaml b/apps/cli/reference/README.i18n.yaml
index 2c33416553..70a801fda1 100644
--- a/apps/cli/reference/README.i18n.yaml
+++ b/apps/cli/reference/README.i18n.yaml
@@ -21,8 +21,8 @@
en: 8d2cfff9bab7327f
zh: 21515ab6e6798504
/dsh-cli-behavior-reference/web-profile:
- en: 149c5571acd51baf
- zh: 300e3c2425273a92
+ en: f2a9b3506fc33673
+ zh: 8a972d5639f95a66
/dsh-cli-behavior-reference/shared-deployment-behavior:
en: f02219118dcec531
zh: fe2977628d7340da
diff --git a/apps/cli/reference/README.md b/apps/cli/reference/README.md
index dc84a267d8..04f2a3fdc8 100644
--- a/apps/cli/reference/README.md
+++ b/apps/cli/reference/README.md
@@ -132,7 +132,7 @@ The base-backed modes treat the invoking directory as the default workspace root
New sessions in base-backed profiles default to the `workspace-write` permission preset. Bash and filesystem mutations are restricted to the session workspace and platform temporary roots; reads and network access are not confined, while process visibility depends on the selected sandbox backend — bwrap runs commands in a private PID namespace that hides host processes, and Landlock and Seatbelt leave host process visibility unchanged. `DSH_PERMISSION_MODE` changes the process fallback. Stored General-settings permissions affect later Web sessions, not an already-open one. The standalone `sdk-minimal` tree instead pins `danger-full-access` and mounts no approval or permission-settings service.
-Web, headless, and SDK inherit native tool execution from the base bundle; use a [PTC overlay](../config/examples/ptc.yml) to select PTC. The shipped `minimal` agent preset keeps that deployment presentation, fixes the complete system prompt to `You are a helpful software engineer assistant.`, and provides the platform-selected persistent shell, `read_image`, and `working_directory`. It supports automatic context compaction and the human `/compact` command. Select 极简模式 when creating a Web session; the shared browser, workspace, persistence, sandbox, and permission host remains in place.
+Web, headless, and SDK inherit native tool execution from the base bundle; use a [PTC overlay](../config/examples/ptc.yml) to select PTC. The shipped `minimal` agent preset keeps that deployment presentation, fixes the complete system prompt to `You are a helpful software engineer assistant.`, and provides the platform-selected persistent shell and `read_image`. It supports automatic context compaction and the human `/compact` command. Select 极简模式 when creating a Web session; the shared browser, workspace, persistence, sandbox, and permission host remains in place.
## Shared deployment behavior
diff --git a/apps/cli/reference/README.zh.md b/apps/cli/reference/README.zh.md
index 2de7755983..80bc88c40a 100644
--- a/apps/cli/reference/README.zh.md
+++ b/apps/cli/reference/README.zh.md
@@ -132,7 +132,7 @@ dsh web --help
基于 base 的 profile 中,新会话默认使用 `workspace-write` 权限预设。Bash 和文件系统修改仅限于会话 workspace 与平台临时根目录;读取和网络访问不受限制,进程可见性则取决于所选沙箱后端——bwrap 在私有 PID 命名空间中运行命令并隐藏宿主进程,Landlock 与 Seatbelt 保持宿主进程可见性不变。`DSH_PERMISSION_MODE` 更改进程后备值。General settings 中存储的权限影响后续 Web 会话,不改变已打开的会话。独立的 `sdk-minimal` 配置树则固定为 `danger-full-access`,且不挂载 approval 或权限 settings 服务。
-Web、headless 与 SDK 继承 base bundle 的原生工具执行;使用 [PTC overlay](../config/examples/ptc.yml) 可选择 PTC。随附的 `minimal` agent preset 会保留该部署的呈现方式,将完整系统提示词固定为 `You are a helpful software engineer assistant.`,并提供按平台选择的持久 shell、`read_image` 和 `working_directory`。它支持自动上下文压缩和用户 `/compact` 命令。创建 Web 会话时请选择极简模式;共享的浏览器、workspace、持久化、沙箱与权限宿主保持不变。
+Web、headless 与 SDK 继承 base bundle 的原生工具执行;使用 [PTC overlay](../config/examples/ptc.yml) 可选择 PTC。随附的 `minimal` agent preset 会保留该部署的呈现方式,将完整系统提示词固定为 `You are a helpful software engineer assistant.`,并提供按平台选择的持久 shell 和 `read_image`。它支持自动上下文压缩和用户 `/compact` 命令。创建 Web 会话时请选择极简模式;共享的浏览器、workspace、持久化、沙箱与权限宿主保持不变。
## 共享部署行为
diff --git a/apps/cli/tests/built-bin.e2e.ts b/apps/cli/tests/built-bin.e2e.ts
index 1c8765d268..50d7faa60d 100644
--- a/apps/cli/tests/built-bin.e2e.ts
+++ b/apps/cli/tests/built-bin.e2e.ts
@@ -1272,7 +1272,6 @@ describe.skipIf(!existsSync(dshBin))('dsh BUILT bin (node lib/bin.js, no tsx)',
['attachment-local', '@deepseek-ai/dsh-attachment-local'],
['tool-fs', '@deepseek-ai/dsh-tool-fs'],
['working-directory', '@deepseek-ai/dsh-working-directory'],
- ['tool-working-directory', '@deepseek-ai/dsh-tool-working-directory'],
['session-projection', '@deepseek-ai/dsh-session-projection'],
['token-meter', '@deepseek-ai/dsh-token-meter'],
['compaction-basic', '@deepseek-ai/dsh-compaction-basic'],
diff --git a/apps/cli/tests/optional-bundle-transitions.e2e.ts b/apps/cli/tests/optional-bundle-transitions.e2e.ts
index c63adb0823..45d1c3f4ed 100644
--- a/apps/cli/tests/optional-bundle-transitions.e2e.ts
+++ b/apps/cli/tests/optional-bundle-transitions.e2e.ts
@@ -171,8 +171,8 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
it('keeps the default host and minimal tool catalogs while every optional bundle is off', async () => {
const minimal = await agent('minimal')
const standard = await agent()
- expect(names()).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
- expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(names()).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
+ expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
for (const name of ['str_replace_editor', 'session_search', 'terminal_open', 'user_terminal_list', 'ralph']) expect(names(standard.agent)).not.toContain(name)
expect((await ctx.skills.list({ cwd: workspace, scope: standard.agent })).some(skill => skill.name === 'dsh-badge')).toBe(false)
})
@@ -246,7 +246,7 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
expect(toolResult(owner.agent, 'badge-on')).toContain('dsh-badge.png')
const minimal = await agent('minimal')
expect((await ctx.skills.list({ cwd: workspace, scope: minimal.agent })).map(skill => skill.name)).toContain('dsh-badge')
- expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(names(minimal.agent)).toEqual([process.platform === 'win32' ? 'pwsh' : 'bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
await select(bundles.badge, false)
expect((await load('badge-after')).isError).toBe(true)
})
@@ -346,7 +346,7 @@ describe.skipIf(!existsSync(join(root, 'apps/cli/lib/bin.js')))('Official option
])
expect(toolResult(coded, 'combined-program')).toContain(coded.session.id)
expect(toolResult(coded, 'combined-program')).toContain('dsh-badge')
- expect(names()).toEqual(expect.arrayContaining(['session_search', 'terminal_open', 'ralph', 'working_directory']))
+ expect(names()).toEqual(expect.arrayContaining(['session_search', 'terminal_open', 'ralph']))
for (const name of [...Object.values(bundles)].reverse()) await select(name, false)
expect(names((await agent()).agent)).not.toContain('session_search')
})
diff --git a/apps/cli/tests/profiles/headless/tests/expected/subagent-inheritance/parent.expected.jsonl b/apps/cli/tests/profiles/headless/tests/expected/subagent-inheritance/parent.expected.jsonl
index a7352b5dd7..7b11a97e74 100644
--- a/apps/cli/tests/profiles/headless/tests/expected/subagent-inheritance/parent.expected.jsonl
+++ b/apps/cli/tests/profiles/headless/tests/expected/subagent-inheritance/parent.expected.jsonl
@@ -17,8 +17,8 @@
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[2],"surfaceOp":{"op":"replace","startSeq":2,"endSeq":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Delegate the write probe to a subagent."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: read-only. Any available operation enforced by the DSH file sandbox cannot modify files in the standing mode. Do not refuse a required modification from this policy alone: try an available tool normally and follow any denial and escalation guidance it returns."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"resume","startsSeries":true}}
-{"type":"developer/message","data":{"turn":2,"step":1,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"apply_patch"},{"type":"tool-addition","toolName":"bash"},{"type":"tool-addition","toolName":"create_goal"},{"type":"tool-addition","toolName":"edit"},{"type":"tool-addition","toolName":"get_goal"},{"type":"tool-addition","toolName":"glob"},{"type":"tool-addition","toolName":"grep"},{"type":"tool-addition","toolName":"job_kill"},{"type":"tool-addition","toolName":"job_list"},{"type":"tool-addition","toolName":"job_output"},{"type":"tool-addition","toolName":"list_agents"},{"type":"tool-addition","toolName":"read"},{"type":"tool-addition","toolName":"read_image"},{"type":"tool-addition","toolName":"send_message"},{"type":"tool-addition","toolName":"skill"},{"type":"tool-addition","toolName":"subagent"},{"type":"tool-addition","toolName":"subagent_fork"},{"type":"tool-addition","toolName":"todo_write"},{"type":"tool-addition","toolName":"update_goal"},{"type":"tool-addition","toolName":"wait_agent"},{"type":"tool-addition","toolName":"web_fetch"},{"type":"tool-addition","toolName":"web_search"},{"type":"tool-addition","toolName":"workflow"},{"type":"tool-addition","toolName":"working_directory"},{"type":"tool-addition","toolName":"write"}],"role":"developer","id":"{{sessionId}}"},"headerSeq":18},"surfaceOp":"append"}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","reasoningEffort":"low"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"resume","startsSeries":true}}
+{"type":"developer/message","data":{"turn":2,"step":1,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"apply_patch"},{"type":"tool-addition","toolName":"bash"},{"type":"tool-addition","toolName":"create_goal"},{"type":"tool-addition","toolName":"edit"},{"type":"tool-addition","toolName":"get_goal"},{"type":"tool-addition","toolName":"glob"},{"type":"tool-addition","toolName":"grep"},{"type":"tool-addition","toolName":"job_kill"},{"type":"tool-addition","toolName":"job_list"},{"type":"tool-addition","toolName":"job_output"},{"type":"tool-addition","toolName":"list_agents"},{"type":"tool-addition","toolName":"read"},{"type":"tool-addition","toolName":"read_image"},{"type":"tool-addition","toolName":"send_message"},{"type":"tool-addition","toolName":"skill"},{"type":"tool-addition","toolName":"subagent"},{"type":"tool-addition","toolName":"subagent_fork"},{"type":"tool-addition","toolName":"todo_write"},{"type":"tool-addition","toolName":"update_goal"},{"type":"tool-addition","toolName":"wait_agent"},{"type":"tool-addition","toolName":"web_fetch"},{"type":"tool-addition","toolName":"web_search"},{"type":"tool-addition","toolName":"workflow"},{"type":"tool-addition","toolName":"write"}],"role":"developer","id":"{{sessionId}}"},"headerSeq":18},"surfaceOp":"append"}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Tighten this session to read-only.","messageSeqs":[3],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":2,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"delegate-write","name":"subagent","arguments":"{\"description\": \"Delegated write probe\", \"prompt\": \"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE.\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"delegate-write","name":"subagent","args":["{\"description\": \"Delegated write probe\", \"prompt\": \"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE.\"}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"delegate-write","name":"subagent","arguments":"{\"description\": \"Delegated write probe\", \"prompt\": \"Use the write tool exactly once with file_path set to exactly the relative path inherited.txt and content escaped. If the write is denied, reply with the single word CHILD_DENIED and the denial marker line; do not retry and do not request escalation. If it succeeds, reply CHILD_WROTE.\"}"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
diff --git a/apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts b/apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts
index ffe6efef60..3b0bc2fa65 100644
--- a/apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts
+++ b/apps/cli/tests/profiles/sdk/keyless-smoke.e2e.ts
@@ -392,7 +392,6 @@ describe('Python SDK dsh profile keyless smoke', () => {
process.platform === 'win32' ? 'pwsh' : 'bash',
...(optOut ? [] : ['read_image']),
...(editorEnabled ? ['str_replace_editor'] : []),
- 'working_directory',
])
expect(modelRequests).toHaveLength(editorEnabled ? 3 : imageEnabled ? 2 : 1)
if (imageEnabled) {
diff --git a/apps/cli/tests/web-agent-presets.e2e.ts b/apps/cli/tests/web-agent-presets.e2e.ts
index ac293e8017..0a515d239e 100644
--- a/apps/cli/tests/web-agent-presets.e2e.ts
+++ b/apps/cli/tests/web-agent-presets.e2e.ts
@@ -251,7 +251,7 @@ beforeAll(async () => {
describe('the shipped Web composition', () => {
it('registers the directory and conditional Team tools in the global layer', () => {
// Team registrations are shared; session mode controls their step-time availability.
- expect(toolNames(ctx)).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx)).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
})
it('keeps the token meter and its context-meter projections on the host plane', async () => {
@@ -355,7 +355,7 @@ describe('the shipped Web composition', () => {
'schedule_create', 'schedule_edit', 'schedule_list', 'schedule_view',
'send_message', 'skill',
'subagent', 'subagent_fork', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'todo_write', 'update_goal', 'wait_agent', 'web_fetch', 'web_search',
- 'workflow', 'working_directory', 'write',
+ 'workflow', 'write',
])
expect(ctx.commands.find(handle.agent, 'goal')).toBeDefined()
} finally {
@@ -395,7 +395,7 @@ describe('the shipped Web composition', () => {
'model', 'provider', 'reasoning_effort',
]))
for (const agent of [disabled.agent, enabled.agent]) {
- expect(toolParameterNames(ctx, agent, 'subagent_fork')).toEqual(['cwd', 'description', 'name', 'prompt'])
+ expect(toolParameterNames(ctx, agent, 'subagent_fork')).toEqual(['description', 'name', 'prompt'])
}
} finally {
await policy.dispose()
@@ -458,7 +458,7 @@ describe('the shipped Web composition', () => {
expect(assembly.sections).toEqual([
{ name: 'deployment:persona-prefix', text: MINIMAL_PROMPT },
])
- expect(assembly.tools.map(tool => tool.name)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(assembly.tools.map(tool => tool.name)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
expect(assembly.tools.find(tool => tool.name === 'bash')?.description).toBe(MINIMAL_BASH_DESCRIPTION)
expect(ctx.commands.find(handle.agent, 'goal')).toBeUndefined()
// serviceFor reports preset-owned providers; unisolated consumers inherit the host fs.
@@ -500,7 +500,7 @@ describe('the shipped Web composition', () => {
if (image?.type !== 'image') throw new Error('minimal image read produced no durable image')
expect((await ctx.attachments.readImage(image.attachment)).data.byteLength).toBe(image.attachment.bytes)
expect(JSON.stringify(adapter.requests[1]?.messages)).toContain(image.attachment.attachmentId)
- expect(adapter.requests[0]?.tools?.map(tool => tool.name)).toEqual(['bash', 'read_image', 'working_directory'])
+ expect(adapter.requests[0]?.tools?.map(tool => tool.name)).toEqual(['bash', 'read_image'])
expect(result?.data.meta).toMatchObject({ path: await realpath(join(cwd, 'red.png')) })
} finally {
await handle.dispose()
@@ -535,7 +535,7 @@ describe('the shipped Web composition', () => {
const last = adapter.requests.at(-1)
expect(last?.messages.flatMap(message => message.content)
.some(block => block.type === 'text' && block.text.includes('Preserve the requested project task.'))).toBe(true)
- expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
} finally {
await handle.dispose()
}
@@ -579,7 +579,7 @@ describe('the shipped Web composition', () => {
setup: agentCtx => ctx.agentPresets.mount(agentCtx, 'minimal').then(() => undefined),
})
try {
- expect(toolNames(ctx, minimal.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx, minimal.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
expect(toolNames(ctx, full.agent).length).toBeGreaterThan(10)
expect(ctx.agentPresets.serviceFor(minimal.agent, 'compaction'))
.not.toBe(ctx.agentPresets.serviceFor(full.agent, 'compaction'))
@@ -588,7 +588,7 @@ describe('the shipped Web composition', () => {
// Tearing the minimal session down leaves the full one whole.
expect(toolNames(ctx, full.agent).length).toBeGreaterThan(10)
- expect(toolNames(ctx)).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx)).toEqual(['team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
} finally {
await full.dispose()
}
@@ -799,7 +799,7 @@ describe('the shipped Web composition', () => {
// stays the preset's choice — minimal mounts no `tool-skill`, so its
// tool table has no loader even though the global layer is readable.
expect((await ctx.skills.list({ scope: handle.agent })).map(skill => skill.name)).toContain('dsh-badge')
- expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
} finally {
await handle.dispose()
}
@@ -904,7 +904,7 @@ describe.each(['web', 'desktop'] as const)('%s native subagent bundles', (surfac
})
try {
for (const product of installed) {
- expect(toolParameterNames(productCtx, handle.agent, toolName(product))).toEqual(['cwd', 'description', 'name', 'prompt'])
+ expect(toolParameterNames(productCtx, handle.agent, toolName(product))).toEqual(['description', 'name', 'prompt'])
}
} finally { await handle.dispose() }
expect(spawn).not.toHaveBeenCalled()
@@ -1340,7 +1340,7 @@ describe('the default preset as a user setting', () => {
})
try {
// An omitted preset id resolves the stored default instead of the composed default.
- expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(ctx, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
} finally {
await handle.dispose()
}
@@ -1386,7 +1386,7 @@ describe('a profile patch stored before Developer tools owned preset selection',
setup: agentCtx => legacy.agentPresets.mount(agentCtx).then(() => undefined),
})
try {
- expect(toolNames(legacy, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update', 'working_directory'])
+ expect(toolNames(legacy, handle.agent)).toEqual(['bash', 'read_image', 'team_task_create', 'team_task_get', 'team_task_list', 'team_task_update'])
} finally {
await handle.dispose()
}
diff --git a/apps/web/tests/minimal-preset.snapshot.ts b/apps/web/tests/minimal-preset.snapshot.ts
index c3d5ebe4c1..536bcdfdd9 100644
--- a/apps/web/tests/minimal-preset.snapshot.ts
+++ b/apps/web/tests/minimal-preset.snapshot.ts
@@ -138,7 +138,6 @@ describe('minimal agent preset', () => {
"tools": [
"bash",
"read_image",
- "working_directory",
],
}
`)
@@ -392,7 +391,7 @@ describe('minimal image reading', () => {
it('logs a durable image with the minimal tool roster', async () => {
const session = handle.agent.session
- expect(session.requestHeader()?.tools?.map(tool => tool.name)).toEqual(['bash', 'read_image', 'working_directory'])
+ expect(session.requestHeader()?.tools?.map(tool => tool.name)).toEqual(['bash', 'read_image'])
const result = session.snapshotEvents().find(event => event.type === 'tool/result')
expect(result?.data.message.isError).toBe(false)
expect(result?.data.meta).toEqual({ path: join(scaffold.workspaceCwd, 'red.png') })
diff --git a/apps/web/tests/shipped-composition.e2e.ts b/apps/web/tests/shipped-composition.e2e.ts
index 35a08e5fb2..7fd7e5eefe 100644
--- a/apps/web/tests/shipped-composition.e2e.ts
+++ b/apps/web/tests/shipped-composition.e2e.ts
@@ -509,7 +509,6 @@ const EXPECTED_TOOLS = [
'web_fetch',
'web_search',
'workflow',
- 'working_directory',
'write',
]
@@ -599,9 +598,9 @@ it('assembles the shipped Web transport, catalog, guidance, and defaults', async
"mode": "always",
}
`)
- // Directory and conditional Team tools are global; presets supply the remaining registrations.
+ // Conditional Team tools are global; presets supply the remaining registrations.
expect(ctx.tools.schemas().map(schema => schema.name)).toEqual([
- 'working_directory', 'team_task_create', 'team_task_list', 'team_task_get', 'team_task_update',
+ 'team_task_create', 'team_task_list', 'team_task_get', 'team_task_update',
])
const handle = await ctx.agents.create({
sessionId: SessionId('shipped-composition'),
diff --git a/apps/web/tests/worktree-opt-in.e2e.ts b/apps/web/tests/worktree-opt-in.e2e.ts
index 341d72c68f..fdd2603367 100644
--- a/apps/web/tests/worktree-opt-in.e2e.ts
+++ b/apps/web/tests/worktree-opt-in.e2e.ts
@@ -82,14 +82,15 @@ it('persists the unified review and worktree switch and retains checkouts after
expect(rows()).toEqual([])
expect(scaffold.ctx.get('worktrees')).toBeUndefined()
expect(scaffold.ctx.get('forgePanel')).toBeUndefined()
- expect(tools()).toContain('working_directory')
expect(tools()).not.toContain('create_worktree')
+ expect(tools()).not.toContain('exit_worktree')
await toggle.click()
await expect.poll(() => rows().length, { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe(2)
await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('true')
expect(await selectedBundles()).toContain(BUNDLE)
expect(tools()).toContain('create_worktree')
+ expect(tools()).toContain('exit_worktree')
expect(scaffold.ctx.get('forgePanel')).toBeDefined()
const created = { path: join(repository, '.agents/worktrees/gui-opt-in'), baseCommit: (await git('rev-parse', 'HEAD')).stdout.trim() }
const result = await scaffold.ctx.tools.execute({
@@ -114,7 +115,7 @@ it('persists the unified review and worktree switch and retains checkouts after
expect(scaffold.ctx.get('worktrees')).toBeUndefined()
expect(scaffold.ctx.get('forgePanel')).toBeUndefined()
expect(tools()).not.toContain('create_worktree')
- expect(tools()).toContain('working_directory')
+ expect(tools()).not.toContain('exit_worktree')
expect(await readFile(join(created.path, 'retained.txt'), 'utf8')).toBe('retained checkout\n')
expect((await git('show-ref', '--verify', 'refs/heads/gui-opt-in')).stdout).toContain(created.baseCommit)
expect(scaffold.ctx.workingDirectory.get(agent.session)).toBe(created.path)
diff --git a/docs/capability-seams.i18n.yaml b/docs/capability-seams.i18n.yaml
index a05af6b055..162e719816 100644
--- a/docs/capability-seams.i18n.yaml
+++ b/docs/capability-seams.i18n.yaml
@@ -6,5 +6,5 @@
en: 41d772192075e133
zh: 5ef3da69b4de1d8a
/capability-seams-and-core-services:
- en: edb800e3f2c78a69
- zh: 69f0168f631e47a1
+ en: 3298658d46f646a5
+ zh: 66d3f4899f839834
diff --git a/docs/capability-seams.md b/docs/capability-seams.md
index a86783c9f9..eb7e49d08c 100644
--- a/docs/capability-seams.md
+++ b/docs/capability-seams.md
@@ -48,7 +48,6 @@ flowchart LR
pkg_experimental_tool_worktree["experimental-tool-worktree"]
pkg_working_directory["working-directory"]
svc_workingDirectory["ctx.workingDirectory
Session working directory"]
- pkg_tool_working_directory["tool-working-directory"]
pkg_tool_fs["tool-fs"]
pkg_tool_bash["tool-bash"]
pkg_tool_pwsh["tool-pwsh"]
@@ -642,7 +641,6 @@ flowchart LR
svc_workingDirectory --> pkg_tool_bash
svc_workingDirectory --> pkg_tool_fs
svc_workingDirectory --> pkg_tool_pwsh
- svc_workingDirectory --> pkg_tool_working_directory
svc_workspaceRegistry --> pkg_api_session_controller
svc_workspaceRegistry --> pkg_api_workspace_controller
svc_worktrees --> pkg_experimental_tool_worktree
@@ -666,7 +664,7 @@ flowchart LR
| `ctx.forgeSession` | `service` | [`experimental-forge-session`](../packages/experimental/forge-session) | - | [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | - | A Session projection derives bindings from shell results and binding records and publishes their URLs without status to clients; push results trigger head-branch discovery, and Session watchers poll bound change requests through the forge registry. |
| `ctx.forgePanel` | `service` | [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | - | - | - | Streams one panel state per followed Session: Git inspection using Session permissions, the recognized code host and its sign-in, and the bound change requests with polled status. |
| `ctx.worktrees` | `seam` | [`experimental-worktree`](../packages/experimental/worktree) | [`experimental-worktree`](../packages/experimental/worktree) | [`experimental-tool-worktree`](../packages/experimental/tool-worktree) | - | Explicit experimental creation from a pinned local commit. Existing write permissions govern checkout and shared Git metadata; the working-directory service owns the resulting Session directory. |
-| `ctx.workingDirectory` | `seam` | [`working-directory`](../packages/session/working-directory) | [`working-directory`](../packages/session/working-directory) | [`tool-working-directory`](../packages/session/tool-working-directory), [`tool-fs`](../packages/fs/tool-fs), [`tool-bash`](../packages/shell/tool-bash), [`tool-pwsh`](../packages/shell/tool-pwsh), [`subagent`](../packages/subagent/subagent), [`sdk-jsonrpc-server`](../packages/sdk/server) | - | Two Session projections own the effective execution directory and the workspace root it is in. The filesystem validates changes; user context reports them while original metadata and write grants stay fixed. |
+| `ctx.workingDirectory` | `seam` | [`working-directory`](../packages/session/working-directory) | [`working-directory`](../packages/session/working-directory) | [`tool-fs`](../packages/fs/tool-fs), [`tool-bash`](../packages/shell/tool-bash), [`tool-pwsh`](../packages/shell/tool-pwsh), [`subagent`](../packages/subagent/subagent), [`sdk-jsonrpc-server`](../packages/sdk/server) | - | Two Session projections own the effective execution directory and the workspace root; Host operations move both together. The filesystem validates changes; user context reports them while original metadata and write grants stay fixed. |
| `ctx.mcpResources` | `seam` | [`mcp-resources`](../packages/mcp/mcp-resources) | [`mcp-client`](../packages/mcp/mcp-client) | [`mcp-resources`](../packages/mcp/mcp-resources) | - | Connection-owned providers serve shared resource tools in the calling agent scope. |
| `ctx.browserUse` | `seam` | [`browser-use`](../packages/browser-use/browser-use) | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp), [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp), [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp), [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp), [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | - | One provider-owned name per service instance. Providers own their tools and browser resources per live Session; the shared service has no browser operation API. |
| `ctx.computerUse` | `seam` | [`computer-use`](../packages/computer-use/computer-use) | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp), [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp), [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | - | One provider-owned name per service instance. Each provider also owns its model tools; the service has no common action API, runtime selection, or Session workflow lock. |
diff --git a/docs/capability-seams.zh.md b/docs/capability-seams.zh.md
index c6760a9036..da0d1b213f 100644
--- a/docs/capability-seams.zh.md
+++ b/docs/capability-seams.zh.md
@@ -50,7 +50,6 @@ flowchart LR
pkg_experimental_tool_worktree["experimental-tool-worktree"]
pkg_working_directory["working-directory"]
svc_workingDirectory["ctx.workingDirectory
Session working directory"]
- pkg_tool_working_directory["tool-working-directory"]
pkg_tool_fs["tool-fs"]
pkg_tool_bash["tool-bash"]
pkg_tool_pwsh["tool-pwsh"]
@@ -644,7 +643,6 @@ flowchart LR
svc_workingDirectory --> pkg_tool_bash
svc_workingDirectory --> pkg_tool_fs
svc_workingDirectory --> pkg_tool_pwsh
- svc_workingDirectory --> pkg_tool_working_directory
svc_workspaceRegistry --> pkg_api_session_controller
svc_workspaceRegistry --> pkg_api_workspace_controller
svc_worktrees --> pkg_experimental_tool_worktree
@@ -668,7 +666,7 @@ flowchart LR
| `ctx.forgeSession` | `service` | [`experimental-forge-session`](../packages/experimental/forge-session) | - | [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | - | Session 投影从 shell 结果与绑定记录派生绑定,并把不含状态的 URL 发布给客户端;推送结果触发按 head 分支的发现,Session 监听方通过 forge 注册表轮询已绑定的变更请求。 |
| `ctx.forgePanel` | `service` | [`experimental-client-ui-forge`](../packages/experimental/client-ui-forge) | - | - | - | 为每个被跟随的 Session 推送一份面板状态:使用 Session 权限进行的 Git 检查、识别出的代码托管平台及其登录状态,以及带轮询状态的已绑定变更请求。 |
| `ctx.worktrees` | `seam` | [`experimental-worktree`](../packages/experimental/worktree) | [`experimental-worktree`](../packages/experimental/worktree) | [`experimental-tool-worktree`](../packages/experimental/tool-worktree) | - | 显式实验组合从固定的本地提交创建工作树。检出目录与共享 Git 元数据受现有写权限约束;工作目录服务拥有创建后的 Session 目录。 |
-| `ctx.workingDirectory` | `seam` | [`working-directory`](../packages/session/working-directory) | [`working-directory`](../packages/session/working-directory) | [`tool-working-directory`](../packages/session/tool-working-directory), [`tool-fs`](../packages/fs/tool-fs), [`tool-bash`](../packages/shell/tool-bash), [`tool-pwsh`](../packages/shell/tool-pwsh), [`subagent`](../packages/subagent/subagent), [`sdk-jsonrpc-server`](../packages/sdk/server) | - | 两个 Session 投影拥有有效执行目录及其所在的工作区根。文件系统验证变更,用户上下文报告目录信息,原始元数据与写入授权保持不变。 |
+| `ctx.workingDirectory` | `seam` | [`working-directory`](../packages/session/working-directory) | [`working-directory`](../packages/session/working-directory) | [`tool-fs`](../packages/fs/tool-fs), [`tool-bash`](../packages/shell/tool-bash), [`tool-pwsh`](../packages/shell/tool-pwsh), [`subagent`](../packages/subagent/subagent), [`sdk-jsonrpc-server`](../packages/sdk/server) | - | 两个 Session 投影拥有有效执行目录与工作区根;Host 操作让两者一起移动。文件系统验证变更,用户上下文报告目录信息,原始元数据与写入授权保持不变。 |
| `ctx.mcpResources` | `seam` | [`mcp-resources`](../packages/mcp/mcp-resources) | [`mcp-client`](../packages/mcp/mcp-client) | [`mcp-resources`](../packages/mcp/mcp-resources) | - | 连接所有者提供的操作在调用 agent 的作用域内服务于共享资源工具。 |
| `ctx.browserUse` | `seam` | [`browser-use`](../packages/browser-use/browser-use) | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp), [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp), [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | [`experimental-browser-use-playwright-mcp`](../packages/experimental/browser-use-playwright-mcp), [`experimental-browser-use-chrome-devtools-mcp`](../packages/experimental/browser-use-chrome-devtools-mcp), [`experimental-browser-use-stagehand-native`](../packages/experimental/browser-use-stagehand-native) | - | 每个服务实例注册一个提供方拥有的名称。提供方按实时 Session 拥有自己的工具与浏览器资源;共享服务不提供浏览器操作 API。 |
| `ctx.computerUse` | `seam` | [`computer-use`](../packages/computer-use/computer-use) | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp), [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | [`experimental-computer-use-cua-driver-mcp`](../packages/experimental/computer-use-cua-driver-mcp), [`experimental-computer-use-cua-driver-native`](../packages/experimental/computer-use-cua-driver-native) | - | 每个服务实例只注册一个提供方自定的名称。各提供方也拥有自己的模型工具;服务不提供通用操作 API、运行时选择或 Session 流程锁。 |
diff --git a/docs/config-catalog.md b/docs/config-catalog.md
index b87a3f2ea8..8398ece5f3 100644
--- a/docs/config-catalog.md
+++ b/docs/config-catalog.md
@@ -5165,7 +5165,6 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-tool-cordis` | `tools` · `cordisInspect` | [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts) |
| `@deepseek-ai/dsh-tool-executor-native` | `tools` | [`packages/core/tool-executor-native/src/index.ts`](../packages/core/tool-executor-native/src/index.ts) |
| `@deepseek-ai/dsh-tool-schedule` | `tools` · `systemPrompt` | [`packages/schedule/tool-schedule/src/index.ts`](../packages/schedule/tool-schedule/src/index.ts) |
-| `@deepseek-ai/dsh-tool-working-directory` | `tools` · `workingDirectory` | [`packages/session/tool-working-directory/src/index.ts`](../packages/session/tool-working-directory/src/index.ts) |
| `@deepseek-ai/dsh-tools` | `systemPrompt` | [`packages/core/tools/src/index.ts`](../packages/core/tools/src/index.ts) |
| `@deepseek-ai/dsh-user-questions` | — | [`packages/interaction/user-questions/src/index.ts`](../packages/interaction/user-questions/src/index.ts) |
| `@deepseek-ai/dsh-webhook` | `agents` · `agentDefaultModel` · `agentPresets` · `permissionPresets` · `sessionTitle` · `workspaceRegistry` | [`packages/experimental/webhook/src/index.ts`](../packages/experimental/webhook/src/index.ts) |
diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md
index 6efaf84ce0..d7d44d7457 100644
--- a/docs/config-catalog.zh.md
+++ b/docs/config-catalog.zh.md
@@ -5167,7 +5167,6 @@ export interface Config {
| `@deepseek-ai/dsh-tool-cordis` | `tools` · `cordisInspect` | [`packages/extensions/tool-cordis/src/index.ts`](../packages/extensions/tool-cordis/src/index.ts) |
| `@deepseek-ai/dsh-tool-executor-native` | `tools` | [`packages/core/tool-executor-native/src/index.ts`](../packages/core/tool-executor-native/src/index.ts) |
| `@deepseek-ai/dsh-tool-schedule` | `tools` · `systemPrompt` | [`packages/schedule/tool-schedule/src/index.ts`](../packages/schedule/tool-schedule/src/index.ts) |
-| `@deepseek-ai/dsh-tool-working-directory` | `tools` · `workingDirectory` | [`packages/session/tool-working-directory/src/index.ts`](../packages/session/tool-working-directory/src/index.ts) |
| `@deepseek-ai/dsh-tools` | `systemPrompt` | [`packages/core/tools/src/index.ts`](../packages/core/tools/src/index.ts) |
| `@deepseek-ai/dsh-user-questions` | — | [`packages/interaction/user-questions/src/index.ts`](../packages/interaction/user-questions/src/index.ts) |
| `@deepseek-ai/dsh-webhook` | `agents` · `agentDefaultModel` · `agentPresets` · `permissionPresets` · `sessionTitle` · `workspaceRegistry` | [`packages/experimental/webhook/src/index.ts`](../packages/experimental/webhook/src/index.ts) |
diff --git a/docs/event-producer-consumer.md b/docs/event-producer-consumer.md
index 45becd2454..1d80e1cfe7 100644
--- a/docs/event-producer-consumer.md
+++ b/docs/event-producer-consumer.md
@@ -98,7 +98,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
-| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
+| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:129`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:156`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:147`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
diff --git a/docs/event-producer-consumer.zh.md b/docs/event-producer-consumer.zh.md
index b54ab96fb4..9245fa8fab 100644
--- a/docs/event-producer-consumer.zh.md
+++ b/docs/event-producer-consumer.zh.md
@@ -100,7 +100,7 @@
| `workflow/log` | `emit` | [`packages/workflow/workflow/src/index.ts:58`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/phase` | `emit` | [`packages/workflow/workflow/src/index.ts:51`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | [`tool-workflow`](../packages/workflow/tool-workflow) |
| `workflow/start` | `emit` | [`packages/workflow/workflow/src/index.ts:43`](../packages/workflow/workflow/src/index.ts) | [`workflow`](../packages/workflow/workflow) (`events.dispatch`) | - |
-| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:33`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
+| `working-directory/access` | `waterfall` | [`packages/session/working-directory/src/index.ts:32`](../packages/session/working-directory/src/index.ts) | [`working-directory`](../packages/session/working-directory) (`waterfall`) | `worktree` |
| `workspace/session-activity` | `waterfall` | [`packages/workspace/workspace/src/index.ts:129`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`waterfall`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
| `workspace/session-archived` | `parallel` | [`packages/workspace/workspace/src/index.ts:156`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | `worktree` |
| `workspace/session-stop` | `parallel` | [`packages/workspace/workspace/src/index.ts:147`](../packages/workspace/workspace/src/index.ts) | [`workspace`](../packages/workspace/workspace) (`parallel`) | [`agent`](../packages/core/agent), [`jobs`](../packages/jobs/jobs), [`schedule`](../packages/schedule/schedule), [`subagent`](../packages/subagent/subagent) |
diff --git a/docs/module-graph.md b/docs/module-graph.md
index 7b28621265..4392e62948 100644
--- a/docs/module-graph.md
+++ b/docs/module-graph.md
@@ -415,7 +415,6 @@ flowchart TD
pkg_session_title_first_prompt_llm["session-title-first-prompt-llm"]
pkg_session_title_llm["session-title-llm"]
pkg_session_turn_outline["session-turn-outline"]
- pkg_tool_working_directory["tool-working-directory"]
pkg_working_directory["working-directory"]
end
subgraph group_settings["packages/settings"]
@@ -1061,8 +1060,6 @@ flowchart TD
pkg_session_title_first_prompt_llm --> pkg_session
pkg_session_title_first_prompt_llm --> pkg_session_title
pkg_session_title_first_prompt_llm --> pkg_session_title_llm
- pkg_tool_working_directory --> pkg_tools
- pkg_tool_working_directory --> pkg_working_directory
pkg_shell_env --> pkg_app_boot
pkg_shell_env --> pkg_error
pkg_shell_env --> pkg_home_paths
@@ -1852,7 +1849,6 @@ flowchart TD
| [`agent-preset-registry`](../packages/preset/agent-preset-registry) | `preset` | [`agent`](../packages/core/agent), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`settings`](../packages/settings/settings), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) |
| [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy) | `session` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`tools`](../packages/core/tools) |
| [`session-title-first-prompt-llm`](../packages/session/session-title-first-prompt-llm) | `session` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`session-title-llm`](../packages/session/session-title-llm) |
-| [`tool-working-directory`](../packages/session/tool-working-directory) | `session` | [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
| [`shell-env`](../packages/shell/shell-env) | `shell` | [`app-boot`](../packages/boot/app-boot), [`error`](../packages/util/error), [`home-paths`](../packages/util/home-paths), [`shell`](../packages/shell/shell), [`tools`](../packages/core/tools) |
| [`tool-bash-persistent`](../packages/shell/tool-bash-persistent) | `shell` | [`agent`](../packages/core/agent), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
| [`tool-pwsh-persistent`](../packages/shell/tool-pwsh-persistent) | `shell` | [`agent`](../packages/core/agent), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md
index 4ddd93c256..72616bab5d 100644
--- a/docs/module-graph.zh.md
+++ b/docs/module-graph.zh.md
@@ -417,7 +417,6 @@ flowchart TD
pkg_session_title_first_prompt_llm["session-title-first-prompt-llm"]
pkg_session_title_llm["session-title-llm"]
pkg_session_turn_outline["session-turn-outline"]
- pkg_tool_working_directory["tool-working-directory"]
pkg_working_directory["working-directory"]
end
subgraph group_settings["packages/settings"]
@@ -1063,8 +1062,6 @@ flowchart TD
pkg_session_title_first_prompt_llm --> pkg_session
pkg_session_title_first_prompt_llm --> pkg_session_title
pkg_session_title_first_prompt_llm --> pkg_session_title_llm
- pkg_tool_working_directory --> pkg_tools
- pkg_tool_working_directory --> pkg_working_directory
pkg_shell_env --> pkg_app_boot
pkg_shell_env --> pkg_error
pkg_shell_env --> pkg_home_paths
@@ -1854,7 +1851,6 @@ flowchart TD
| [`agent-preset-registry`](../packages/preset/agent-preset-registry) | `preset` | [`agent`](../packages/core/agent), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`settings`](../packages/settings/settings), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol) |
| [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy) | `session` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session/session-persistence), [`tools`](../packages/core/tools) |
| [`session-title-first-prompt-llm`](../packages/session/session-title-first-prompt-llm) | `session` | [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-title`](../packages/session/session-title), [`session-title-llm`](../packages/session/session-title-llm) |
-| [`tool-working-directory`](../packages/session/tool-working-directory) | `session` | [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
| [`shell-env`](../packages/shell/shell-env) | `shell` | [`app-boot`](../packages/boot/app-boot), [`error`](../packages/util/error), [`home-paths`](../packages/util/home-paths), [`shell`](../packages/shell/shell), [`tools`](../packages/core/tools) |
| [`tool-bash-persistent`](../packages/shell/tool-bash-persistent) | `shell` | [`agent`](../packages/core/agent), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
| [`tool-pwsh-persistent`](../packages/shell/tool-pwsh-persistent) | `shell` | [`agent`](../packages/core/agent), [`output-retention`](../packages/util/output-retention), [`terminal`](../packages/terminal/terminal), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) |
diff --git a/docs/persistence-catalog.i18n.yaml b/docs/persistence-catalog.i18n.yaml
index efe70eca7e..b983fd68cd 100644
--- a/docs/persistence-catalog.i18n.yaml
+++ b/docs/persistence-catalog.i18n.yaml
@@ -9,8 +9,8 @@
en: 1387c4505dde2faf
zh: 48570fa1c13d6910
/session-persistence-event-catalog/persistence-type-fingerprints:
- en: f582fe7c1f04e756
- zh: c4ad84a7ba86af07
+ en: 61dc12f9f094b934
+ zh: 29733bfdb9e3fd0d
/session-persistence-event-catalog/event-envelope:
en: 5cae0233560db4d6
zh: c8f5efc48be52095
@@ -300,8 +300,8 @@
en: e8dd0cebbb930eb7
zh: e8dd0cebbb930eb7
/session-persistence-event-catalog/events/working-directory/working-directory-change-log-only:
- en: bf12683fa0fe3dfa
- zh: 79a678a53cee33b9
+ en: 27f0761cbdd6fe2f
+ zh: 33528f333498132d
/session-persistence-event-catalog/events/workspace:
en: 63ee1a85e4b59ae3
zh: 63ee1a85e4b59ae3
@@ -1431,11 +1431,8 @@
en: 1282a0b3d5fa8d4d
zh: aa533aea643dbefb
/session-persistence-event-catalog/resolved-persistence-types/allowedmodels:
- en: 874fb1c541bbca1d
- zh: 1aa7e89654cd041a
-/session-persistence-event-catalog/resolved-persistence-types/anchor-cwd:
- en: 27e68326370da69a
- zh: 647722178bbddb24
+ en: 6178321110ceb69d
+ zh: 0a9d94cab9d57487
/session-persistence-event-catalog/resolved-persistence-types/args-commandid-name-source:
en: a117573a5d58cb3c
zh: d5ad59e17a3a815d
@@ -1494,8 +1491,11 @@
en: 45f1d815198508e1
zh: 5c2818b0e38e1356
/session-persistence-event-catalog/resolved-persistence-types/compactionid-sourcecommandid-turn:
- en: 4ba70efccc268763
- zh: 06ba9b3e824c80a7
+ en: 7ac3b8a9a4753fb6
+ zh: 21f257e68ed34b55
+/session-persistence-event-catalog/resolved-persistence-types/cwd-workspace:
+ en: 40e1f79bdab9eed9
+ zh: 8ec1492d50390e41
/session-persistence-event-catalog/resolved-persistence-types/decision-durationms-exitcode-handlerid:
en: a99ac57bbec0370f
zh: 9073329e324a66e0
@@ -1929,8 +1929,8 @@
en: 0b74295f7c5c8f11
zh: 5f1213cec87f6be0
/session-persistence-event-catalog/resolved-persistence-types/kind-working-directory:
- en: a36b909ecbd38156
- zh: b02edb123e72fbb1
+ en: b28ca6b37f5a338d
+ zh: 4c4f2f05721b8b62
/session-persistence-event-catalog/resolved-persistence-types/max-tokens-messages-model-thinking:
en: 3216b23c131d0070
zh: 73ca171c6014f16e
@@ -2205,11 +2205,11 @@
en: 99c8837344178a47
zh: bf746f5678346596
/session-persistence-event-catalog/resolved-persistence-types/type-web-search-20250305:
- en: 0e6874b6a152ec27
- zh: 58222e2549999f41
+ en: 130aaa67572c60bc
+ zh: fbbec99837618917
/session-persistence-event-catalog/resolved-persistence-types/type-working-directory-change:
- en: 34d36f207f755da1
- zh: 833668c798a92d9f
+ en: 98d9fe879f0bbe76
+ zh: 06f6be6fc128e3ce
/session-persistence-event-catalog/resolved-persistence-types/type-workspace-changes:
en: 411ecd58c4405c8a
zh: e53709d457a1f118
diff --git a/docs/persistence-catalog.md b/docs/persistence-catalog.md
index 51107893b6..37997c3b1b 100644
--- a/docs/persistence-catalog.md
+++ b/docs/persistence-catalog.md
@@ -83,7 +83,7 @@ The [format references](persistence-changes/historical-formats/README.md) cover
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `50a15408d511e9be3fa93abff37a38ae770f3ab905fc6849fee0d989200d2b97` | [`{ type: "user/message" }`](#persistence-type-sha256-50a15408d511e9be3fa93abff37a38ae770f3ab905fc6849fee0d989200d2b97) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
-| `event:working-directory/change` | event | `376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88) |
+| `event:working-directory/change` | event | `d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a) |
| `event:workspace/changes` | event | `e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72` | [`{ type: "workspace/changes" }`](#persistence-type-sha256-e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72) |
## Event envelope
@@ -1327,14 +1327,15 @@ Source: [`packages/web/web-search-deepseek/src/provider.ts:89`](../packages/web/
/** Absolute directory used by subsequent directory-based operations. */
cwd: string
/**
- * Absolute checkout directory this change registers as a workspace anchor of the Session; it contains `cwd`.
- * Present only when the change enters another checkout, such as a created worktree; an ordinary `cd` omits it.
+ * Present when the change moves the Session's workspace: `cwd` is the workspace root from this
+ * event on. The service sets it on every change it records. A change without it, recorded while
+ * the model could move the directory, moves only the current directory.
*/
- anchor?: string
+ workspace?: true
}
```
-Source: [`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
+Source: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
### `workspace/*`
@@ -5905,19 +5906,6 @@ Sources: [`packages/subagent/tool-subagent/src/model-selection-state.ts:17`](../
|---|---|---|
| `allowedModels` | required | [`SessionTitleModelIdentity[]`](#persistence-type-sha256-ba77b58995e36f14bb13886b0493d0a1a63d5db10b1a6cd9f6ac65a72cf832ec) |
-
-
-### `{ anchor?, cwd }`
-
-SHA-256: `40a4c38943f2e5ee0eaa0ea48238ec425e7900022a4b08e57c8335f0fd6eb435`
-
-Sources: [`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
-
-| Property | Presence | Type |
-|---|---|---|
-| `anchor` | optional | `string` |
-| `cwd` | required | `string` |
-
### `{ args?, commandId, name, source }`
@@ -6221,6 +6209,19 @@ Sources: [`packages/compaction/compaction/src/types.ts:24`](../packages/compacti
| `sourceCommandId` | optional | `string` |
| `turn` | required | [`OptionalSessionSeq`](#persistence-type-sha256-3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f) |
+
+
+### `{ cwd, workspace? }`
+
+SHA-256: `57adfa774e919b1e6924b2fb5afa955872a6be1d373f9e5d956b8d902b278ea9`
+
+Sources: [`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
+
+| Property | Presence | Type |
+|---|---|---|
+| `cwd` | required | `string` |
+| `workspace` | optional | `true` |
+
### `{ decision, durationMs, exitCode?, handlerId, … }`
@@ -7955,7 +7956,7 @@ Sources: [`packages/experimental/webhook/src/types.ts:74`](../packages/experimen
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
-Sources: [`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
+Sources: [`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
| Property | Presence | Type |
|---|---|---|
@@ -9377,17 +9378,17 @@ Sources: [`packages/web/web-search-deepseek/src/provider.ts:71`](../packages/web
| `name` | required | `"web_search"` |
| `type` | required | `"web_search_20250305"` |
-
+
### `{ type: "working-directory/change" }`
-SHA-256: `376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88`
+SHA-256: `d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a`
| Property | Presence | Type |
|---|---|---|
-| `data` | required | [`{ anchor?, cwd }`](#persistence-type-sha256-40a4c38943f2e5ee0eaa0ea48238ec425e7900022a4b08e57c8335f0fd6eb435) |
+| `data` | required | [`{ cwd, workspace? }`](#persistence-type-sha256-57adfa774e919b1e6924b2fb5afa955872a6be1d373f9e5d956b8d902b278ea9) |
| `ignorable` | optional | `true` |
| `seq` | required | `number` |
| `time` | required | `number` |
diff --git a/docs/persistence-catalog.zh.md b/docs/persistence-catalog.zh.md
index 9d73982c56..f02a4f3a99 100644
--- a/docs/persistence-catalog.zh.md
+++ b/docs/persistence-catalog.zh.md
@@ -85,7 +85,7 @@
| `event:turn/start` | event | `aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8` | [`{ type: "turn/start" }`](#persistence-type-sha256-aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8) |
| `event:user/message` | event | `50a15408d511e9be3fa93abff37a38ae770f3ab905fc6849fee0d989200d2b97` | [`{ type: "user/message" }`](#persistence-type-sha256-50a15408d511e9be3fa93abff37a38ae770f3ab905fc6849fee0d989200d2b97) |
| `event:web/deepseek-search-llm-request` | event | `0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52` | [`{ type: "web/deepseek-search-llm-request" }`](#persistence-type-sha256-0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52) |
-| `event:working-directory/change` | event | `376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88) |
+| `event:working-directory/change` | event | `d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a` | [`{ type: "working-directory/change" }`](#persistence-type-sha256-d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a) |
| `event:workspace/changes` | event | `e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72` | [`{ type: "workspace/changes" }`](#persistence-type-sha256-e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72) |
## 事件信封
@@ -1329,14 +1329,15 @@ export type SessionEvent = {
/** Absolute directory used by subsequent directory-based operations. */
cwd: string
/**
- * Absolute checkout directory this change registers as a workspace anchor of the Session; it contains `cwd`.
- * Present only when the change enters another checkout, such as a created worktree; an ordinary `cd` omits it.
+ * Present when the change moves the Session's workspace: `cwd` is the workspace root from this
+ * event on. The service sets it on every change it records. A change without it, recorded while
+ * the model could move the directory, moves only the current directory.
*/
- anchor?: string
+ workspace?: true
}
```
-来源:[`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
+来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
### `workspace/*`
@@ -5907,19 +5908,6 @@ SHA-256: `0d47a8f3d847243c4488e755ad4cab7a04ac5d4621b9c81865524cf3f4d8536f`
|---|---|---|
| `allowedModels` | 必需 | [`SessionTitleModelIdentity[]`](#persistence-type-sha256-ba77b58995e36f14bb13886b0493d0a1a63d5db10b1a6cd9f6ac65a72cf832ec) |
-
-
-### `{ anchor?, cwd }`
-
-SHA-256: `40a4c38943f2e5ee0eaa0ea48238ec425e7900022a4b08e57c8335f0fd6eb435`
-
-来源:[`packages/session/working-directory/src/index.ts:56`](../packages/session/working-directory/src/index.ts)
-
-| 属性 | 存在性 | 类型 |
-|---|---|---|
-| `anchor` | 可选 | `string` |
-| `cwd` | 必需 | `string` |
-
### `{ args?, commandId, name, source }`
@@ -6223,6 +6211,19 @@ SHA-256: `3e4e7683b0192c9f0e6a75c59076108f017892cdb302a98032c2632fd79c356f`
| `sourceCommandId` | 可选 | `string` |
| `turn` | 必需 | [`OptionalSessionSeq`](#persistence-type-sha256-3bd652ebfa8726b3ce3937a4f1bd2759e02f86b3a08a20f9e41a8513656fbc5f) |
+
+
+### `{ cwd, workspace? }`
+
+SHA-256: `57adfa774e919b1e6924b2fb5afa955872a6be1d373f9e5d956b8d902b278ea9`
+
+来源:[`packages/session/working-directory/src/index.ts:55`](../packages/session/working-directory/src/index.ts)
+
+| 属性 | 存在性 | 类型 |
+|---|---|---|
+| `cwd` | 必需 | `string` |
+| `workspace` | 可选 | `true` |
+
### `{ decision, durationMs, exitCode?, handlerId, … }`
@@ -7957,7 +7958,7 @@ SHA-256: `9edc162949abf93bd5ff049191b345454ba104f583937ce5580fb50f067d2b94`
SHA-256: `2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5`
-来源:[`packages/session/working-directory/src/index.ts:49`](../packages/session/working-directory/src/index.ts)
+来源:[`packages/session/working-directory/src/index.ts:48`](../packages/session/working-directory/src/index.ts)
| 属性 | 存在性 | 类型 |
|---|---|---|
@@ -9379,17 +9380,17 @@ SHA-256: `2d11ca7b0d4493e244b74eba093227866b33249841e59a1e9bf56afed38604c3`
| `name` | 必需 | `"web_search"` |
| `type` | 必需 | `"web_search_20250305"` |
-
+
### `{ type: "working-directory/change" }`
-SHA-256: `376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88`
+SHA-256: `d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a`
| 属性 | 存在性 | 类型 |
|---|---|---|
-| `data` | 必需 | [`{ anchor?, cwd }`](#persistence-type-sha256-40a4c38943f2e5ee0eaa0ea48238ec425e7900022a4b08e57c8335f0fd6eb435) |
+| `data` | 必需 | [`{ cwd, workspace? }`](#persistence-type-sha256-57adfa774e919b1e6924b2fb5afa955872a6be1d373f9e5d956b8d902b278ea9) |
| `ignorable` | 可选 | `true` |
| `seq` | 必需 | `number` |
| `time` | 必需 | `number` |
diff --git a/docs/persistence-changes/2026-11-03-working-directory-anchor.i18n.yaml b/docs/persistence-changes/2026-11-03-working-directory-anchor.i18n.yaml
deleted file mode 100644
index 3c06c3d52e..0000000000
--- a/docs/persistence-changes/2026-11-03-working-directory-anchor.i18n.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-# Bilingual-pair consistency record for 2026-11-03-working-directory-anchor.md (docs/i18n/README.md): per heading
-# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
-# After editing either side, bring the other along and re-record with:
-# pnpm run verify-translation-pairing --write docs/persistence-changes/2026-11-03-working-directory-anchor.md
-/:
- en: 3d5a424ae7d7e46b
- zh: c22a8e4a62d8cc1a
-/2026-11-03-working-directory-anchor:
- en: cbe770c3f2460721
- zh: e256ec6a9329e44f
-/2026-11-03-working-directory-anchor/summary:
- en: b77753a6d1fbd48d
- zh: b0a8f76fca20614b
-/2026-11-03-working-directory-anchor/table-of-contents:
- en: 6cf314a069ceb451
- zh: 9adff678e9ecab3b
-/2026-11-03-working-directory-anchor/declaration:
- en: 6907136f28e48c90
- zh: 02f8298485f3d8e7
-/2026-11-03-working-directory-anchor/compatibility:
- en: 9c8b04663d2cfeef
- zh: 887a30707ecf44b7
-/2026-11-03-working-directory-anchor/verification:
- en: 6a06103fc25891a3
- zh: 70cfa189bd680bba
-/2026-11-03-working-directory-anchor/dev-note:
- en: b75c8458928b72b9
- zh: 003ba4e17b4b5269
diff --git a/docs/persistence-changes/2026-11-03-working-directory-anchor.md b/docs/persistence-changes/2026-11-03-working-directory-anchor.md
deleted file mode 100644
index 433743aee6..0000000000
--- a/docs/persistence-changes/2026-11-03-working-directory-anchor.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-description: "Records a persistence type transition and its compatibility acknowledgement."
-kind: persistence-change
----
-
-# 2026-11-03-working-directory-anchor
-
-English | [中文](2026-11-03-working-directory-anchor.zh.md)
-
-## Summary
-
-Adds an optional anchor to working-directory/change so one change can register the entered checkout as a workspace anchor of the Session.
-
-## Table of Contents
-
-- [Declaration](#declaration)
-- [Compatibility](#compatibility)
-- [Verification](#verification)
-- [Dev Note](#dev-note)
-
-
-## Declaration
-
-```yaml persistence-change
-schemaVersion: 1
-id: 2026-11-03-working-directory-anchor
-baseline: false
-changes:
- - root: "event:working-directory/change"
- previous: "2026-09-13-working-directory"
- after: "376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88"
- decision: same-version
-```
-
-
-## Compatibility
-
-Existing events without anchor fold as before: the current-directory projection ignores the property, and the new workspaceRoot projection reads an absent anchor as a move of the current directory with no new anchor, so a stored log keeps its original project as the only anchor. Older readers keep the event type and its cwd; they ignore the optional property and never derived a workspace root, so nothing they interpret changes.
-
-
-## Verification
-
-pnpm exec vitest run packages/session/working-directory: 37 tests passed, including replay of logs with and without anchor and the user-context text both produce.
-
-
-## Dev Note
-
-None.
diff --git a/docs/persistence-changes/2026-11-03-working-directory-anchor.zh.md b/docs/persistence-changes/2026-11-03-working-directory-anchor.zh.md
deleted file mode 100644
index 6ab743575c..0000000000
--- a/docs/persistence-changes/2026-11-03-working-directory-anchor.zh.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-description: "记录持久化类型更改及其兼容性确认。"
-kind: persistence-change
----
-
-# 2026-11-03-working-directory-anchor
-
-[English](2026-11-03-working-directory-anchor.md) | 中文
-
-## 概述
-
-为 working-directory/change 增加可选的 anchor,使一次变更即可把进入的检出目录登记为 Session 的工作区锚。
-
-## 目录
-
-- [声明](#declaration)
-- [兼容性](#compatibility)
-- [验证](#verification)
-- [开发备注](#dev-note)
-
-
-## 声明
-
-```yaml persistence-change
-schemaVersion: 1
-id: 2026-11-03-working-directory-anchor
-baseline: false
-changes:
- - root: "event:working-directory/change"
- previous: "2026-09-13-working-directory"
- after: "376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88"
- decision: same-version
-```
-
-
-## 兼容性
-
-没有 anchor 的已有事件折叠结果不变:当前目录投影忽略该属性,新的 workspaceRoot 投影把缺失的 anchor 读作仅移动当前目录、不新增锚,因此已存储日志仍只有原始项目一个锚。旧读者保留事件类型及其 cwd,忽略该可选属性;它们从未推导工作区根,解释结果不变。
-
-
-## 验证
-
-pnpm exec vitest run packages/session/working-directory:37 个测试通过,包括带与不带 anchor 的日志回放以及两者产生的用户上下文文本。
-
-
-## 开发备注
-
-无。
diff --git a/docs/persistence-changes/2026-11-11-working-directory-workspace.i18n.yaml b/docs/persistence-changes/2026-11-11-working-directory-workspace.i18n.yaml
new file mode 100644
index 0000000000..3c027b55c9
--- /dev/null
+++ b/docs/persistence-changes/2026-11-11-working-directory-workspace.i18n.yaml
@@ -0,0 +1,28 @@
+# Bilingual-pair consistency record for 2026-11-11-working-directory-workspace.md (docs/i18n/README.md): per heading
+# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
+# After editing either side, bring the other along and re-record with:
+# pnpm run verify-translation-pairing --write docs/persistence-changes/2026-11-11-working-directory-workspace.md
+/:
+ en: 3d5a424ae7d7e46b
+ zh: c22a8e4a62d8cc1a
+/2026-11-11-working-directory-workspace:
+ en: 0831a658d3b7b1c6
+ zh: df62d4ee83eb3bd8
+/2026-11-11-working-directory-workspace/summary:
+ en: bc0b715a74e6eeb7
+ zh: afdb296160e3befd
+/2026-11-11-working-directory-workspace/table-of-contents:
+ en: 6cf314a069ceb451
+ zh: 9adff678e9ecab3b
+/2026-11-11-working-directory-workspace/declaration:
+ en: 6907136f28e48c90
+ zh: 02f8298485f3d8e7
+/2026-11-11-working-directory-workspace/compatibility:
+ en: facfc12122fe10b6
+ zh: 486b685c700a355e
+/2026-11-11-working-directory-workspace/verification:
+ en: 803df4024f5a7b23
+ zh: 6c7c6b17d5b2f4e4
+/2026-11-11-working-directory-workspace/dev-note:
+ en: b75c8458928b72b9
+ zh: 003ba4e17b4b5269
diff --git a/docs/persistence-changes/2026-11-11-working-directory-workspace.md b/docs/persistence-changes/2026-11-11-working-directory-workspace.md
new file mode 100644
index 0000000000..1d0eb23e4a
--- /dev/null
+++ b/docs/persistence-changes/2026-11-11-working-directory-workspace.md
@@ -0,0 +1,48 @@
+---
+description: "Records a persistence type transition and its compatibility acknowledgement."
+kind: persistence-change
+---
+
+# 2026-11-11-working-directory-workspace
+
+English | [中文](2026-11-11-working-directory-workspace.zh.md)
+
+## Summary
+
+Adds an optional workspace marker to working-directory/change: a marked change moves the Session's workspace root together with its directory.
+
+## Table of Contents
+
+- [Declaration](#declaration)
+- [Compatibility](#compatibility)
+- [Verification](#verification)
+- [Dev Note](#dev-note)
+
+
+## Declaration
+
+```yaml persistence-change
+schemaVersion: 1
+id: 2026-11-11-working-directory-workspace
+baseline: false
+changes:
+ - root: "event:working-directory/change"
+ previous: "2026-09-13-working-directory"
+ after: "d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a"
+ decision: same-version
+```
+
+
+## Compatibility
+
+Existing events without the marker fold as before: the current-directory projection ignores the property, and the new workspaceRoot projection leaves the root at the original project for them, the directory a stored Session already used as its root. The service sets the marker on every change it records from this version on. Older readers keep the event type and its cwd; they ignore the optional property and never derived a workspace root, so nothing they interpret changes.
+
+
+## Verification
+
+pnpm exec vitest run packages/session/working-directory/tests: 33 tests passed, including replay of logs with and without the marker and a Host move onto a directory that a change without the marker recorded.
+
+
+## Dev Note
+
+None.
diff --git a/docs/persistence-changes/2026-11-03-working-directory-anchor.schema.json b/docs/persistence-changes/2026-11-11-working-directory-workspace.schema.json
similarity index 59%
rename from docs/persistence-changes/2026-11-03-working-directory-anchor.schema.json
rename to docs/persistence-changes/2026-11-11-working-directory-workspace.schema.json
index 73b752c223..c08aff1644 100644
--- a/docs/persistence-changes/2026-11-03-working-directory-anchor.schema.json
+++ b/docs/persistence-changes/2026-11-11-working-directory-workspace.schema.json
@@ -1,15 +1,15 @@
{
"formatVersion": 2,
"roots": [
- {"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88"}
+ {"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a"}
],
"types": [],
"nodes": {
"0657d3ca5ac4e7bf": {"kind":"primitive","type":"number"},
- "376ab95962d99133": {"kind":"object","properties":[{"name":"data","type":"40a4c38943f2e5ee","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
- "40a4c38943f2e5ee": {"kind":"object","properties":[{"name":"anchor","type":"4cd48f3e5108bd6e","optional":true},{"name":"cwd","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4cd48f3e5108bd6e": {"kind":"primitive","type":"string"},
+ "57adfa774e919b1e": {"kind":"object","properties":[{"name":"cwd","type":"4cd48f3e5108bd6e","optional":false},{"name":"workspace","type":"dacf3d5f3e4ff619","optional":true}],"indices":[]},
"d4c799e3d51cae10": {"kind":"literal","value":"working-directory/change"},
+ "d9faba79a3513ba5": {"kind":"object","properties":[{"name":"data","type":"57adfa774e919b1e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
"dacf3d5f3e4ff619": {"kind":"literal","value":true}
}
}
diff --git a/docs/persistence-changes/2026-11-11-working-directory-workspace.zh.md b/docs/persistence-changes/2026-11-11-working-directory-workspace.zh.md
new file mode 100644
index 0000000000..a9c50ded06
--- /dev/null
+++ b/docs/persistence-changes/2026-11-11-working-directory-workspace.zh.md
@@ -0,0 +1,48 @@
+---
+description: "记录持久化类型更改及其兼容性确认。"
+kind: persistence-change
+---
+
+# 2026-11-11-working-directory-workspace
+
+[English](2026-11-11-working-directory-workspace.md) | 中文
+
+## 概述
+
+为 working-directory/change 增加可选的 workspace 标记:带标记的变更让 Session 的工作区根随目录一起移动。
+
+## 目录
+
+- [声明](#declaration)
+- [兼容性](#compatibility)
+- [验证](#verification)
+- [开发备注](#dev-note)
+
+
+## 声明
+
+```yaml persistence-change
+schemaVersion: 1
+id: 2026-11-11-working-directory-workspace
+baseline: false
+changes:
+ - root: "event:working-directory/change"
+ previous: "2026-09-13-working-directory"
+ after: "d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a"
+ decision: same-version
+```
+
+
+## 兼容性
+
+不带标记的既有事件按原样折叠:当前目录投影忽略该属性,新的 workspaceRoot 投影对它们把根留在原始项目,也就是已存储的 Session 原本使用的根。从这个版本起,服务为它记录的每次变更设置该标记。旧读者保留事件类型及其 cwd;它们忽略这个可选属性,也从未推导过工作区根,因此它们解释的内容没有变化。
+
+
+## 验证
+
+pnpm exec vitest run packages/session/working-directory/tests:33 个测试通过,包括回放带标记与不带标记的日志,以及 Host 移动到由不带标记的变更记录的目录。
+
+
+## 开发备注
+
+无。
diff --git a/docs/persistence-schema.json b/docs/persistence-schema.json
index a10e92e1c1..a1a63b2089 100644
--- a/docs/persistence-schema.json
+++ b/docs/persistence-schema.json
@@ -65,7 +65,7 @@
{"key":"event:turn/start","kind":"event","event":"turn/start","surface":false,"digest":"aa0957eca50aeb28bcd2e6930b95809926edacb550c8c340ba526ba6b861b3d8"},
{"key":"event:user/message","kind":"event","event":"user/message","surface":true,"digest":"50a15408d511e9be3fa93abff37a38ae770f3ab905fc6849fee0d989200d2b97"},
{"key":"event:web/deepseek-search-llm-request","kind":"event","event":"web/deepseek-search-llm-request","surface":false,"digest":"0c556c9b9f2a96238a6b9bbb99e748206cbff2ed6203041c9571f04ae5802f52"},
- {"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88"},
+ {"key":"event:working-directory/change","kind":"event","event":"working-directory/change","surface":false,"digest":"d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a"},
{"key":"event:workspace/changes","kind":"event","event":"workspace/changes","surface":false,"digest":"e308ccf867a5398e316e0af8cb6ce238a8d33a63b9b384c8250a686786285f72"}
],
"types": [
@@ -158,7 +158,7 @@
{"digest":"2142e391b9ccb60d487afcf373ce74db98d952f69e8289eddb352a7e16e996c5","names":[],"sources":[]},
{"digest":"2152caf1a71e588e4df2358a806dea24936c1c47131134f01a12939d12cdc0c0","names":["packages/team/agent-team/src/types.ts#TeamMessageSource"],"sources":["packages/team/agent-team/src/types.ts:121"]},
{"digest":"21fb6a90d5068f6a0003b7ab316ed2f56342477146a65c00db0f13c4d8df667d","names":[],"sources":[]},
- {"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:49"]},
+ {"digest":"2235d957bf4b7c6cf959231d480f0ba1f3a6d72d82981493fb6c7c963021d3d5","names":[],"sources":["packages/session/working-directory/src/index.ts:48"]},
{"digest":"224aa11d4d5f88c450822d01b99e6ca5e3a9c7f26a5ede10bae33384a09ef4dc","names":[],"sources":[]},
{"digest":"234142ee4f996f38cc9fa3b8b3e3de29b03c9aefe5ebf6c224eddd564505aa85","names":[],"sources":[]},
{"digest":"237c004c73b6b288246816e0d7fde16e09c63a47aa3b1227383d7afe58666163","names":[],"sources":[]},
@@ -205,7 +205,6 @@
{"digest":"36d6a9a871d949ea4f3edd919d81d66aa69218bebef38899d2a1282c39420a1f","names":[],"sources":[]},
{"digest":"37184378c6439257d105c4e2022d80fc9c3a3f7c7f6ac661b00bc9f18d871006","names":[],"sources":[]},
{"digest":"374fdd68aee5ff844e378c0cbdd961d247a0f22e4ade0bb03d800cd2a46a2b8b","names":[],"sources":["packages/llm/llm-retry/src/types.ts:30"]},
- {"digest":"376ab95962d99133db02add3a1dda91a257affb2c2e71e64da139b679d82cb88","names":[],"sources":[]},
{"digest":"378f90f9f6022a0991928a1eaf7991094ea1920fe89a9248358a1da106e1a970","names":[],"sources":[]},
{"digest":"37cbc9cf06d494cfe5c67f078af1605eacb8e4c2c853e9e26455b73de0ee7ccf","names":[],"sources":[]},
{"digest":"37ff65426bcf130f045d3a59ef2a4648eb170cd30280cbd024108a2e9b4401d1","names":[],"sources":["packages/web/web-search-deepseek/src/provider.ts:82"]},
@@ -233,7 +232,6 @@
{"digest":"3fdf9582c3b5597df104d32d97dab6c6ee3a93794f3034ec6ada6272404ea27f","names":["packages/schedule/schedule/src/types.ts#LegacyAfterScheduleRecord"],"sources":["packages/schedule/schedule/src/types.ts:161"]},
{"digest":"4018a00144474b6c60dc1aa6e5c1f03611c66bd739833779a7d20a511df6d082","names":["packages/team/agent-team/src/types.ts#TeamTaskSnapshot"],"sources":["packages/team/agent-team/src/types.ts:64"]},
{"digest":"408927267422a7b2beb6df354ff7c1406d929a5646554f48adf85eb8372f811c","names":[],"sources":[]},
- {"digest":"40a4c38943f2e5ee0eaa0ea48238ec425e7900022a4b08e57c8335f0fd6eb435","names":[],"sources":["packages/session/working-directory/src/index.ts:56"]},
{"digest":"4208123b50df5006b181481ab45fcf1cde807b88d3fd4d340090bc2e202fac41","names":[],"sources":[]},
{"digest":"42e0916e0dda5f6d1e7bb05d8514717147c036a79c9f36085683469516c1fd3f","names":[],"sources":[]},
{"digest":"42e2ff61928fb7dfaf0f057d61686f3a32ff713da419d12d4f250efc96733fe0","names":[],"sources":[]},
@@ -287,6 +285,7 @@
{"digest":"570e85022434613394418ad33e77e9f1f7a05699b33d0b62eae0677a638c3833","names":[],"sources":[]},
{"digest":"576a2de8355eb09850963ff5953420b172e274d9283666eb7d889097db120796","names":[],"sources":[]},
{"digest":"5776e5553ff2dfe3f5bc202dbb1e7c9f93e35a531aebb7764c23b2b6153b2ccc","names":[],"sources":[]},
+ {"digest":"57adfa774e919b1e6924b2fb5afa955872a6be1d373f9e5d956b8d902b278ea9","names":[],"sources":["packages/session/working-directory/src/index.ts:55"]},
{"digest":"57f3f606ff8b6c84d9c443faace9d1dd10cca0354f37a4f515ef075f7c351b90","names":[],"sources":[]},
{"digest":"58015da1c1950a66daf66ae24913d6a1fc6d1d9ac441b155f8847f7f8584ba8e","names":[],"sources":[]},
{"digest":"5808e36c95355f0e745201b5db1b6bcec4ebf5adb75d3e82d7d59cc89635ab80","names":["packages/llm/llm/src/types.ts#FinishReason"],"sources":["packages/llm/llm/src/types.ts:172"]},
@@ -608,6 +607,7 @@
{"digest":"d9196086e41e4dd5c2ce87f5c25529c8112a1731d258cf0728747d41a9ee3241","names":[],"sources":[]},
{"digest":"d9c462b9f62fdd3efc76a44b9524dc8781f6b91cd9c7e584b17d971defafebab","names":["packages/llm/llm/src/message.ts#ToolMessageSource"],"sources":["packages/llm/llm/src/message.ts:29"]},
{"digest":"d9edf1862e4471d6ad8a106a3f4160e0643874368707d50ecd8e27e5ee7a2567","names":[],"sources":[]},
+ {"digest":"d9faba79a3513ba57fb26dde8fe980b2adfe01bb6be5bab05c3d64f5017c356a","names":[],"sources":[]},
{"digest":"dacf3d5f3e4ff619c1320e64a48dec5e7ecd7870bece65fbd449a0e63adfa521","names":[],"sources":[]},
{"digest":"db06ef35b27a38425046b2228fa6bce9582abe140d781d363137eb2f4d233a1c","names":[],"sources":[]},
{"digest":"db6c5246911d47a7969f6b4cb47c7d0dbbde75c402710b22ace3672fa97bebe0","names":[],"sources":[]},
@@ -843,7 +843,6 @@
"36d6a9a871d949ea": {"kind":"literal","value":"approval/policy"},
"37184378c6439257": {"kind":"object","properties":[{"name":"data","type":"a853902cfab417b8","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"f1996af2602e6f62","optional":false}],"indices":[]},
"374fdd68aee5ff84": {"kind":"object","properties":[{"name":"delayMs","type":"0657d3ca5ac4e7bf","optional":false},{"name":"failure","type":"5f2117d1856a5ab4","optional":false},{"name":"mode","type":"142c37d302aa22a0","optional":false},{"name":"policyKey","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"retry","type":"0657d3ca5ac4e7bf","optional":false},{"name":"retryId","type":"4cd48f3e5108bd6e","optional":false},{"name":"step","type":"0657d3ca5ac4e7bf","optional":false},{"name":"turn","type":"0657d3ca5ac4e7bf","optional":false}],"indices":[]},
- "376ab95962d99133": {"kind":"object","properties":[{"name":"data","type":"40a4c38943f2e5ee","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
"378f90f9f6022a09": {"kind":"literal","value":"approval/decided"},
"37cbc9cf06d494cf": {"kind":"object","properties":[{"name":"data","type":"b158f3ff69237148","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"70b082fe78991edf","optional":false}],"indices":[]},
"37ff65426bcf130f": {"kind":"object","properties":[{"name":"type","type":"0b9b8facbe2c1977","optional":false}],"indices":[]},
@@ -871,7 +870,6 @@
"3fdf9582c3b5597d": {"kind":"object","properties":[{"name":"afterSeconds","type":"0657d3ca5ac4e7bf","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"5b232a9b9bfcc0fc","optional":false},{"name":"prompt","type":"4cd48f3e5108bd6e","optional":false},{"name":"scheduledAt","type":"4cd48f3e5108bd6e","optional":false},{"name":"title","type":"4cd48f3e5108bd6e","optional":true}],"indices":[]},
"4018a00144474b6c": {"kind":"object","properties":[{"name":"blockedBy","type":"93c33d9687613293","optional":false},{"name":"description","type":"4cd48f3e5108bd6e","optional":false},{"name":"id","type":"4cd48f3e5108bd6e","optional":false},{"name":"ownerId","type":"4cd48f3e5108bd6e","optional":true},{"name":"ownerName","type":"4cd48f3e5108bd6e","optional":true},{"name":"revision","type":"0657d3ca5ac4e7bf","optional":false},{"name":"status","type":"b2d2a01e51341a3b","optional":false},{"name":"subject","type":"4cd48f3e5108bd6e","optional":false},{"name":"writeScopes","type":"93c33d9687613293","optional":false}],"indices":[]},
"408927267422a7b2": {"kind":"object","properties":[{"name":"form","type":"fee1caf8ab6a65c1","optional":false},{"name":"kind","type":"0fe52387f6505270","optional":false}],"indices":[]},
- "40a4c38943f2e5ee": {"kind":"object","properties":[{"name":"anchor","type":"4cd48f3e5108bd6e","optional":true},{"name":"cwd","type":"4cd48f3e5108bd6e","optional":false}],"indices":[]},
"4208123b50df5006": {"kind":"object","properties":[{"name":"data","type":"ad0c38a0adb82a94","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"3e0eff5946255ff0","optional":false}],"indices":[]},
"42e0916e0dda5f6d": {"kind":"object","properties":[{"name":"data","type":"7f9365bae9fcb73e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"fe792a6cd4304945","optional":false}],"indices":[]},
"42e2ff61928fb7df": {"kind":"array","element":"c51f0d0a405bb96f"},
@@ -925,6 +923,7 @@
"570e850224346133": {"kind":"literal","value":"tool/result"},
"576a2de8355eb098": {"kind":"object","properties":[{"name":"compactionId","type":"4cd48f3e5108bd6e","optional":false},{"name":"maxTokens","type":"0657d3ca5ac4e7bf","optional":true},{"name":"model","type":"4cd48f3e5108bd6e","optional":false},{"name":"provider","type":"4cd48f3e5108bd6e","optional":false},{"name":"rawOutput","type":"b52f215a6cd69105","optional":true},{"name":"shadowedRange","type":"9e41386b3a0c9572","optional":false},{"name":"shadowedSeqs","type":"5d03ba38734809bc","optional":false},{"name":"shadowedTokenCount","type":"0657d3ca5ac4e7bf","optional":false},{"name":"sourceCommandId","type":"4cd48f3e5108bd6e","optional":true},{"name":"summary","type":"b52f215a6cd69105","optional":false},{"name":"usage","type":"fec5442b9ee4122e","optional":true}],"indices":[]},
"5776e5553ff2dfe3": {"kind":"union","types":["7af85bf70d4eafce","998f22585a5d73ec","e3e77b26f0148755"]},
+ "57adfa774e919b1e": {"kind":"object","properties":[{"name":"cwd","type":"4cd48f3e5108bd6e","optional":false},{"name":"workspace","type":"dacf3d5f3e4ff619","optional":true}],"indices":[]},
"57f3f606ff8b6c84": {"kind":"literal","value":"stop"},
"58015da1c1950a66": {"kind":"object","properties":[{"name":"form","type":"aec150797b655c5f","optional":false},{"name":"kind","type":"24b10f7cdae64928","optional":false}],"indices":[]},
"5808e36c95355f0e": {"kind":"union","types":["1d76406cbb2ddadb","287211846beea1ec","693f4952fb5565da","8e31bb958e9b015e","ab7ec5f9eb2c6dfa"]},
@@ -1246,6 +1245,7 @@
"d9196086e41e4dd5": {"kind":"literal","value":"complete"},
"d9c462b9f62fdd3e": {"kind":"object","properties":[{"name":"callId","type":"4cd48f3e5108bd6e","optional":false},{"name":"kind","type":"a13d8f379222ece8","optional":false}],"indices":[]},
"d9edf1862e4471d6": {"kind":"literal","value":"schedule"},
+ "d9faba79a3513ba5": {"kind":"object","properties":[{"name":"data","type":"57adfa774e919b1e","optional":false},{"name":"ignorable","type":"dacf3d5f3e4ff619","optional":true},{"name":"seq","type":"0657d3ca5ac4e7bf","optional":false},{"name":"time","type":"0657d3ca5ac4e7bf","optional":false},{"name":"type","type":"d4c799e3d51cae10","optional":false}],"indices":[]},
"dacf3d5f3e4ff619": {"kind":"literal","value":true},
"db06ef35b27a3842": {"kind":"object","properties":[{"name":"form","type":"6f9e00383836275e","optional":false},{"name":"kind","type":"1f1385dbc3e875c0","optional":false},{"name":"sections","type":"c748fb42c80a1200","optional":false}],"indices":[]},
"db6c5246911d47a7": {"kind":"literal","value":"webhook"},
diff --git a/docs/subsystems/subagent.i18n.yaml b/docs/subsystems/subagent.i18n.yaml
index 8a6bd71c02..ccb89d5569 100644
--- a/docs/subsystems/subagent.i18n.yaml
+++ b/docs/subsystems/subagent.i18n.yaml
@@ -6,8 +6,8 @@
en: 3d828004dee084c6
zh: f71296b677691151
/subagents/capabilities-and-activation-requests:
- en: f09270fcd7bfa26a
- zh: 082664920b3c65e2
+ en: b3ef56aa6c4fca62
+ zh: 2f32795880fb89dc
/subagents/local-children-and-activations:
en: 6f87231d18d82916
zh: 9f064b23058f8766
diff --git a/docs/subsystems/subagent.md b/docs/subsystems/subagent.md
index 488ef66ac4..24d2f8f0e8 100644
--- a/docs/subsystems/subagent.md
+++ b/docs/subsystems/subagent.md
@@ -8,7 +8,7 @@ The unified activation API manages local conversations and external executions.
Every backend uses startActivation. Capability flags validate request options; prepareContinuable selects local Agent creation, while start selects one external execution. The model-facing tool uses parent delivery. Workflow and code mode consumers can await caller results without injecting another parent message. Historical children with unavailable descriptors remain discoverable as `mode: 'unknown'` without granting continuation capabilities; the [package README](../../packages/subagent/subagent/README.md) defines catalog persistence.
-Optional `cwd` selects the child's initial directory; relative paths resolve against the parent's current effective directory. Omitting it captures that directory at admission. Local child Sessions retain the parent's original project, and cold resume retains their logged directory state.
+Optional Host-chosen `cwd` selects the child's initial directory, which becomes its workspace; a relative path resolves against the parent's workspace root. Omitting it captures that root at admission. The model-facing delegation tools pass no directory. Local child Sessions retain the parent's original project, and cold resume retains their logged directory state.
```ts type-equiv
/**
@@ -76,7 +76,10 @@ interface SubagentActivation {
* shares these task options and defines its own label and cancellation policy.
*/
interface SubagentStartRequest {
- /** Initial child directory; relative paths resolve against the parent's current directory. Omitted inherits that directory at start. */
+ /**
+ * Host-chosen initial child directory, which becomes the child's workspace; a relative path resolves
+ * against the parent's workspace root. Omitted starts the child in that root.
+ */
readonly cwd?: string
/**
* Independent preset id; omission joins the parent's current generation.
@@ -89,7 +92,7 @@ interface SubagentStartRequest {
/** Content delivered as the child's user message. */
readonly prompt: ContentBlock[]
/**
- * The spawning agent. Its effective directory supplies the default cwd;
+ * The spawning agent. Its workspace root supplies the default cwd;
* in-process children retain its origin, lineage, and delegation depth.
*/
readonly parent: Agent
diff --git a/docs/subsystems/subagent.zh.md b/docs/subsystems/subagent.zh.md
index 8f1d6b74a2..4985e9b753 100644
--- a/docs/subsystems/subagent.zh.md
+++ b/docs/subsystems/subagent.zh.md
@@ -8,7 +8,7 @@
所有后端都使用 startActivation。能力标记校验请求选项;prepareContinuable 选择本地 Agent 创建,start 选择一次外部执行。面向模型的工具采用 parent 回传。Workflow 与 code mode 消费者可以等待 caller 结果,不额外向父代理注入消息。历史子会话的 descriptor 不可用时,以 `mode: 'unknown'` 保持可发现性,但不授予继续执行能力;[包 README](../../packages/subagent/subagent/README.zh.md) 定义目录持久化语义。
-可选的 `cwd` 指定子级的初始目录;相对路径以父级当前有效目录为基准解析。省略时,在准入阶段捕获该目录。本地子 Session 保留父级的原始项目,冷恢复保留其日志中的目录状态。
+由 Host 选定的可选 `cwd` 指定子级的初始目录,该目录成为它的工作区;相对路径以父级的工作区根为基准解析。省略时,在准入阶段捕获该根。面向模型的委派工具不传目录。本地子 Session 保留父级的原始项目,冷恢复保留其日志中的目录状态。
```ts type-equiv
/**
@@ -76,7 +76,10 @@ interface SubagentActivation {
* shares these task options and defines its own label and cancellation policy.
*/
interface SubagentStartRequest {
- /** Initial child directory; relative paths resolve against the parent's current directory. Omitted inherits that directory at start. */
+ /**
+ * Host-chosen initial child directory, which becomes the child's workspace; a relative path resolves
+ * against the parent's workspace root. Omitted starts the child in that root.
+ */
readonly cwd?: string
/**
* Independent preset id; omission joins the parent's current generation.
@@ -89,7 +92,7 @@ interface SubagentStartRequest {
/** Content delivered as the child's user message. */
readonly prompt: ContentBlock[]
/**
- * The spawning agent. Its effective directory supplies the default cwd;
+ * The spawning agent. Its workspace root supplies the default cwd;
* in-process children retain its origin, lineage, and delegation depth.
*/
readonly parent: Agent
diff --git a/docs/subsystems/working-directory.i18n.yaml b/docs/subsystems/working-directory.i18n.yaml
index 86c237635c..d7f4b67719 100644
--- a/docs/subsystems/working-directory.i18n.yaml
+++ b/docs/subsystems/working-directory.i18n.yaml
@@ -6,11 +6,8 @@
en: 0882d8b4c09c2890
zh: a75af7ce19f661fa
/working-directory/directory-selection:
- en: 463af17e701bd653
- zh: f5fbedddb5d0cecf
+ en: 10a39c74c5e52aa8
+ zh: 60cdfeac98798e40
/working-directory/model-context:
- en: 2c27d5dfe7abbd4c
- zh: 4e6dc26dff03edad
-/working-directory/relocation:
- en: bf5100b06b3c0320
- zh: 976187ef3ed39e17
+ en: 872112549d003dca
+ zh: 48bfd30fdf25c234
diff --git a/docs/subsystems/working-directory.md b/docs/subsystems/working-directory.md
index ed82da1db6..802b565c0a 100644
--- a/docs/subsystems/working-directory.md
+++ b/docs/subsystems/working-directory.md
@@ -6,53 +6,15 @@ A Session's active directory is owned by [`dsh-working-directory`](../../package
## Directory selection
-`ctx.workingDirectory.get(session)` reads the logged value. `ensure(agent)` validates it and restores the original project when the directory disappeared. `set(agent, path)` validates and records a requested change. Sessions without a header directory use the configured runtime fallback; an unavailable fallback produces an error.
+`ctx.workingDirectory.get(session)` reads the logged value. `ensure(agent)` validates it and restores the original project when the directory disappeared. `set(agent, path)` validates and records a move that a Host operation chose, such as worktree creation, the forge panel, or an SDK request; the model has no tool that moves the directory. Sessions without a header directory use the configured runtime fallback; an unavailable fallback produces an error.
-`rootOf(session)` reads the workspace root: the longest registered anchor that contains the current directory. The anchors are the original project and every checkout `relocate(agent, root, { cwd? })` entered; that operation validates the root and the directory inside it, then records both in one `working-directory/change` whose `anchor` names the root. `anchorsOf(session)` lists them. A `set` inside the root moves only the current directory; a `set` into another anchor selects that anchor as the root; a `set` outside every anchor leaves the root unchanged. Recovery to the original project selects it as the root again. Anchors compare lexically on canonical paths: producers record the original project by its canonical spelling, a Session without a recorded project registers the deployment fallback as its first anchor, and a recovery destination outside every anchor joins the anchors.
+`rootOf(session)` reads the workspace root. Every change the service records carries `workspace: true` and moves the root with the directory, so the two are equal. They differ only in a Session whose log holds a change without that marker, recorded while the model could move the directory: such a change moves the directory and leaves the root at the original project until the next recorded change.
Changes are local to one Session. Relative filesystem operations, newly started processes, instruction discovery, skills, and file completion use the active directory. Existing terminals and persistent shells retain their own directories. Sandbox writable roots and project membership remain anchored to the original project.
## Model context
-The initial value and subsequent current values reach the model as required user-context snapshots, even when optional runtime context is disabled; a snapshot adds a `Workspace root` line while the current directory differs from the root. Each committed change attempts to queue a notice through the ordinary Agent inbox, and a change that selects another root ends its notice with that root; cancellation or disposal can discard notices before request admission. The directory event survives, and the next admitted request receives the current value. Directory context never enters the system prompt. [`working_directory`](../../packages/session/tool-working-directory/README.md) exposes one optional `cd` argument.
-
-## Relocation
-
-`relocate` takes the new root and these options, and resolves to the directories it committed. `inherit(agent, source, { cwd, signal? })` starts one Session's directories from another's: when the source works in a registered checkout other than the starting Session's original project and the canonical `cwd` lies inside it, the checkout is registered through `relocate`; otherwise only the directory is set. The source's other anchors are not passed on, and its later changes do not reach the started Session.
-
-```ts type-equiv
-/** Options of {@link WorkingDirectoryService.relocate}. */
-interface RelocateOptions {
- /** Directory to enter inside the new root, absolute or relative to that root; omission enters the root itself. */
- cwd?: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-```
-
-```ts type-equiv
-/** Options of {@link WorkingDirectoryService.inherit}. */
-interface InheritOptions {
- /** Canonical absolute directory the Session starts in, spelled as the service records directories. */
- cwd: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-```
-
-```ts type-equiv
-/** The committed outcome of {@link WorkingDirectoryService.relocate} and {@link WorkingDirectoryService.inherit}. */
-interface RelocatedDirectories {
- /**
- * Canonical absolute workspace root the commit selected: the longest registered anchor containing
- * `cwd`. This is the registered root unless a more specific anchor, such as an original project
- * inside it, already contains `cwd`.
- */
- root: string
- /** Canonical absolute current directory inside `root`. */
- cwd: string
-}
-```
+The initial value and subsequent current values reach the model as required user-context snapshots, even when optional runtime context is disabled. Each committed change attempts to queue a notice through the ordinary Agent inbox; cancellation or disposal can discard notices before request admission. The directory event survives, and the next admitted request receives the current value. Directory context never enters the system prompt.
@@ -66,9 +28,9 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
### `ctx.workingDirectory` — `WorkingDirectoryService`
-One owner for each Session's effective directory, its workspace root, and their model-visible changes.
+One owner for each Session's directory, its workspace root, and their model-visible changes.
-The current directory is the cursor every relative path resolves from. The workspace root is the checkout that cursor is in: the longest registered anchor containing it. Anchors are the original project plus every checkout a relocate entered, so an ordinary set inside the root moves only the cursor, a `set` into another anchor switches the root to that anchor, and a `set` outside every anchor moves the cursor and leaves the root.
+A Session works in one directory. Relative paths resolve from it, and it is the workspace root that the write boundary, file views, and discovery follow. Only Host operations move it, through set or the recovery of ensure; every such change moves both. The two differ only in a Session whose log holds a change without the `workspace` marker.
```ts cordis-catalog
/**
@@ -81,35 +43,26 @@ get(session: Session): string
/**
* Read the committed workspace root without filesystem I/O.
* @param session - Session whose root is requested.
- * @returns the registered anchor containing the current directory, or the deployment default when none is recorded.
+ * @returns the directory of the last change that moved the workspace, the original project before any,
+ * or the deployment default when none is recorded.
*/
rootOf(session: Session): string
-/**
- * Read the registered workspace anchors without filesystem I/O.
- * @param session - Session whose anchors are requested.
- * @returns anchors in registration order, the original project first when the header records one.
- */
-anchorsOf(session: Session): readonly string[]
-
/**
* Validate the current directory and restore the original project when it disappeared.
* @param agent - live or unpublished Agent owning the Session.
* @param signal - cancellation for filesystem inspection.
- * @returns the existing directory; recovery is committed before fulfillment.
- * A Session without a recorded project records the deployment fallback as its first anchor on its
- * first validation, and a recovery destination outside every anchor joins the anchors.
- * A notice failure is warned without reverting the committed state.
+ * @returns the existing directory; recovery is committed before fulfillment and moves the workspace
+ * root with the directory. A notice failure is warned without reverting the committed state.
* @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_UNAVAILABLE` when the original project is also
* unavailable or the service is disposed, or the rejection of a `working-directory/access` listener.
*/
ensure(agent: Agent, signal?: AbortSignal): Promise
/**
- * Change one Session's directory without changing existing processes or permissions.
- * The workspace root follows the registered anchors: a path inside the current
- * root keeps it, a path inside another anchor selects that anchor, and a path
- * outside every anchor leaves the root unchanged.
+ * Move one Session's workspace: its current directory and its workspace root become `path`.
+ * Existing processes keep their directories. Callers are Host operations that chose the
+ * directory; a model-supplied path would move the workspace-write boundary with it.
* @param agent - live or unpublished Agent owning the Session.
* @param path - absolute path or a path relative to its current directory.
* @param signal - cancellation before the durable change.
@@ -120,36 +73,6 @@ ensure(agent: Agent, signal?: AbortSignal): Promise
* `working-directory/access` listener.
*/
set(agent: Agent, path: string, signal?: AbortSignal): Promise
-
-/**
- * Enter another checkout: register `root` as a workspace anchor of the Session and
- * move its current directory to `options.cwd`, or to the root itself. One committed
- * event carries both; existing processes and permissions are unchanged.
- * @param agent - live or unpublished Agent owning the Session.
- * @param root - absolute checkout directory, or a path relative to the current directory.
- * @param options - directory to enter inside the root and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit;
- * the registered root is that root unless a more specific anchor already contains the directory.
- * A notice failure is warned; the next request still receives the committed directories.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_INVALID` for an empty path or a directory outside
- * the root and `WORKING_DIRECTORY_NOT_FOUND` when either path is not an existing directory.
- */
-relocate(agent: Agent, root: string, options: RelocateOptions = {}): Promise
-
-/**
- * Start a Session's directories from another Session's. When `source` works in a registered checkout
- * other than the starting Session's own original project and `options.cwd` lies inside that checkout,
- * the checkout is registered as the starting Session's anchor and `cwd` entered through {@link relocate};
- * otherwise only the current directory is set through {@link set}. Only the source's current root is
- * passed on, never its other anchors, and later changes to `source` do not reach the starting Session.
- * @param agent - live or unpublished Agent owning the Session that starts.
- * @param source - Session whose current root may be passed on; the call leaves it unchanged.
- * @param options - canonical absolute directory to start in and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_NOT_FOUND` when `options.cwd` is not an existing
- * directory, or the rejection of a `working-directory/access` listener.
- */
-async inherit(agent: Agent, source: Session, options: InheritOptions): Promise
```
Types: [Agent](core.md) · [Session](session.md)
diff --git a/docs/subsystems/working-directory.zh.md b/docs/subsystems/working-directory.zh.md
index 685a6e0a24..bdfab8dd25 100644
--- a/docs/subsystems/working-directory.zh.md
+++ b/docs/subsystems/working-directory.zh.md
@@ -6,53 +6,15 @@ Session 的当前目录由 [`dsh-working-directory`](../../packages/session/work
## 目录选择
-`ctx.workingDirectory.get(session)` 读取日志中的值。`ensure(agent)` 验证它,并在目录消失时恢复原始项目。`set(agent, path)` 验证并记录请求的变更。header 没有目录的 Session 使用配置的运行时回退目录;回退目录不可用时返回错误。
+`ctx.workingDirectory.get(session)` 读取日志中的值。`ensure(agent)` 验证它,并在目录消失时恢复原始项目。`set(agent, path)` 验证并记录由 Host 操作选定的移动,例如创建工作树、forge 面板或 SDK 请求;模型没有可以移动目录的工具。header 没有目录的 Session 使用配置的运行时回退目录;回退目录不可用时返回错误。
-`rootOf(session)` 读取工作区根:包含当前目录的最长已登记锚。锚是原始项目以及 `relocate(agent, root, { cwd? })` 进入过的每个检出目录;该操作验证根及其内部的目录,然后用一条 `anchor` 指向该根的 `working-directory/change` 同时记录两者。`anchorsOf(session)` 列出这些锚。根内部的 `set` 只移动当前目录;进入另一个锚的 `set` 把该锚选为根;所有锚之外的 `set` 不改变根。恢复到原始项目时再次把它选为根。锚在规范路径上按词法比较:生产方以规范拼写记录原始项目,没有记录项目的 Session 把部署回退目录登记为第一个锚,恢复目的地不在任何锚内时也加入锚。
+`rootOf(session)` 读取工作区根。服务记录的每次变更都带有 `workspace: true`,根随目录一起移动,因此两者相等。只有当 Session 日志中存在不带该标记的变更时两者才不同,这类变更记录于模型还能移动目录的版本:它只移动目录,根留在原始项目,直到下一次记录的变更。
变更仅影响一个 Session。相对路径文件系统操作、新启动的进程、指令发现、技能和文件补全使用当前目录。已有终端和持久 shell 保留自己的目录。沙箱可写根目录与项目归属继续绑定原始项目。
## 模型上下文
-初始值与后续当前值通过必需的用户上下文快照到达模型,即使可选运行时上下文被禁用也不例外;当前目录与根不同时,快照增加一行 `Workspace root`。每次已提交变更都会尝试通过普通 Agent 收件箱排入通知,选中另一个根的变更在通知末尾给出该根;取消或销毁可能丢弃尚未进入请求的通知。目录事件仍然保留,下一次获准进入的请求会收到当前值。目录上下文不进入系统提示词。[`working_directory`](../../packages/session/tool-working-directory/README.zh.md) 提供一个可选的 `cd` 参数。
-
-## 迁移
-
-`relocate` 接收新的根与以下选项,并解析为它提交的目录。`inherit(agent, source, { cwd, signal? })` 让一个 Session 的目录从另一个 Session 出发:来源在其原始项目之外的已登记检出目录中工作、且规范化的 `cwd` 位于其中时,通过 `relocate` 登记该检出目录;否则只设置目录。来源的其他锚不传递,它之后的变化也不影响已启动的 Session。
-
-```ts type-equiv
-/** Options of {@link WorkingDirectoryService.relocate}. */
-interface RelocateOptions {
- /** Directory to enter inside the new root, absolute or relative to that root; omission enters the root itself. */
- cwd?: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-```
-
-```ts type-equiv
-/** Options of {@link WorkingDirectoryService.inherit}. */
-interface InheritOptions {
- /** Canonical absolute directory the Session starts in, spelled as the service records directories. */
- cwd: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-```
-
-```ts type-equiv
-/** The committed outcome of {@link WorkingDirectoryService.relocate} and {@link WorkingDirectoryService.inherit}. */
-interface RelocatedDirectories {
- /**
- * Canonical absolute workspace root the commit selected: the longest registered anchor containing
- * `cwd`. This is the registered root unless a more specific anchor, such as an original project
- * inside it, already contains `cwd`.
- */
- root: string
- /** Canonical absolute current directory inside `root`. */
- cwd: string
-}
-```
+初始值与后续当前值通过必需的用户上下文快照到达模型,即使可选运行时上下文被禁用也不例外。每次已提交变更都会尝试通过普通 Agent 收件箱排入通知;取消或销毁可能丢弃尚未进入请求的通知。目录事件仍然保留,下一次获准进入的请求会收到当前值。目录上下文不进入系统提示词。
@@ -66,9 +28,9 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
### `ctx.workingDirectory` — `WorkingDirectoryService`
-One owner for each Session's effective directory, its workspace root, and their model-visible changes.
+One owner for each Session's directory, its workspace root, and their model-visible changes.
-The current directory is the cursor every relative path resolves from. The workspace root is the checkout that cursor is in: the longest registered anchor containing it. Anchors are the original project plus every checkout a relocate entered, so an ordinary set inside the root moves only the cursor, a `set` into another anchor switches the root to that anchor, and a `set` outside every anchor moves the cursor and leaves the root.
+A Session works in one directory. Relative paths resolve from it, and it is the workspace root that the write boundary, file views, and discovery follow. Only Host operations move it, through set or the recovery of ensure; every such change moves both. The two differ only in a Session whose log holds a change without the `workspace` marker.
```ts cordis-catalog
/**
@@ -81,35 +43,26 @@ get(session: Session): string
/**
* Read the committed workspace root without filesystem I/O.
* @param session - Session whose root is requested.
- * @returns the registered anchor containing the current directory, or the deployment default when none is recorded.
+ * @returns the directory of the last change that moved the workspace, the original project before any,
+ * or the deployment default when none is recorded.
*/
rootOf(session: Session): string
-/**
- * Read the registered workspace anchors without filesystem I/O.
- * @param session - Session whose anchors are requested.
- * @returns anchors in registration order, the original project first when the header records one.
- */
-anchorsOf(session: Session): readonly string[]
-
/**
* Validate the current directory and restore the original project when it disappeared.
* @param agent - live or unpublished Agent owning the Session.
* @param signal - cancellation for filesystem inspection.
- * @returns the existing directory; recovery is committed before fulfillment.
- * A Session without a recorded project records the deployment fallback as its first anchor on its
- * first validation, and a recovery destination outside every anchor joins the anchors.
- * A notice failure is warned without reverting the committed state.
+ * @returns the existing directory; recovery is committed before fulfillment and moves the workspace
+ * root with the directory. A notice failure is warned without reverting the committed state.
* @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_UNAVAILABLE` when the original project is also
* unavailable or the service is disposed, or the rejection of a `working-directory/access` listener.
*/
ensure(agent: Agent, signal?: AbortSignal): Promise
/**
- * Change one Session's directory without changing existing processes or permissions.
- * The workspace root follows the registered anchors: a path inside the current
- * root keeps it, a path inside another anchor selects that anchor, and a path
- * outside every anchor leaves the root unchanged.
+ * Move one Session's workspace: its current directory and its workspace root become `path`.
+ * Existing processes keep their directories. Callers are Host operations that chose the
+ * directory; a model-supplied path would move the workspace-write boundary with it.
* @param agent - live or unpublished Agent owning the Session.
* @param path - absolute path or a path relative to its current directory.
* @param signal - cancellation before the durable change.
@@ -120,36 +73,6 @@ ensure(agent: Agent, signal?: AbortSignal): Promise
* `working-directory/access` listener.
*/
set(agent: Agent, path: string, signal?: AbortSignal): Promise
-
-/**
- * Enter another checkout: register `root` as a workspace anchor of the Session and
- * move its current directory to `options.cwd`, or to the root itself. One committed
- * event carries both; existing processes and permissions are unchanged.
- * @param agent - live or unpublished Agent owning the Session.
- * @param root - absolute checkout directory, or a path relative to the current directory.
- * @param options - directory to enter inside the root and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit;
- * the registered root is that root unless a more specific anchor already contains the directory.
- * A notice failure is warned; the next request still receives the committed directories.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_INVALID` for an empty path or a directory outside
- * the root and `WORKING_DIRECTORY_NOT_FOUND` when either path is not an existing directory.
- */
-relocate(agent: Agent, root: string, options: RelocateOptions = {}): Promise
-
-/**
- * Start a Session's directories from another Session's. When `source` works in a registered checkout
- * other than the starting Session's own original project and `options.cwd` lies inside that checkout,
- * the checkout is registered as the starting Session's anchor and `cwd` entered through {@link relocate};
- * otherwise only the current directory is set through {@link set}. Only the source's current root is
- * passed on, never its other anchors, and later changes to `source` do not reach the starting Session.
- * @param agent - live or unpublished Agent owning the Session that starts.
- * @param source - Session whose current root may be passed on; the call leaves it unchanged.
- * @param options - canonical absolute directory to start in and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_NOT_FOUND` when `options.cwd` is not an existing
- * directory, or the rejection of a `working-directory/access` listener.
- */
-async inherit(agent: Agent, source: Session, options: InheritOptions): Promise
```
Types: [Agent](core.zh.md) · [Session](session.zh.md)
diff --git a/docs/subsystems/worktrees.i18n.yaml b/docs/subsystems/worktrees.i18n.yaml
index 062734c07f..80589981fe 100644
--- a/docs/subsystems/worktrees.i18n.yaml
+++ b/docs/subsystems/worktrees.i18n.yaml
@@ -3,11 +3,11 @@
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/worktrees.md
/git-worktrees:
- en: 9fa0caba0e6b989f
- zh: 17afc83e1cd7268c
+ en: 3a3d69d2b12a78f9
+ zh: a7a7d12487968bbc
/git-worktrees/creation-and-retention:
- en: 195894ced2e675dc
- zh: 5ed3a6ff729496c2
+ en: 9bdaf8d6ceb93030
+ zh: 031f9702c3ccb35e
/git-worktrees/request-and-result:
en: fbab866bf824d6e0
zh: 73d2a1ee350e1434
diff --git a/docs/subsystems/worktrees.md b/docs/subsystems/worktrees.md
index d74540705d..4394785ebc 100644
--- a/docs/subsystems/worktrees.md
+++ b/docs/subsystems/worktrees.md
@@ -2,15 +2,15 @@
English | [中文](worktrees.zh.md)
-The experimental [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.md) service provides `ctx.worktrees`. Its [`create_worktree`](../../packages/experimental/tool-worktree/README.md) consumer creates a new Git branch and checkout, then relocates the Session into it through the [working-directory service](working-directory.md), which registers the checkout as a workspace anchor; as the longest anchor containing the new current directory it becomes the Session's workspace root. The [Change requests & worktrees bundle](../../packages/experimental/forge-bundle/README.md#use-this-package) loads both packages through the GUI plugin manager and ships switched off. Other profiles can select the [standalone worktree bundle](../../packages/experimental/tool-worktree/README.md#use-this-package) or mount the two packages explicitly.
+The experimental [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.md) service provides `ctx.worktrees`. Its [`create_worktree`](../../packages/experimental/tool-worktree/README.md) consumer creates a new Git branch and checkout, then selects it through the [working-directory service](working-directory.md). The [Change requests & worktrees bundle](../../packages/experimental/forge-bundle/README.md#use-this-package) loads both packages through the GUI plugin manager and ships switched off. Other profiles can select the [standalone worktree bundle](../../packages/experimental/tool-worktree/README.md#use-this-package) or mount the two packages explicitly.
## Creation and retention
The calling Session's current directory selects the source repository. Creation pins the requested local commit, branch, or tag before allocating the checkout; omission selects `HEAD`. Each name must identify a new branch and an unused checkout path. The operation neither fetches missing objects nor copies staged, unstaged, untracked, or ignored files from the source checkout.
-The default destination is `/.agents/worktrees/`. `repositoryRoot` is the top-level directory of the caller’s current checkout; a linked checkout therefore contains its own pool. The service writes a `.gitignore` containing `*` and a trailing newline only when its allocation creates the configured pool directory. Existing files and ignore rules are preserved. The calling Session’s existing sandbox policy must permit writes to the destination and shared Git administration directory. Successful Git setup precedes the working-directory relocation.
+The default destination is `/.agents/worktrees/`. `repositoryRoot` is the top-level directory of the caller’s current checkout; a linked checkout therefore contains its own pool. The service writes a `.gitignore` containing `*` and a trailing newline only when its allocation creates the configured pool directory. Existing files and ignore rules are preserved. The calling Session’s existing sandbox policy must permit writes to the destination and shared Git administration directory. Successful Git setup precedes the working-directory change.
-Leaving through `working_directory({ cd: path })` retains the checkout and branch. Cancellation or failure can also retain partial artifacts; the error identifies their location. The service aborts and drains pending operations on disposal. The [package README](../../packages/experimental/worktree/README.md) owns configuration and Git requirements.
+`ctx.worktrees.exit(agent)`, which the `exit_worktree` tool calls, returns the Session to the source checkout of the recorded worktree that contains its current directory; the checkout and branch remain. Nested worktrees exit one level at a time. Cancellation or failure can also retain partial artifacts; the error identifies their location. The service aborts and drains pending operations on disposal. The [package README](../../packages/experimental/worktree/README.md) owns configuration and Git requirements.
## Request and result
@@ -143,6 +143,18 @@ async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortS
*/
async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise
+/**
+ * Return the calling Session from the worktree it works in to the source checkout that worktree was
+ * created from. The worktree is the recorded creation, the Session's own or fork-inherited, with the
+ * longest directory containing the Session's current directory. Its checkout and branch remain.
+ * @param agent - caller whose current directory lies in a recorded worktree.
+ * @param signal - cancellation of directory validation and of the working-directory change.
+ * @returns the worktree the Session left; the Session now works in its `repositoryRoot`.
+ * @throws when no recorded worktree contains the current directory, or the working-directory
+ * service's error when the source checkout no longer exists.
+ */
+async exit(agent: Agent, signal?: AbortSignal): Promise
+
/**
* Read the archive cleanup of a Session's created checkout; waiting never
* starts one. Absent without the Workspace and query providers.
diff --git a/docs/subsystems/worktrees.zh.md b/docs/subsystems/worktrees.zh.md
index 1b26bab835..18af33a628 100644
--- a/docs/subsystems/worktrees.zh.md
+++ b/docs/subsystems/worktrees.zh.md
@@ -2,15 +2,15 @@
[English](worktrees.md) | 中文
-实验性的 [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.zh.md) 服务提供 `ctx.worktrees`。其消费方 [`create_worktree`](../../packages/experimental/tool-worktree/README.zh.md) 创建新的 Git 分支与检出目录,再通过[工作目录服务](working-directory.zh.md)把 Session 迁入其中,把该检出目录登记为工作区锚;它是包含新当前目录的最长锚,因此成为 Session 的工作区根。[变更请求与工作树组合包](../../packages/experimental/forge-bundle/README.zh.md#use-this-package)通过 GUI 插件管理器一起加载这两个包,随安装提供但默认关闭。其他 profile 可以选择[独立工作树组合包](../../packages/experimental/tool-worktree/README.zh.md#use-this-package),或显式挂载这两个包。
+实验性的 [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.zh.md) 服务提供 `ctx.worktrees`。其消费方 [`create_worktree`](../../packages/experimental/tool-worktree/README.zh.md) 创建新的 Git 分支与检出目录,再通过[工作目录服务](working-directory.zh.md)选中它。[变更请求与工作树组合包](../../packages/experimental/forge-bundle/README.zh.md#use-this-package)通过 GUI 插件管理器一起加载这两个包,随安装提供但默认关闭。其他 profile 可以选择[独立工作树组合包](../../packages/experimental/tool-worktree/README.zh.md#use-this-package),或显式挂载这两个包。
## 创建与保留
调用方 Session 的当前目录决定源仓库。创建操作在分配检出目录前,将请求的本地提交、分支或标签固定为具体提交;省略时选择 `HEAD`。每个名称必须对应新分支与未使用的检出路径。操作既不获取缺失对象,也不复制源检出目录中的暂存、未暂存、未跟踪或被忽略文件。
-默认目标为 `/.agents/worktrees/`。`repositoryRoot` 是调用方当前检出目录的顶层目录;因此,链接检出目录会在自身内部保存工作树父目录。仅当服务的分配操作创建了配置指定的父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`。已有文件与忽略规则保持不变。调用方 Session 的现有沙箱策略必须允许写入目标目录与共享 Git 管理目录。Git 初始化成功后才迁移工作目录。
+默认目标为 `/.agents/worktrees/`。`repositoryRoot` 是调用方当前检出目录的顶层目录;因此,链接检出目录会在自身内部保存工作树父目录。仅当服务的分配操作创建了配置指定的父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`。已有文件与忽略规则保持不变。调用方 Session 的现有沙箱策略必须允许写入目标目录与共享 Git 管理目录。Git 初始化成功后才改变工作目录。
-通过 `working_directory({ cd: path })` 离开时,会保留检出目录与分支。取消或失败也可能留下部分产物;错误会指出它们的位置。服务销毁时会中止待完成操作并等待它们结束。[包 README](../../packages/experimental/worktree/README.zh.md)拥有配置与 Git 要求。
+`exit_worktree` 工具调用的 `ctx.worktrees.exit(agent)` 找到包含 Session 当前目录的已记录工作树,把 Session 送回它的源检出;检出目录与分支保留。嵌套的工作树每次退出一层。取消或失败也可能留下部分产物;错误会指出它们的位置。服务销毁时会中止待完成操作并等待它们结束。[包 README](../../packages/experimental/worktree/README.zh.md)拥有配置与 Git 要求。
## 请求与结果
@@ -143,6 +143,18 @@ async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortS
*/
async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise
+/**
+ * Return the calling Session from the worktree it works in to the source checkout that worktree was
+ * created from. The worktree is the recorded creation, the Session's own or fork-inherited, with the
+ * longest directory containing the Session's current directory. Its checkout and branch remain.
+ * @param agent - caller whose current directory lies in a recorded worktree.
+ * @param signal - cancellation of directory validation and of the working-directory change.
+ * @returns the worktree the Session left; the Session now works in its `repositoryRoot`.
+ * @throws when no recorded worktree contains the current directory, or the working-directory
+ * service's error when the source checkout no longer exists.
+ */
+async exit(agent: Agent, signal?: AbortSignal): Promise
+
/**
* Read the archive cleanup of a Session's created checkout; waiting never
* starts one. Absent without the Workspace and query providers.
diff --git a/docs/tool-catalog.i18n.yaml b/docs/tool-catalog.i18n.yaml
index 54f6107f2b..08baa40e48 100644
--- a/docs/tool-catalog.i18n.yaml
+++ b/docs/tool-catalog.i18n.yaml
@@ -9,8 +9,8 @@
en: 6cc2cd9ced70bb09
zh: 1c0e6cb4ba2ed637
/tool-schema-catalog/tool-package-map:
- en: 1bec3e5c70eae394
- zh: 922d507fa65ae319
+ en: ac591f2ea0a59430
+ zh: c4398e379f658ab9
/tool-schema-catalog/deepseek-ai-dsh-plugin-manager:
en: e0143916bb634762
zh: e0143916bb634762
@@ -318,20 +318,17 @@
en: dea62d26fb18ff68
zh: dea62d26fb18ff68
/tool-schema-catalog/deepseek-ai-dsh-tool-todo/todo-write:
- en: f252137b940b38d1
- zh: 25bd9c6b1ce783d8
-/tool-schema-catalog/deepseek-ai-dsh-tool-working-directory:
- en: 1bdc4627ca4fff29
- zh: 1bdc4627ca4fff29
-/tool-schema-catalog/deepseek-ai-dsh-tool-working-directory/working-directory:
- en: ac1944f6035b8b50
- zh: f5fc005c13185211
+ en: 5cc19600afcd3e98
+ zh: 3740c4a584cde8a5
/tool-schema-catalog/deepseek-ai-dsh-experimental-tool-worktree:
en: d5f5679abe86e316
zh: d5f5679abe86e316
/tool-schema-catalog/deepseek-ai-dsh-experimental-tool-worktree/create-worktree:
- en: 41950f76db71e7f7
- zh: 654d2e5505ff3d3c
+ en: d06b107645e340bf
+ zh: 1b996d4980edf6fc
+/tool-schema-catalog/deepseek-ai-dsh-experimental-tool-worktree/exit-worktree:
+ en: 499364c213893caf
+ zh: 1f08cbfce523be98
/tool-schema-catalog/deepseek-ai-dsh-tool-workflow:
en: bb38a9d29f46563c
zh: bb38a9d29f46563c
diff --git a/docs/tool-catalog.md b/docs/tool-catalog.md
index 16c42b6393..c90278dd64 100644
--- a/docs/tool-catalog.md
+++ b/docs/tool-catalog.md
@@ -47,8 +47,7 @@ This table connects model-visible tool names to the plugin package and service s
| `@deepseek-ai/dsh-tool-jobs` | `job_kill`, `job_list`, `job_output` | `ctx.tools`, `ctx.jobs`, `ctx.systemPrompt` | `tool/call`, `tool/result`, `user/message via agent.inject() for background completion notices` | - | The kind-agnostic background-job controller: background bash commands and PTY sends are read, listed, and killed through the same three tools. Loading the plugin attaches the controller that arms producers' `ctx.jobs.start()`. |
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | Four task-board tools share the subagent tree’s root Session. Enabling Team mode on the root Session adds task-board guidance alongside standard subagent delegation and control tools. Standard subagent controls provide required identity independently of Team mode. |
| `@deepseek-ai/dsh-tool-todo` | `todo_write` | `ctx.tools`, `owning Agent session` | `tool/call`, `todo/write`, `tool/result` | - | todo_write is session-owned state; UIs render the latest todo/write event as a checklist. `allowParallelInProgress` is required with no default, so the catalog states its choice: `true`, whose description invites several `in_progress` items. A deployment choosing `false` receives the same tool with a description asking for exactly one active task. |
-| `@deepseek-ai/dsh-tool-working-directory` | `working_directory` | `ctx.tools`, `ctx.workingDirectory` | `tool/call`, `working-directory/change`, `user context for directory changes`, `tool/result` | - | Reads or changes the calling Session directory. Existing shells and processes retain their own directories; origin metadata and permission roots stay fixed. |
-| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout. |
+| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree`, `exit_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. `exit_worktree` returns the Session to the source checkout; the branch and checkout remain. |
| `@deepseek-ai/dsh-tool-workflow` | `workflow` | `ctx.tools`, `ctx.workflowEngine`, `ctx.systemPrompt`, `a calling Agent (exec.agent parents the script children)` | `tool/call`, `tool/result` | - | - |
| `@deepseek-ai/dsh-tool-workspace-dependencies` | `load_workspace_dependencies` | `ctx.tools` | `tool/call`, `tool/result` | - | - |
| `@deepseek-ai/dsh-tool-web` | `web_fetch`, `web_search` | `ctx.tools`, `ctx.web`, `ctx.systemPrompt` | `tool/call`, `tool/result` | - | web_search and web_fetch keep provider selection behind ctx.web so model-visible schemas stay stable across backend swaps. |
@@ -2182,10 +2181,6 @@ Delegate a self-contained task to a configured external agent. Choose its runtim
"prompt": {
"type": "string",
"description": "The complete, self-contained task. Include all context the external agent needs."
- },
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omission inherits it."
}
},
"required": [
@@ -2234,10 +2229,6 @@ Delegate a self-contained task to a subagent (a separate agent that works in its
{
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -2646,37 +2637,13 @@ Source: [`packages/todo/tool-todo/src/index.ts`](../packages/todo/tool-todo/src/
todo_write is session-owned state; UIs render the latest todo/write event as a checklist. `allowParallelInProgress` is required with no default, so the catalog states its choice: `true`, whose description invites several `in_progress` items. A deployment choosing `false` receives the same tool with a description asking for exactly one active task.
-
-
-## `@deepseek-ai/dsh-tool-working-directory`
-
-### `working_directory`
-
-Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.
-
-```json
-{
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
-}
-```
-
-Source: [`packages/session/tool-working-directory/src/index.ts`](../packages/session/tool-working-directory/src/index.ts)
-
-Reads or changes the calling Session directory. Existing shells and processes retain their own directories; origin metadata and permission roots stay fixed.
-
## `@deepseek-ai/dsh-experimental-tool-worktree`
### `create_worktree`
-Create a new Git branch and worktree from a local commit, branch, or tag, then change this session's working directory to it. Uncommitted files stay in the source checkout. Existing names fail. Use working_directory with cd to leave; the checkout and branch remain.
+Create a new Git branch and worktree from a local commit, branch, or tag, then change this session's working directory to it. Uncommitted files stay in the source checkout. Existing names fail. exit_worktree returns to the source checkout.
```json
{
@@ -2696,7 +2663,20 @@ Create a new Git branch and worktree from a local commit, branch, or tag, then c
Source: [`packages/experimental/tool-worktree/src/index.ts`](../packages/experimental/tool-worktree/src/index.ts)
-Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout.
+### `exit_worktree`
+
+Change this session's working directory from the worktree it is in back to the checkout that worktree was created from, and report the worktree left. The worktree and its branch remain.
+
+```json
+{
+ "type": "object",
+ "properties": {}
+}
+```
+
+Source: [`packages/experimental/tool-worktree/src/index.ts`](../packages/experimental/tool-worktree/src/index.ts)
+
+Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. `exit_worktree` returns the Session to the source checkout; the branch and checkout remain.
diff --git a/docs/tool-catalog.zh.md b/docs/tool-catalog.zh.md
index bf9a8255bb..fd545277c7 100644
--- a/docs/tool-catalog.zh.md
+++ b/docs/tool-catalog.zh.md
@@ -51,8 +51,7 @@
| `@deepseek-ai/dsh-tool-jobs` | `job_kill`、`job_list`、`job_output` | `ctx.tools`、`ctx.jobs`、`ctx.systemPrompt` | `tool/call`、`tool/result`、`user/message via agent.inject() for background completion notices` | - | 与任务种类无关的后台任务控制器:后台 bash 命令与 PTY 发送 都通过相同的 3 个工具读取、列出和终止。加载该插件会挂接控制器,从而启用生产方的 `ctx.jobs.start()`。 |
| `@deepseek-ai/dsh-tool-agent-team` | `team_task_create`, `team_task_get`, `team_task_list`, `team_task_update` | `ctx.tools`, `ctx.systemPrompt`, `ctx.agentTeams`, `ctx.subagents`, `an exact live Team member Agent` | `tool/call`, `team/task`, `tool/result` | - | 四个任务板工具共享 subagent 树的根 Session。在根 Session 开启 Team 模式,会在标准 subagent 委派和控制工具之外增加任务板指导。标准 subagent 控制工具提供必需身份,不受 Team 模式影响。 |
| `@deepseek-ai/dsh-tool-todo` | `todo_write` | `ctx.tools`、`owning Agent session` | `tool/call`、`todo/write`、`tool/result` | - | todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为检查清单。`allowParallelInProgress` 是没有默认值的必填项,因此本目录明确选择 `true`,对应描述允许同时存在多个 `in_progress` 项。选择 `false` 的部署会获得同一工具,但描述会要求只能有 1 个活动任务。 |
-| `@deepseek-ai/dsh-tool-working-directory` | `working_directory` | `ctx.tools`, `ctx.workingDirectory` | `tool/call`, `working-directory/change`, `user context for directory changes`, `tool/result` | - | 读取或改变调用方 Session 的目录。已有 shell 和进程保留自己的目录;原始元数据和权限根目录保持不变。 |
-| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | 在 Web 和 Desktop 上通过变更请求与工作树组合包启用;其他 profile 可以选择独立组合包。在现有写权限下从固定的本地提交创建新分支与检出目录,再改变 Session 工作目录。离开时保留分支与检出目录。 |
+| `@deepseek-ai/dsh-experimental-tool-worktree` | `create_worktree`, `exit_worktree` | `ctx.tools`, `ctx.worktrees`, `a calling Agent` | `tool/call`, `Git branch and checkout`, `working-directory/change`, `tool/result` | - | 在 Web 和 Desktop 上通过变更请求与工作树组合包启用;其他 profile 可以选择独立组合包。在现有写权限下从固定的本地提交创建新分支与检出目录,再改变 Session 工作目录。`exit_worktree` 把 Session 送回源检出目录;分支与检出目录保留。 |
| `@deepseek-ai/dsh-tool-workflow` | `workflow` | `ctx.tools`、`ctx.workflowEngine`、`ctx.systemPrompt`、`a calling Agent (exec.agent parents the script children)` | `tool/call`、`tool/result` | - | - |
| `@deepseek-ai/dsh-tool-workspace-dependencies` | `load_workspace_dependencies` | `ctx.tools` | `tool/call`, `tool/result` | - | - |
| `@deepseek-ai/dsh-tool-web` | `web_fetch`、`web_search` | `ctx.tools`、`ctx.web`、`ctx.systemPrompt` | `tool/call`、`tool/result` | - | web_search 和 web_fetch 将提供方选择置于 ctx.web 之后,使模型可见 schema 在更换后端时保持稳定。 |
@@ -2188,10 +2187,6 @@ lsp 工具将提供方选择和语言服务器子进程置于 ctx.lsp 之后,
"prompt": {
"type": "string",
"description": "The complete, self-contained task. Include all context the external agent needs."
- },
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omission inherits it."
}
},
"required": [
@@ -2240,10 +2235,6 @@ subagent_oar 工具在为外部提供方配置的别名之间选择。本目录
{
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -2652,37 +2643,13 @@ subagent_oar 工具在为外部提供方配置的别名之间选择。本目录
todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为检查清单。`allowParallelInProgress` 是没有默认值的必填项,因此本目录明确选择 `true`,对应描述允许同时存在多个 `in_progress` 项。选择 `false` 的部署会获得同一工具,但描述会要求只能有 1 个活动任务。
-
-
-## `@deepseek-ai/dsh-tool-working-directory`
-
-### `working_directory`
-
-读取当前工作目录,或通过 cd 改变它。相对路径使用当前目录。已有 shell 和运行中的进程保留自己的目录。
-
-```json
-{
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
-}
-```
-
-来源:[`packages/session/tool-working-directory/src/index.ts`](../packages/session/tool-working-directory/src/index.ts)
-
-读取或改变调用方 Session 的目录。已有 shell 和进程保留自己的目录;原始元数据和权限根目录保持不变。
-
## `@deepseek-ai/dsh-experimental-tool-worktree`
### `create_worktree`
-从本地提交、分支或标签创建新的 Git 分支与工作树,再将本 Session 的工作目录切换到该位置。未提交文件保留在源检出目录中。名称已存在时失败。使用 working_directory 的 cd 参数离开;检出目录与分支仍然保留。
+从本地提交、分支或标签创建新的 Git 分支与工作树,再将本 Session 的工作目录切换到该位置。未提交文件保留在源检出目录中。名称已存在时失败。exit_worktree 返回源检出目录。
```json
{
@@ -2702,7 +2669,20 @@ todo_write 是会话所有的状态;UI 将最新的 todo/write 事件渲染为
来源:[`packages/experimental/tool-worktree/src/index.ts`](../packages/experimental/tool-worktree/src/index.ts)
-在 Web 和 Desktop 上通过变更请求与工作树组合包启用;其他 profile 可以选择独立组合包。在现有写权限下从固定的本地提交创建新分支与检出目录,再改变 Session 工作目录。离开时保留分支与检出目录。
+### `exit_worktree`
+
+把本 Session 的工作目录从所在的工作树切换回创建该工作树的检出目录,并报告所离开的工作树。工作树及其分支保留。
+
+```json
+{
+ "type": "object",
+ "properties": {}
+}
+```
+
+来源:[`packages/experimental/tool-worktree/src/index.ts`](../packages/experimental/tool-worktree/src/index.ts)
+
+在 Web 和 Desktop 上通过变更请求与工作树组合包启用;其他 profile 可以选择独立组合包。在现有写权限下从固定的本地提交创建新分支与检出目录,再改变 Session 工作目录。`exit_worktree` 把 Session 送回源检出目录;分支与检出目录保留。
diff --git a/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.i18n.yaml b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.i18n.yaml
new file mode 100644
index 0000000000..3f2ca08dd2
--- /dev/null
+++ b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.i18n.yaml
@@ -0,0 +1,16 @@
+# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
+# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
+# After editing either side, bring the other along and re-record with:
+# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.md
+/:
+ en: 7f5e303fd80a103a
+ zh: 41d0e9912d8ef7d7
+/the-working-directory-tool-and-the-subagent-cwd-parameter-are-removed:
+ en: b789cf59a4e4c664
+ zh: 4ca5044b8739b954
+/the-working-directory-tool-and-the-subagent-cwd-parameter-are-removed/change:
+ en: 3b009688d238dcf5
+ zh: 255f5b0d51e9bd2c
+/the-working-directory-tool-and-the-subagent-cwd-parameter-are-removed/migration:
+ en: 718c75ffcd864127
+ zh: 58e9ffd13646ef52
diff --git a/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.md b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.md
new file mode 100644
index 0000000000..da9848c4b4
--- /dev/null
+++ b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.md
@@ -0,0 +1,23 @@
+---
+kind: upgrade-guide
+description: "The `working_directory` model tool, its package, and the `cwd` parameter of the subagent tools are removed; only Host operations move a Session's directory."
+---
+# The `working_directory` tool and the subagent `cwd` parameter are removed
+
+English | [中文](guide.zh.md)
+
+## Change
+
+The model tool `working_directory` and its package `@deepseek-ai/dsh-tool-working-directory` no longer exist; the `dsh-base` and `dsh-sdk-minimal` bundles no longer mount the `tool-working-directory` entry. The delegation tools registered by `@deepseek-ai/dsh-tool-subagent`, and `subagent_oar`, no longer accept `cwd`: a child starts in the caller's workspace directory.
+
+A Session's directory now changes only through Host operations: `create_worktree`, the new `exit_worktree`, the forge panel, SDK `setWorkingDirectory` (`set_working_directory` in Python), and recovery when the directory disappears. Each recorded change carries `workspace: true` on `working-directory/change`; the [persistence record](../../../persistence-changes/2026-11-11-working-directory-workspace.md) covers stored logs. A stored Session whose model changed the directory resumes in that directory. Its recorded `working_directory` calls remain history, and a new call returns `unknown tool "working_directory"`.
+
+Who observes it: prompts, skills, and evaluation sets that expect the tool or the parameter in the tool list; profiles and patches that name the `tool-working-directory` entry or the package; Host plugins that pass a model-supplied path to `ctx.subagents.start({ cwd })` or `ctx.workingDirectory.set`, which now also moves the Session's workspace root.
+
+## Migration
+
+1. Remove `tool-working-directory` rows and `@deepseek-ai/dsh-tool-working-directory` dependencies from profiles, patches, and package manifests. A patch that still names the entry reports `patch: entry "tool-working-directory" not found` at load.
+2. In prompts, skills, and scripted model turns, replace `working_directory({ cd })` with paths relative to the Session directory or absolute paths, and with the `workdir` argument of `bash` or `pwsh` for commands. The `Current working directory:` line of the user context replaces `working_directory()` as the way to read the directory.
+3. To leave a worktree, call `exit_worktree()`. It returns the Session to the checkout the worktree was created from.
+4. Remove `cwd` from `subagent` and `subagent_oar` calls and name the subdirectory in the task. A Host that needs another start directory passes a path it chose itself to `ctx.subagents.start({ cwd })`.
+5. Confirm: `dsh --profile headless --dump-config` lists no `tool-working-directory` entry, and the tool list of a first request contains neither `working_directory` nor a `cwd` property on `subagent`.
diff --git a/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.zh.md b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.zh.md
new file mode 100644
index 0000000000..5c44239528
--- /dev/null
+++ b/docs/upgrade-guide/v0.2.2-rc.1/working-directory-tool-removed/guide.zh.md
@@ -0,0 +1,23 @@
+---
+kind: upgrade-guide
+description: "模型工具 `working_directory`、它的包以及子代理工具的 `cwd` 参数被移除;只有 Host 操作移动 Session 的目录。"
+---
+# `working_directory` 工具与子代理的 `cwd` 参数被移除
+
+[English](guide.md) | 中文
+
+## 变更
+
+模型工具 `working_directory` 及其包 `@deepseek-ai/dsh-tool-working-directory` 不再存在;`dsh-base` 与 `dsh-sdk-minimal` 组合包不再挂载 `tool-working-directory` 条目。`@deepseek-ai/dsh-tool-subagent` 注册的委派工具以及 `subagent_oar` 不再接受 `cwd`:子代理从调用方的工作区目录启动。
+
+Session 的目录现在只通过 Host 操作改变:`create_worktree`、新增的 `exit_worktree`、forge 面板、SDK 的 `setWorkingDirectory`(Python 中为 `set_working_directory`),以及目录消失时的恢复。每次记录的变更都在 `working-directory/change` 上带有 `workspace: true`;[持久化记录](../../../persistence-changes/2026-11-11-working-directory-workspace.zh.md)说明已存储日志的读法。模型曾改变过目录的已存储 Session 会在该目录恢复。其中记录的 `working_directory` 调用仍是历史,新的调用返回 `unknown tool "working_directory"`。
+
+受影响的对象:期望工具列表中有该工具或该参数的提示词、技能与评测集;引用 `tool-working-directory` 条目或该包的 profile 与 patch;把模型提供的路径传给 `ctx.subagents.start({ cwd })` 或 `ctx.workingDirectory.set` 的 Host 插件,后者现在同时移动 Session 的工作区根。
+
+## 迁移
+
+1. 从 profile、patch 和包清单中移除 `tool-working-directory` 行与 `@deepseek-ai/dsh-tool-working-directory` 依赖。仍然引用该条目的 patch 在加载时报告 `patch: entry "tool-working-directory" not found`。
+2. 在提示词、技能和脚本化的模型轮次中,把 `working_directory({ cd })` 替换为相对 Session 目录的路径或绝对路径,命令使用 `bash` 或 `pwsh` 的 `workdir` 参数。读取目录改用用户上下文中的 `Current working directory:` 一行,不再调用 `working_directory()`。
+3. 离开工作树时调用 `exit_worktree()`。它把 Session 送回创建该工作树的检出目录。
+4. 从 `subagent` 与 `subagent_oar` 调用中移除 `cwd`,把子目录写进任务。需要其他起始目录的 Host 把自己选定的路径传给 `ctx.subagents.start({ cwd })`。
+5. 确认:`dsh --profile headless --dump-config` 不再列出 `tool-working-directory` 条目,首个请求的工具列表中既没有 `working_directory`,`subagent` 也没有 `cwd` 属性。
diff --git a/docs/user/guide/python-sdk.i18n.yaml b/docs/user/guide/python-sdk.i18n.yaml
index b4a0f88a1b..df31607f00 100644
--- a/docs/user/guide/python-sdk.i18n.yaml
+++ b/docs/user/guide/python-sdk.i18n.yaml
@@ -27,5 +27,5 @@
en: 820e942903b8660a
zh: 195b8f6cb00009b8
/get-started-with-the-python-sdk/understand-the-minimal-profile:
- en: ea2a6521cff50517
- zh: 3769760a5e40af8d
+ en: 5c17de933c20f69a
+ zh: fc2e295418078471
diff --git a/docs/user/guide/python-sdk.md b/docs/user/guide/python-sdk.md
index 48885b3258..2a3d359e73 100644
--- a/docs/user/guide/python-sdk.md
+++ b/docs/user/guide/python-sdk.md
@@ -183,7 +183,7 @@ Create a new root Session and ask it to create and list a shared task. Its first
|---|---|
| System prompt | `DSH_SYSTEM_PROMPT`, falling back to `You are a helpful software engineer assistant.` |
| Model in `minimal.py` | `--model`, then `DSH_MODEL`, then `deepseek-v4-flash` |
-| Model-facing tools | Persistent `bash` on Linux/macOS or `pwsh` on Windows, `read_image`, and `working_directory` |
+| Model-facing tools | Persistent `bash` on Linux/macOS or `pwsh` on Windows, and `read_image` |
| Shell timeout | 300 seconds |
| Optional runtime context | Absent |
| Context compaction | Automatic; summarizes older history through an additional model request |
diff --git a/docs/user/guide/python-sdk.zh.md b/docs/user/guide/python-sdk.zh.md
index 502c14b8e2..805b16aacd 100644
--- a/docs/user/guide/python-sdk.zh.md
+++ b/docs/user/guide/python-sdk.zh.md
@@ -183,7 +183,7 @@ dsh plugin --profile sdk-minimal add file:C:/work/my-plugin-bundle
|---|---|
| 系统提示词 | `DSH_SYSTEM_PROMPT`,未设置时为 `You are a helpful software engineer assistant.` |
| `minimal.py` 的模型 | `--model`,然后是 `DSH_MODEL`,最后是 `deepseek-v4-flash` |
-| 面向模型的工具 | Linux/macOS 上的持久 `bash` 或 Windows 上的 `pwsh`、`read_image` 和 `working_directory` |
+| 面向模型的工具 | Linux/macOS 上的持久 `bash` 或 Windows 上的 `pwsh`,以及 `read_image` |
| Shell 超时 | 300 秒 |
| 可选运行时上下文 | 不存在 |
| 上下文压缩 | 自动执行;通过额外模型请求生成较早历史的摘要 |
diff --git a/package.json b/package.json
index 37b86b60d5..5a3695a53d 100644
--- a/package.json
+++ b/package.json
@@ -296,7 +296,6 @@
"vitest": "^4.1.11",
"@deepseek-ai/dsh-skill-office": "workspace:*",
"@deepseek-ai/dsh-tool-workspace-dependencies": "workspace:*",
- "@deepseek-ai/dsh-tool-working-directory": "workspace:*",
"@deepseek-ai/dsh-working-directory": "workspace:*",
"@deepseek-ai/dsh-experimental-worktree": "workspace:*",
"@deepseek-ai/dsh-experimental-tool-worktree": "workspace:*",
diff --git a/packages/bundle/base/README.i18n.yaml b/packages/bundle/base/README.i18n.yaml
index bd859ea112..5f3aad6596 100644
--- a/packages/bundle/base/README.i18n.yaml
+++ b/packages/bundle/base/README.i18n.yaml
@@ -21,8 +21,8 @@
en: 0f971f7ac7c09139
zh: ceb866da681c709c
/deepseek-ai-dsh-base/use-this-package/what-you-get:
- en: dd7e69c32d06cb6a
- zh: 9301140a8e023b41
+ en: 2be4427d168b5bf1
+ zh: cdb6481a466c32f6
/deepseek-ai-dsh-base/use-this-package/shell-tools-per-platform:
en: 2dce12f82d6ee955
zh: d4599eb899a3cd88
diff --git a/packages/bundle/base/README.md b/packages/bundle/base/README.md
index b2ab5dcf1e..6859b9d052 100644
--- a/packages/bundle/base/README.md
+++ b/packages/bundle/base/README.md
@@ -55,7 +55,7 @@ The bundle also mounts [Agent Teams](../../team/agent-team/README.md) and its ta
The `tool-subagent-control` row sets `interrupt: false`, so ordinary subagents and Team mode omit `interrupt_agent`. Set `config.interrupt: true` on that row in a later patch to enable it. The plugin itself still defaults to `true`.
-The built-in `working_directory` tool changes the directory for subsequent operations while existing processes and write permissions remain independent. Current directory information appears in user context. Default file editing uses `read`, `write`, and `edit`. The `str_replace_editor` tool remains available as an explicit opt-in. To add it to a base-backed profile, put this entry in the profile, home, or invocation patch:
+Current directory information appears in user context; Host operations such as worktree creation move the directory, and the model has no tool that does. Default file editing uses `read`, `write`, and `edit`. The `str_replace_editor` tool remains available as an explicit opt-in. To add it to a base-backed profile, put this entry in the profile, home, or invocation patch:
```yaml
- insert:
diff --git a/packages/bundle/base/README.zh.md b/packages/bundle/base/README.zh.md
index 223b88bb0a..fa6c89151d 100644
--- a/packages/bundle/base/README.zh.md
+++ b/packages/bundle/base/README.zh.md
@@ -55,7 +55,7 @@ kind: "package-bundle"
`tool-subagent-control` 行显式设置 `interrupt: false`,因此普通 subagent 和 Team 模式均不提供 `interrupt_agent`。在后续 patch 中为该行设置 `config.interrupt: true` 可启用它。插件自身的默认值仍为 `true`。
-内置 `working_directory` 工具改变后续操作使用的目录,已有进程与写权限保持独立。当前目录信息出现在用户上下文中。默认文件编辑使用 `read`、`write` 和 `edit`。`str_replace_editor` 工具仍可显式启用。要将它加入基于 base 的 profile,请在 profile、home 或逐次调用 patch 中添加以下条目:
+当前目录信息出现在用户上下文中;创建工作树等 Host 操作会移动目录,模型没有可以移动目录的工具。默认文件编辑使用 `read`、`write` 和 `edit`。`str_replace_editor` 工具仍可显式启用。要将它加入基于 base 的 profile,请在 profile、home 或逐次调用 patch 中添加以下条目:
```yaml
- insert:
diff --git a/packages/bundle/base/cordis.patch.yml b/packages/bundle/base/cordis.patch.yml
index 18286618f9..6d4bdaefd4 100644
--- a/packages/bundle/base/cordis.patch.yml
+++ b/packages/bundle/base/cordis.patch.yml
@@ -166,9 +166,6 @@
- id: working-directory
name: '@deepseek-ai/dsh-working-directory'
- - id: tool-working-directory
- name: '@deepseek-ai/dsh-tool-working-directory'
-
- id: session-projection
name: '@deepseek-ai/dsh-session-projection'
diff --git a/packages/bundle/base/package.json b/packages/bundle/base/package.json
index 4ab644e138..b9ce1c9d38 100644
--- a/packages/bundle/base/package.json
+++ b/packages/bundle/base/package.json
@@ -124,7 +124,6 @@
"@deepseek-ai/dsh-tool-todo": "workspace:*",
"@deepseek-ai/dsh-tool-web": "workspace:*",
"@deepseek-ai/dsh-tool-workflow": "workspace:*",
- "@deepseek-ai/dsh-tool-working-directory": "workspace:*",
"@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-typert-loader": "workspace:*",
"@deepseek-ai/dsh-typert-registry": "workspace:*",
diff --git a/packages/bundle/sdk-minimal/README.i18n.yaml b/packages/bundle/sdk-minimal/README.i18n.yaml
index 62cee1bca3..02d8d62911 100644
--- a/packages/bundle/sdk-minimal/README.i18n.yaml
+++ b/packages/bundle/sdk-minimal/README.i18n.yaml
@@ -9,14 +9,14 @@
en: 807c43eedba7d53e
zh: 9f1efe5d6ac393f7
/deepseek-ai-dsh-sdk-minimal/summary:
- en: 31b83af058b212f9
- zh: 289678ac3738ee5e
+ en: aabb5b896315bac9
+ zh: 37a80bca5477cc2f
/deepseek-ai-dsh-sdk-minimal/table-of-contents:
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-sdk-minimal/use-this-package:
- en: 44072e053b253924
- zh: fecb1b7986ac05d4
+ en: a5be82ca655cf600
+ zh: 7b61cecc746519ba
/deepseek-ai-dsh-sdk-minimal/understand-the-implementation:
en: 5db5d8f041867958
zh: bff5ef3a2e140712
@@ -33,8 +33,8 @@
en: bd87e16b0c6e0506
zh: c8ee5e3b4578754e
/deepseek-ai-dsh-sdk-minimal/model-experience/minimal-coding-agent-composition/what-the-model-sees:
- en: df40d9529b566cfa
- zh: 4678769b4f85120b
+ en: 6c1925e79d139005
+ zh: 4d5e6e26488b0092
/deepseek-ai-dsh-sdk-minimal/model-experience/minimal-coding-agent-composition/token-effect:
en: 9b7a23c7a447eb22
zh: e01bfd06d19b7d18
diff --git a/packages/bundle/sdk-minimal/README.md b/packages/bundle/sdk-minimal/README.md
index db70633cd0..b42ac4b753 100644
--- a/packages/bundle/sdk-minimal/README.md
+++ b/packages/bundle/sdk-minimal/README.md
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
-Use `dsh --profile sdk-minimal` when an SDK client needs a small, explicit coding-agent runtime. By default, the profile advertises a platform-selected persistent shell, `read_image`, and `working_directory`, persists sessions as uncompressed JSONL, and selects the model from the SDK initialization request. It supplies a complete Cordis tree and excludes `dsh-base`, Web, settings, managed credentials, telemetry, text file tools, workspace instructions, skills, jobs, and subagents. Its danger-full-access policy lets the shell modify any path available to the process, so use it only with an isolated workspace.
+Use `dsh --profile sdk-minimal` when an SDK client needs a small, explicit coding-agent runtime. By default, the profile advertises a platform-selected persistent shell and `read_image`, persists sessions as uncompressed JSONL, and selects the model from the SDK initialization request. It supplies a complete Cordis tree and excludes `dsh-base`, Web, settings, managed credentials, telemetry, text file tools, workspace instructions, skills, jobs, and subagents. Its danger-full-access policy lets the shell modify any path available to the process, so use it only with an isolated workspace.
## Table of Contents
@@ -40,7 +40,7 @@ The profile mounts exactly one persistent shell stack: Bash on Linux and macOS,
[Session checkpoints](../../session/session-checkpoint-policy/README.md) flush history before each model request, top-level tool execution, and agent step. Dispatch waits for the flush and stops if persistence fails, so the first model request also waits for native file-lock initialization. The final response still depends on background writes or successful shutdown; checkpoints do not make forced termination safe for unflushed events.
-Like every shipped profile, it mounts [MCP resources](../../mcp/mcp-resources/README.md) once. Configure only [MCP client entries](../../mcp/mcp-client/README.md) to add servers. Clients mounted by another provider also count as configured. With no server configured in the caller's scope, MCP contributes no prompt text or tools and the default remains the shell, `read_image`, and `working_directory` tools.
+Like every shipped profile, it mounts [MCP resources](../../mcp/mcp-resources/README.md) once. Configure only [MCP client entries](../../mcp/mcp-client/README.md) to add servers. Clients mounted by another provider also count as configured. With no server configured in the caller's scope, MCP contributes no prompt text or tools and the default remains the shell and `read_image` tools.
-----
@@ -80,7 +80,7 @@ The bundle's single insert is the complete application tree: SDK stdio startup a
#### What the model sees
-The system prompt is `DSH_SYSTEM_PROMPT` or `You are a helpful software engineer assistant.`. With no MCP server configured, the advertised tools are `read_image`, `working_directory`, and owner-scoped persistent `bash` on Linux/macOS or `pwsh` on Windows. Required user context supplies the current directory. Optional runtime context, text file tools, workspace instructions, skills, jobs controls, and Harness identity are absent.
+The system prompt is `DSH_SYSTEM_PROMPT` or `You are a helpful software engineer assistant.`. With no MCP server configured, the advertised tools are `read_image` and owner-scoped persistent `bash` on Linux/macOS or `pwsh` on Windows. Required user context supplies the current directory. Optional runtime context, text file tools, workspace instructions, skills, jobs controls, and Harness identity are absent.
#### Token effect
diff --git a/packages/bundle/sdk-minimal/README.zh.md b/packages/bundle/sdk-minimal/README.zh.md
index dbaef50cab..2624b24c1d 100644
--- a/packages/bundle/sdk-minimal/README.zh.md
+++ b/packages/bundle/sdk-minimal/README.zh.md
@@ -9,7 +9,7 @@ kind: "package-bundle"
## 概述
-当 SDK 客户端需要小型、显式的 coding agent 运行时时,请使用 `dsh --profile sdk-minimal`。该 profile 默认公布按平台选择的持久 shell、`read_image` 和 `working_directory`,把会话持久化为未压缩 JSONL,并从 SDK 初始化请求选择模型。它提供完整 Cordis 配置树,并排除 `dsh-base`、Web、settings、托管凭据、遥测、文本文件工具、workspace 指令、skill(技能)、jobs 与 subagent。其 danger-full-access 策略允许 shell 修改进程可访问的任何路径,因此只能配合隔离 workspace 使用。
+当 SDK 客户端需要小型、显式的 coding agent 运行时时,请使用 `dsh --profile sdk-minimal`。该 profile 默认公布按平台选择的持久 shell 和 `read_image`,把会话持久化为未压缩 JSONL,并从 SDK 初始化请求选择模型。它提供完整 Cordis 配置树,并排除 `dsh-base`、Web、settings、托管凭据、遥测、文本文件工具、workspace 指令、skill(技能)、jobs 与 subagent。其 danger-full-access 策略允许 shell 修改进程可访问的任何路径,因此只能配合隔离 workspace 使用。
## 目录
@@ -40,7 +40,7 @@ dsh --profile sdk-minimal
[Session 检查点](../../session/session-checkpoint-policy/README.zh.md)会在每次模型请求、顶层工具执行和 agent step 之前刷盘。调度会等待刷盘完成,持久化失败时停止,因此第一次模型请求也会等待原生文件锁初始化。最后一段回复仍依赖后台写入或成功关闭来保存;检查点不能保证强制终止时尚未刷盘的事件不丢失。
-与其他随附 profile 一样,它统一挂载 [MCP 资源](../../mcp/mcp-resources/README.zh.md)一次。只需配置 [MCP 客户端条目](../../mcp/mcp-client/README.zh.md)即可添加服务器。其他提供方挂载的客户端也属于已配置状态。调用方作用域中未配置服务器时,MCP 不贡献提示词文本或工具,默认仍为 shell、`read_image` 与 `working_directory` 三个工具。
+与其他随附 profile 一样,它统一挂载 [MCP 资源](../../mcp/mcp-resources/README.zh.md)一次。只需配置 [MCP 客户端条目](../../mcp/mcp-client/README.zh.md)即可添加服务器。其他提供方挂载的客户端也属于已配置状态。调用方作用域中未配置服务器时,MCP 不贡献提示词文本或工具,默认仍为 shell 与 `read_image` 两个工具。
-----
@@ -80,7 +80,7 @@ dsh --profile sdk-minimal
#### 模型看到的内容
-系统提示词取 `DSH_SYSTEM_PROMPT`,未设置时使用 `You are a helpful software engineer assistant.`。未配置 MCP 服务器时,对外公布的工具为 `read_image`、`working_directory`,以及 Linux/macOS 上 agent 所有的持久 `bash` 或 Windows 上的 `pwsh`。必需的用户上下文提供当前目录。可选运行时上下文、文本文件工具、workspace 指令、skill、jobs 控制与 Harness 身份均不存在。
+系统提示词取 `DSH_SYSTEM_PROMPT`,未设置时使用 `You are a helpful software engineer assistant.`。未配置 MCP 服务器时,对外公布的工具为 `read_image`,以及 Linux/macOS 上 agent 所有的持久 `bash` 或 Windows 上的 `pwsh`。必需的用户上下文提供当前目录。可选运行时上下文、文本文件工具、workspace 指令、skill、jobs 控制与 Harness 身份均不存在。
#### Token 影响
diff --git a/packages/bundle/sdk-minimal/cordis.patch.yml b/packages/bundle/sdk-minimal/cordis.patch.yml
index e46eed1e0f..3755444a68 100644
--- a/packages/bundle/sdk-minimal/cordis.patch.yml
+++ b/packages/bundle/sdk-minimal/cordis.patch.yml
@@ -52,9 +52,6 @@
- id: working-directory
name: '@deepseek-ai/dsh-working-directory'
- - id: tool-working-directory
- name: '@deepseek-ai/dsh-tool-working-directory'
-
- id: session-projection
name: '@deepseek-ai/dsh-session-projection'
diff --git a/packages/bundle/sdk-minimal/package.json b/packages/bundle/sdk-minimal/package.json
index 262dc98be8..9d05732c24 100644
--- a/packages/bundle/sdk-minimal/package.json
+++ b/packages/bundle/sdk-minimal/package.json
@@ -71,7 +71,6 @@
"@deepseek-ai/dsh-tool-pwsh-persistent": "workspace:*",
"@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-working-directory": "workspace:*",
- "@deepseek-ai/dsh-tool-working-directory": "workspace:*",
"@deepseek-ai/dsh-fs-local": "workspace:*"
},
"peerDependencies": {
diff --git a/packages/bundle/sdk-minimal/tests/sdk-minimal.spec.ts b/packages/bundle/sdk-minimal/tests/sdk-minimal.spec.ts
index 2a96ffc076..b8f1c4e2e7 100644
--- a/packages/bundle/sdk-minimal/tests/sdk-minimal.spec.ts
+++ b/packages/bundle/sdk-minimal/tests/sdk-minimal.spec.ts
@@ -37,7 +37,6 @@ describe('dsh-sdk-minimal bundle', () => {
['attachment-local', '@deepseek-ai/dsh-attachment-local'],
['tool-fs', '@deepseek-ai/dsh-tool-fs'],
['working-directory', '@deepseek-ai/dsh-working-directory'],
- ['tool-working-directory', '@deepseek-ai/dsh-tool-working-directory'],
['session-projection', '@deepseek-ai/dsh-session-projection'],
['token-meter', '@deepseek-ai/dsh-token-meter'],
['compaction-basic', '@deepseek-ai/dsh-compaction-basic'],
diff --git a/packages/core/tools/tests/gen-tool-catalog.spec.ts b/packages/core/tools/tests/gen-tool-catalog.spec.ts
index b9fe22584c..b61d38077f 100644
--- a/packages/core/tools/tests/gen-tool-catalog.spec.ts
+++ b/packages/core/tools/tests/gen-tool-catalog.spec.ts
@@ -29,7 +29,7 @@ describe('gen-tool-catalog collectToolCatalog', () => {
expect(names).toEqual([
'apply_patch', 'ask_user_question', 'bash', 'bash', 'cordis_inspect_list',
'cordis_inspect_query',
- 'create_goal', 'create_worktree', 'edit', 'exit_plan_mode', 'get_goal', 'glob', 'grep',
+ 'create_goal', 'create_worktree', 'edit', 'exit_plan_mode', 'exit_worktree', 'get_goal', 'glob', 'grep',
'interrupt_agent', 'job_kill', 'job_list', 'job_output',
'list_agents', 'list_mcp_resource_templates', 'list_mcp_resources',
'list_subagent_models', 'load_workspace_dependencies', 'lsp', 'office_convert', 'office_recalculate', 'office_render', 'plugin_manager', 'plugin_market', 'present', 'propose_action', 'pwsh', 'pwsh', 'ralph',
@@ -41,7 +41,7 @@ describe('gen-tool-catalog collectToolCatalog', () => {
'team_task_get', 'team_task_list', 'team_task_update', 'terminal_close', 'terminal_list',
'terminal_open', 'terminal_read', 'terminal_send', 'terminal_signal', 'todo_write',
'update_goal', 'user_terminal_list', 'user_terminal_read', 'wait_agent', 'web_fetch', 'web_search', 'workflow',
- 'working_directory', 'write',
+ 'write',
])
// Every tool carries a JSON-Schema `parameters` object (what the model sees).
for (const entry of catalog) {
@@ -49,11 +49,11 @@ describe('gen-tool-catalog collectToolCatalog', () => {
expect((schema.parameters as unknown as JsonSchema).type).toBe('object')
}
}
- const directory = catalog.find(entry => entry.pkg === '@deepseek-ai/dsh-tool-working-directory')
- expect(directory?.sources.working_directory).toBe('packages/session/tool-working-directory/src/index.ts')
- const parameters = directory?.schemas[0]?.parameters
- expect(parameters).toHaveProperty('properties.cd.type', 'string')
- expect(parameters?.required ?? []).not.toContain('cd')
+ const worktree = catalog.find(entry => entry.pkg === '@deepseek-ai/dsh-experimental-tool-worktree')
+ expect(worktree?.sources.create_worktree).toBe('packages/experimental/tool-worktree/src/index.ts')
+ const parameters = worktree?.schemas.find(schema => schema.name === 'create_worktree')?.parameters
+ expect(parameters).toHaveProperty('properties.name.type', 'string')
+ expect(parameters?.required ?? []).not.toContain('name')
})
it('resolves a runtime-spread enum to its literal members (the payoff over AST)', async () => {
diff --git a/packages/experimental/tool-subagent-oar/README.i18n.yaml b/packages/experimental/tool-subagent-oar/README.i18n.yaml
index 71a03aff53..ad6e5cd8c7 100644
--- a/packages/experimental/tool-subagent-oar/README.i18n.yaml
+++ b/packages/experimental/tool-subagent-oar/README.i18n.yaml
@@ -21,8 +21,8 @@
en: 368805e5bcffeb0a
zh: 9340ff5074ada9e1
/deepseek-ai-dsh-experimental-tool-subagent-oar/use-this-package/minimal-configuration:
- en: 13646f48b42b016a
- zh: acc0dcdefe54e89a
+ en: d04b8a922269c27f
+ zh: 9b941735442a85c5
/deepseek-ai-dsh-experimental-tool-subagent-oar/understand-the-implementation:
en: 41555a0244acb746
zh: 3e7fd7ba1a9c6964
diff --git a/packages/experimental/tool-subagent-oar/README.md b/packages/experimental/tool-subagent-oar/README.md
index 50e49f8d8e..c7b22265cb 100644
--- a/packages/experimental/tool-subagent-oar/README.md
+++ b/packages/experimental/tool-subagent-oar/README.md
@@ -48,7 +48,7 @@ With `oar-codex` and `oar-claude` already registered, mount this row in the comp
| `providers` | required | Nonempty map from model-visible runtime aliases to registered provider names |
| `toolName` | `subagent_oar` | Tool name; every mounted instance needs a distinct name |
-The [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-tool-subagent-oar) owns accepted fields and validation. A call requires `runtime`, `description`, and `prompt`. Optional `name` names the child, unique among the caller's children and cannot be `lead`; omission selects `agent-1`, `agent-2`, and so on, under the [subagent runtime's name rule](../../subagent/subagent/README.md#agent-names). Optional `cwd` selects the child directory, with relative paths resolved from the parent's current directory. The prompt must contain the context the child needs. Native installation, authentication, model settings, and permissions belong to the selected provider.
+The [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-tool-subagent-oar) owns accepted fields and validation. A call requires `runtime`, `description`, and `prompt`. Optional `name` names the child, unique among the caller's children and cannot be `lead`; omission selects `agent-1`, `agent-2`, and so on, under the [subagent runtime's name rule](../../subagent/subagent/README.md#agent-names). The child starts in the caller's workspace directory. The prompt must contain the context the child needs. Native installation, authentication, model settings, and permissions belong to the selected provider.
-----
diff --git a/packages/experimental/tool-subagent-oar/README.zh.md b/packages/experimental/tool-subagent-oar/README.zh.md
index 6df88718e7..b5674f681f 100644
--- a/packages/experimental/tool-subagent-oar/README.zh.md
+++ b/packages/experimental/tool-subagent-oar/README.zh.md
@@ -48,7 +48,7 @@ kind: "package-reference"
| `providers` | 必填 | 从模型可见运行时别名映射到已注册提供方名称的非空映射 |
| `toolName` | `subagent_oar` | 工具名称;每个挂载实例需要不同名称 |
-[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-tool-subagent-oar)定义接受的字段和校验规则。调用要求提供 `runtime`、`description` 和 `prompt`。可选的 `name` 为子任务命名,在调用方的子级之间唯一,且不能为 `lead`;省略时按[子智能体运行时的名称规则](../../subagent/subagent/README.zh.md#agent-names)依次选择 `agent-1`、`agent-2` 等。可选的 `cwd` 选择子任务目录,相对路径从父智能体的当前目录解析。提示必须包含子任务需要的上下文。原生安装、认证、模型设置和权限由所选提供方负责。
+[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-tool-subagent-oar)定义接受的字段和校验规则。调用要求提供 `runtime`、`description` 和 `prompt`。可选的 `name` 为子任务命名,在调用方的子级之间唯一,且不能为 `lead`;省略时按[子智能体运行时的名称规则](../../subagent/subagent/README.zh.md#agent-names)依次选择 `agent-1`、`agent-2` 等。子任务从调用方的工作区目录启动。提示必须包含子任务需要的上下文。原生安装、认证、模型设置和权限由所选提供方负责。
-----
diff --git a/packages/experimental/tool-subagent-oar/src/index.ts b/packages/experimental/tool-subagent-oar/src/index.ts
index aab8ac7266..ef54f5d9bc 100644
--- a/packages/experimental/tool-subagent-oar/src/index.ts
+++ b/packages/experimental/tool-subagent-oar/src/index.ts
@@ -61,10 +61,6 @@ export function apply(ctx: Context, config: Config): void {
required: true,
description: 'The complete, self-contained task. Include all context the external agent needs.',
},
- cwd: {
- type: 'string',
- description: 'Initial child working directory. Relative paths use your current directory; omission inherits it.',
- },
},
/* jscpd:ignore-start -- External and local delegation share the canonical
* activation acknowledgement; their provider-selection policies remain separate. */
@@ -97,7 +93,6 @@ export function apply(ctx: Context, config: Config): void {
...args.name === undefined ? {} : { name: args.name },
parent,
prompt: [{ type: 'text', text: args.prompt }],
- ...args.cwd === undefined ? {} : { cwd: args.cwd },
signal: exec.signal,
delivery: 'parent',
})
diff --git a/packages/experimental/tool-subagent-oar/tests/tool-subagent-oar.spec.ts b/packages/experimental/tool-subagent-oar/tests/tool-subagent-oar.spec.ts
index e9dcaf54a6..b1397fefd1 100644
--- a/packages/experimental/tool-subagent-oar/tests/tool-subagent-oar.spec.ts
+++ b/packages/experimental/tool-subagent-oar/tests/tool-subagent-oar.spec.ts
@@ -1,6 +1,5 @@
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import { randomUUID } from 'node:crypto'
-import { join } from 'node:path'
import { Context } from '@deepseek-ai/cordis'
import Loader from '@deepseek-ai/cordis-plugin-loader'
import { mountAgentLoopTestDependencies, mountAgentLoopTestHarness } from '@deepseek-ai/dsh-agent-loop-testkit'
@@ -44,7 +43,7 @@ it('selects one configured provider per call and exposes only task inputs', asyn
})
const schema = ctx.tools.schemas().find(tool => tool.name === 'subagent_oar')
expect(schema?.parameters.required).toEqual(['runtime', 'description', 'prompt'])
- expect(Object.keys(schema?.parameters.properties as Record).sort()).toEqual(['cwd', 'description', 'name', 'prompt', 'runtime'])
+ expect(Object.keys(schema?.parameters.properties as Record).sort()).toEqual(['description', 'name', 'prompt', 'runtime'])
expect(schema?.parameters.properties).toMatchObject({ runtime: { enum: ['codex', 'claude', 'future'] } })
for (const [runtime, name, expected] of [['codex', undefined, 'agent-1'], ['claude', 'reviewer', 'reviewer'], ['future', undefined, 'agent-2']] as const) {
const result = await executeToolFixture(ctx, {
@@ -127,11 +126,11 @@ it('requires a caller and independently scoped one-shot providers', async (test)
expect(JSON.stringify(inherited.content)).toContain('independent conversation')
})
-it('passes an explicit child directory and presents the task description', async (test) => {
+it('starts the child in the parent directory and presents the task description', async (test) => {
const { ctx, parent, calls } = await setup()
test.onTestFinished(() => ctx.fiber.dispose())
await ctx.plugin(externalTool, { providers: { codex: 'codex-provider' } })
- const args = { runtime: 'codex', description: 'Inspect child', prompt: 'task', cwd: 'packages' }
+ const args = { runtime: 'codex', description: 'Inspect child', prompt: 'task' }
expect(ctx.tools.get('subagent_oar')?.presentCall?.(args)).toEqual({
card: 'generic', title: 'Inspect child', rawInput: args,
})
@@ -139,7 +138,7 @@ it('passes an explicit child directory and presents the task description', async
agent: parent, name: 'subagent_oar', arguments: args, callId: ToolCallId(randomUUID()), signal: test.signal,
})
expect(result.isError).toBe(false)
- expect(calls[0]?.request.cwd).toBe(join(process.cwd(), 'packages'))
+ expect(calls[0]?.request.cwd).toBe(process.cwd())
})
it('supports direct composition with the declared optional defaults', async (test) => {
diff --git a/packages/experimental/tool-worktree/README.i18n.yaml b/packages/experimental/tool-worktree/README.i18n.yaml
index 10910e375f..94b59a39d6 100644
--- a/packages/experimental/tool-worktree/README.i18n.yaml
+++ b/packages/experimental/tool-worktree/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 2f8a621b991260a1
/deepseek-ai-dsh-experimental-tool-worktree/use-this-package:
- en: f357051b201aa5b9
- zh: ace93e12e8d4de82
+ en: 3da61bef9ee229bf
+ zh: 3a83507f3365fe38
/deepseek-ai-dsh-experimental-tool-worktree/understand-the-implementation:
en: c03f875211ab69a8
zh: 8f49b82f90a60223
@@ -30,8 +30,8 @@
en: 4062fcaa4794bed7
zh: b56d35fc675fc430
/deepseek-ai-dsh-experimental-tool-worktree/model-experience/creation-tool/what-the-model-sees:
- en: e37073be01ff5cd1
- zh: 02fd0282863c708c
+ en: 07fc4bda6b786621
+ zh: 149a7c5474b709b3
/deepseek-ai-dsh-experimental-tool-worktree/model-experience/creation-tool/token-effect:
en: 6c3f73ba01233a36
zh: d64d87a425db4fbd
diff --git a/packages/experimental/tool-worktree/README.md b/packages/experimental/tool-worktree/README.md
index 2f1b293808..5467a8b2d7 100644
--- a/packages/experimental/tool-worktree/README.md
+++ b/packages/experimental/tool-worktree/README.md
@@ -25,7 +25,7 @@ Let a model create and enter a new Git worktree with one call. Web and Desktop e
## Use this package
-In the GUI, enable [Change requests & worktrees](../forge-bundle/README.md). The standalone bundle has no Plugins page card. Profiles without the Web application may select it in `dsh.profile.bundles`; it loads the [worktree runtime](../worktree/README.md) and this tool together. Turning it off removes `create_worktree` without deleting existing checkouts or branches. The built-in `working_directory` tool remains available.
+In the GUI, enable [Change requests & worktrees](../forge-bundle/README.md). The standalone bundle has no Plugins page card. Profiles without the Web application may select it in `dsh.profile.bundles`; it loads the [worktree runtime](../worktree/README.md) and this tool together. Turning it off removes `create_worktree` and `exit_worktree` without deleting existing checkouts or branches; a Session inside a worktree stays there until a Host operation moves it.
For an explicit composition, mount this function plugin after the worktree runtime and tool registry.
@@ -34,7 +34,7 @@ For an explicit composition, mount this function plugin after the worktree runti
- name: '@deepseek-ai/dsh-experimental-tool-worktree'
```
-Call `create_worktree({ name?: string, from?: string })`. Success returns the canonical checkout `path`, new `branch`, pinned `baseCommit`, and source `repositoryRoot`, and changes the calling Session's current working directory. To leave, call `working_directory({ cd: path })`; the checkout and branch remain. The [generated tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-experimental-tool-worktree) owns the exact schema and model-facing description.
+Call `create_worktree({ name?: string, from?: string })`. Success returns the canonical checkout `path`, new `branch`, pinned `baseCommit`, and source `repositoryRoot`, and changes the calling Session's current working directory. To leave, call `exit_worktree()`: it returns the Session to the source checkout of the worktree it is in and reports that worktree's record; the checkout and branch remain. The [generated tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-experimental-tool-worktree) owns the exact schema and model-facing description.
-----
@@ -68,7 +68,7 @@ No runtime invariant companion is published because the tool retains no state in
#### What the model sees
-The [tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-experimental-tool-worktree) defines `create_worktree`. Each successful result contains the created checkout's canonical path, branch, base commit, and source checkout’s top-level directory. Failed calls report the operation error.
+The [tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-experimental-tool-worktree) defines `create_worktree` and `exit_worktree`. Each successful result contains the canonical path, branch, base commit, and source checkout’s top-level directory of the worktree created or left. Failed calls report the operation error.
#### Token effect
diff --git a/packages/experimental/tool-worktree/README.zh.md b/packages/experimental/tool-worktree/README.zh.md
index 8b37299687..49313254ef 100644
--- a/packages/experimental/tool-worktree/README.zh.md
+++ b/packages/experimental/tool-worktree/README.zh.md
@@ -25,7 +25,7 @@ kind: "package-bundle"
## 使用本包
-在 GUI 中启用[变更请求与工作树](../forge-bundle/README.zh.md)。独立组合包在插件页没有卡片。未组合 Web 应用的 profile 可以在 `dsh.profile.bundles` 中选择它;它一起加载[工作树运行时](../worktree/README.zh.md)与本工具。关闭后会移除 `create_worktree`,已有检出目录与分支会保留。内置 `working_directory` 工具仍然可用。
+在 GUI 中启用[变更请求与工作树](../forge-bundle/README.zh.md)。独立组合包在插件页没有卡片。未组合 Web 应用的 profile 可以在 `dsh.profile.bundles` 中选择它;它一起加载[工作树运行时](../worktree/README.zh.md)与本工具。关闭后会移除 `create_worktree` 与 `exit_worktree`,已有检出目录与分支会保留;已在工作树中的 Session 会留在原处,直到 Host 操作移动它。
在显式组合中,将此函数插件挂载到工作树运行时和工具注册表之后。
@@ -34,7 +34,7 @@ kind: "package-bundle"
- name: '@deepseek-ai/dsh-experimental-tool-worktree'
```
-调用 `create_worktree({ name?: string, from?: string })`。成功会返回规范化检出路径 `path`、新分支 `branch`、固定提交 `baseCommit` 和源仓库根目录 `repositoryRoot`,并改变调用 Session 的当前工作目录。离开时调用 `working_directory({ cd: path })`;检出目录与分支会保留。[生成的工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-experimental-tool-worktree)拥有准确的 schema 与面向模型的描述。
+调用 `create_worktree({ name?: string, from?: string })`。成功会返回规范化检出路径 `path`、新分支 `branch`、固定提交 `baseCommit` 和源仓库根目录 `repositoryRoot`,并改变调用 Session 的当前工作目录。离开时调用 `exit_worktree()`:它把 Session 送回所在工作树的源检出,并返回该工作树的记录;检出目录与分支会保留。[生成的工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-experimental-tool-worktree)拥有准确的 schema 与面向模型的描述。
-----
@@ -68,7 +68,7 @@ kind: "package-bundle"
#### 模型看到什么
-[工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-experimental-tool-worktree)定义 `create_worktree`。每个成功结果包含已创建检出目录的规范路径、分支、基准提交与源检出目录的顶层目录。失败调用报告操作错误。
+[工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-experimental-tool-worktree)定义 `create_worktree` 与 `exit_worktree`。每个成功结果包含所创建或所离开工作树的规范路径、分支、基准提交与源检出目录的顶层目录。失败调用报告操作错误。
#### Token 影响
diff --git a/packages/experimental/tool-worktree/src/index.ts b/packages/experimental/tool-worktree/src/index.ts
index 53f035f7d7..9c35424d5f 100644
--- a/packages/experimental/tool-worktree/src/index.ts
+++ b/packages/experimental/tool-worktree/src/index.ts
@@ -1,4 +1,4 @@
-/** Model tool for creating and entering a new Git worktree through the shared runtime. */
+/** Model tools for creating and entering a new Git worktree, and for returning to its source checkout, through the shared runtime. */
import type { Context } from '@deepseek-ai/cordis'
import type {} from '@deepseek-ai/dsh-experimental-worktree'
@@ -6,32 +6,35 @@ import { defineTool } from '@deepseek-ai/dsh-tools'
/** Cordis plugin name. */
export const name = 'tool-worktree'
-/** Services required to register and execute the worktree tool. */
+/** Services required to register and execute the worktree tools. */
export const inject = ['tools', 'worktrees']
+/** Result fields both tools report for one worktree. */
+const WORKTREE_SCHEMA = {
+ type: 'object',
+ additionalProperties: false,
+ properties: {
+ path: { type: 'string', required: true },
+ branch: { type: 'string', required: true },
+ baseCommit: { type: 'string', required: true },
+ repositoryRoot: { type: 'string', required: true },
+ },
+} as const
+
/**
- * Register create_worktree for model and PTC callers.
+ * Register create_worktree and exit_worktree for model and PTC callers.
* @param ctx - tool registry and worktree runtime.
*/
export function apply(ctx: Context): void {
ctx.tools.register(defineTool({
name: 'create_worktree',
- description: 'Create a new Git branch and worktree from a local commit, branch, or tag, then change this session\'s working directory to it. Uncommitted files stay in the source checkout. Existing names fail. Use working_directory with cd to leave; the checkout and branch remain.',
+ description: 'Create a new Git branch and worktree from a local commit, branch, or tag, then change this session\'s working directory to it. Uncommitted files stay in the source checkout. Existing names fail. exit_worktree returns to the source checkout.',
parameters: {
name: { type: 'string', description: 'New branch name, also used as the checkout directory: a few lowercase words joined by hyphens that describe the task, such as fix-login-retry. Omit to generate a unique name.' },
from: { type: 'string', description: 'Local commit, branch, or tag to start from. Defaults to HEAD; no fetch is performed.' },
},
output: {
- schema: {
- type: 'object',
- additionalProperties: false,
- properties: {
- path: { type: 'string', required: true },
- branch: { type: 'string', required: true },
- baseCommit: { type: 'string', required: true },
- repositoryRoot: { type: 'string', required: true },
- },
- },
+ schema: WORKTREE_SCHEMA,
render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }],
},
async execute(args, exec) {
@@ -40,4 +43,18 @@ export function apply(ctx: Context): void {
},
presentCall: args => ({ card: 'generic', title: 'create_worktree', rawInput: args }),
}))
+ ctx.tools.register(defineTool({
+ name: 'exit_worktree',
+ description: 'Change this session\'s working directory from the worktree it is in back to the checkout that worktree was created from, and report the worktree left. The worktree and its branch remain.',
+ parameters: {},
+ output: {
+ schema: WORKTREE_SCHEMA,
+ render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }],
+ },
+ async execute(_args: Record, exec) {
+ if (exec.agent === undefined) throw new Error('exit_worktree requires a calling agent')
+ return ctx.worktrees.exit(exec.agent, exec.signal)
+ },
+ presentCall: args => ({ card: 'generic', title: 'exit_worktree', rawInput: args }),
+ }))
}
diff --git a/packages/experimental/tool-worktree/tests/loader-composition.spec.ts b/packages/experimental/tool-worktree/tests/loader-composition.spec.ts
index 8341b9dd8a..45ba603a85 100644
--- a/packages/experimental/tool-worktree/tests/loader-composition.spec.ts
+++ b/packages/experimental/tool-worktree/tests/loader-composition.spec.ts
@@ -37,7 +37,7 @@ afterEach(async () => {
})
describe('worktree tool through real Loader composition', () => {
- it('creates and enters a new checkout, reports canonical fields, and unregisters on disposal', async () => {
+ it('creates and enters a new checkout, exits it to the source checkout, reports canonical fields, and unregisters on disposal', async () => {
root = await realpath(await mkdtemp(join(tmpdir(), 'dsh-worktree-loader-')))
const repository = join(root, 'repo')
await mkdir(repository)
@@ -103,8 +103,26 @@ describe('worktree tool through real Loader composition', () => {
expect(failure.isError).toBe(true)
expect(failure.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('\n')).toContain('requires a calling agent')
expect(context.tools.get('create_worktree')!.presentCall!({ name: 'named' })).toEqual({ card: 'generic', title: 'create_worktree', rawInput: { name: 'named' } })
+
+ const exit = (agentValue?: typeof agent) => executeToolFixture(context!, {
+ name: 'exit_worktree', callId: ToolCallId('exit'), arguments: {}, signal: new AbortController().signal,
+ ...agentValue === undefined ? {} : { agent: agentValue },
+ })
+ const left = await exit(agent)
+ expect(left.isError).not.toBe(true)
+ expect(left.value).toEqual(result.value)
+ expect(left.content).toEqual([{ type: 'text', text: JSON.stringify(result.value) }])
+ expect(context.workingDirectory.get(agent.session)).toBe(repository)
+ const outside = await exit(agent)
+ expect(outside.isError).toBe(true)
+ expect(outside.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('\n')).toContain('no recorded worktree contains the working directory')
+ const agentless = await exit()
+ expect(agentless.isError).toBe(true)
+ expect(agentless.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('\n')).toContain('requires a calling agent')
+ expect(context.tools.get('exit_worktree')!.presentCall!({})).toEqual({ card: 'generic', title: 'exit_worktree', rawInput: {} })
+
const entry = [...context.loader.entries()].find(candidate => candidate.options.name === 'cordis:@deepseek-ai/dsh-experimental-tool-worktree')
await entry!.fiber!.dispose()
- expect(context.tools.schemas().some(tool => tool.name === 'create_worktree')).toBe(false)
+ expect(context.tools.schemas().some(tool => tool.name === 'create_worktree' || tool.name === 'exit_worktree')).toBe(false)
})
})
diff --git a/packages/experimental/worktree/README.i18n.yaml b/packages/experimental/worktree/README.i18n.yaml
index 6291dd7113..d7b5cafa68 100644
--- a/packages/experimental/worktree/README.i18n.yaml
+++ b/packages/experimental/worktree/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 2f8a621b991260a1
/deepseek-ai-dsh-experimental-worktree/use-this-package:
- en: 3076be43319396ff
- zh: 749e2cf24e30e0c1
+ en: 1199813c91ed7d71
+ zh: af5a6baaeaab711c
/deepseek-ai-dsh-experimental-worktree/understand-the-implementation:
en: 6971a7ca9073bef1
zh: b977c28a75c7f963
diff --git a/packages/experimental/worktree/README.md b/packages/experimental/worktree/README.md
index 748ea3c4cb..f044501dc5 100644
--- a/packages/experimental/worktree/README.md
+++ b/packages/experimental/worktree/README.md
@@ -32,7 +32,9 @@ Mount the service alongside `workingDirectory`, `fs`, `subprocess`, `sandbox`, `
- name: '@deepseek-ai/dsh-experimental-tool-worktree'
```
-`ctx.worktrees.create(agent, { name?, from? }, signal?, onPhase?)` creates a new branch and checkout, then enters the canonical checkout directory through `ctx.workingDirectory.relocate`, which registers the checkout as a workspace anchor; as the longest anchor containing the new current directory it becomes the Session's workspace root. `from` resolves to a local commit before creation and defaults to `HEAD`; staged, unstaged, untracked, and ignored source files are not copied. `baseCommit` reports the resolved commit object name; repository-local replacement refs still apply to the checked-out content. Checkout disables configured Git clean, smudge, and process filters without changing repository configuration. An existing branch or checkout path is an error. The returned record contains `path`, `branch`, `baseCommit`, and `repositoryRoot`. An optional fourth argument, `onPhase`, receives `prepare` before validation, directory allocation, and branch creation, and `checkout` before the files are written and the checkout is entered; it must not throw.
+`ctx.worktrees.create(agent, { name?, from? }, signal?, onPhase?)` creates a new branch and checkout, then enters the canonical checkout directory through `ctx.workingDirectory.set`. `from` resolves to a local commit before creation and defaults to `HEAD`; staged, unstaged, untracked, and ignored source files are not copied. `baseCommit` reports the resolved commit object name; repository-local replacement refs still apply to the checked-out content. Checkout disables configured Git clean, smudge, and process filters without changing repository configuration. An existing branch or checkout path is an error. The returned record contains `path`, `branch`, `baseCommit`, and `repositoryRoot`. An optional fourth argument, `onPhase`, receives `prepare` before validation, directory allocation, and branch creation, and `checkout` before the files are written and the checkout is entered; it must not throw.
+
+`ctx.worktrees.exit(agent, signal?)` returns the Session from the recorded worktree that contains its current directory to that worktree's `repositoryRoot` through `ctx.workingDirectory.set`, and resolves to the record of the worktree it left. The record can be the Session's own or fork-inherited, and nested worktrees exit one level per call. The checkout and branch remain. The call rejects when no recorded worktree contains the current directory or the source checkout no longer exists.
`ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` checks a removed worktree out again at its recorded directory. It validates the recorded repository root, full commit object name, branch, and canonical target inside the configured pool before mutation. It removes only the missing target's unlocked registration with `git worktree remove`; other worktrees and locked registrations remain unchanged. It then checks out the branch when it still exists, or creates the branch again at `baseCommit` when it does not, and reports which happened as `branchRecreated`. An existing directory is an error. The calling Session's working directory does not change, and changes that were never committed are not recovered. Checkout disables filters as creation does. `onPhase` receives `prepare` before validation, target-registration cleanup, and branch creation, and `checkout` before the files are written; it must not throw.
diff --git a/packages/experimental/worktree/README.zh.md b/packages/experimental/worktree/README.zh.md
index 41211692ef..cc547eed29 100644
--- a/packages/experimental/worktree/README.zh.md
+++ b/packages/experimental/worktree/README.zh.md
@@ -32,7 +32,9 @@ kind: "package-reference"
- name: '@deepseek-ai/dsh-experimental-tool-worktree'
```
-`ctx.worktrees.create(agent, { name?, from? }, signal?, onPhase?)` 创建新分支与检出目录,再通过 `ctx.workingDirectory.relocate` 进入规范化的检出目录,把该检出目录登记为工作区锚;它是包含新当前目录的最长锚,因此成为 Session 的工作区根。`from` 在创建前解析为本地提交,默认是 `HEAD`;暂存、未暂存、未跟踪以及被忽略的源文件均不复制。`baseCommit` 报告解析出的提交对象名称;仓库本地的替换引用仍作用于检出的内容。检出操作禁用已配置的 Git clean、smudge 和 process 过滤器,不修改仓库配置。分支或检出路径已存在时会报错。返回记录包含 `path`、`branch`、`baseCommit` 和 `repositoryRoot`。可选的第四个参数 `onPhase` 在校验、分配目录与创建分支之前收到 `prepare`,在写入文件并进入检出之前收到 `checkout`;它不得抛出异常。
+`ctx.worktrees.create(agent, { name?, from? }, signal?, onPhase?)` 创建新分支与检出目录,再通过 `ctx.workingDirectory.set` 进入规范化的检出目录。`from` 在创建前解析为本地提交,默认是 `HEAD`;暂存、未暂存、未跟踪以及被忽略的源文件均不复制。`baseCommit` 报告解析出的提交对象名称;仓库本地的替换引用仍作用于检出的内容。检出操作禁用已配置的 Git clean、smudge 和 process 过滤器,不修改仓库配置。分支或检出路径已存在时会报错。返回记录包含 `path`、`branch`、`baseCommit` 和 `repositoryRoot`。可选的第四个参数 `onPhase` 在校验、分配目录与创建分支之前收到 `prepare`,在写入文件并进入检出之前收到 `checkout`;它不得抛出异常。
+
+`ctx.worktrees.exit(agent, signal?)` 找到包含 Session 当前目录的已记录工作树,通过 `ctx.workingDirectory.set` 把 Session 送回该工作树的 `repositoryRoot`,并返回所离开工作树的记录。记录可以是 Session 自己的,也可以是 fork 继承的;嵌套的工作树每次调用退出一层。检出目录与分支保留。没有已记录的工作树包含当前目录,或源检出已不存在时,调用会被拒绝。
`ctx.worktrees.restore(agent, { path, branch, baseCommit, repositoryRoot }, signal?, onPhase?)` 在记录的目录重新检出被删除的 worktree。它在修改前校验记录中的仓库根目录、完整提交对象名、分支和配置池内的规范目标路径。它只通过 `git worktree remove` 移除缺失目标的未锁定登记;其他 worktree 与锁定登记保持不变。随后在分支仍存在时检出该分支,否则在 `baseCommit` 重新创建同名分支,并通过 `branchRecreated` 报告是哪种情况。目录已存在时会报错。调用方 Session 的工作目录不变,从未提交的修改无法恢复。检出与创建时一样禁用过滤器。`onPhase` 在检查目录、清理登记与创建分支之前收到 `prepare`,在写入文件之前收到 `checkout`;它不能抛出异常。
diff --git a/packages/experimental/worktree/src/archive.ts b/packages/experimental/worktree/src/archive.ts
index adb0101f08..eb745da706 100644
--- a/packages/experimental/worktree/src/archive.ts
+++ b/packages/experimental/worktree/src/archive.ts
@@ -48,8 +48,11 @@ interface Attempt {
* Whether `path` is `root` or lies below it. Both are canonical absolute
* directories of one execution world without a trailing separator, so string
* prefixing is exact.
+ * @param root - canonical absolute directory.
+ * @param path - canonical absolute directory to test.
+ * @returns whether `root` contains `path`.
*/
-function within(root: string, path: string): boolean {
+export function within(root: string, path: string): boolean {
return path === root || path.startsWith(`${root}/`)
}
diff --git a/packages/experimental/worktree/src/index.ts b/packages/experimental/worktree/src/index.ts
index f8711806ca..13e24fd536 100644
--- a/packages/experimental/worktree/src/index.ts
+++ b/packages/experimental/worktree/src/index.ts
@@ -1,6 +1,6 @@
/**
- * Creates a new Git branch and checkout, then relocates the calling Session into it as a registered
- * workspace anchor; restores a removed checkout.
+ * Creates a new Git branch and checkout, then changes the calling Session's working directory; returns
+ * the Session to the source checkout; restores a removed checkout.
*/
import { Context, Service, type Volatile } from '@deepseek-ai/cordis'
@@ -15,7 +15,7 @@ import type { Session } from '@deepseek-ai/dsh-session'
import type { ProjectionHandle } from '@deepseek-ai/dsh-session-projection'
import type {} from '@deepseek-ai/dsh-working-directory'
import { MAX_TIMER_DELAY_MS } from '@deepseek-ai/dsh-timeout'
-import { WorktreeReclamation } from './archive.ts'
+import { within, WorktreeReclamation } from './archive.ts'
import { PREPARE_DIRECTORY } from './directory.ts'
import { generatedWorktreeName } from './name.ts'
import { runCommand, scanCommand } from './process.ts'
@@ -207,6 +207,29 @@ export class WorktreeService extends Service {
}
}
+ /**
+ * Return the calling Session from the worktree it works in to the source checkout that worktree was
+ * created from. The worktree is the recorded creation, the Session's own or fork-inherited, with the
+ * longest directory containing the Session's current directory. Its checkout and branch remain.
+ * @param agent - caller whose current directory lies in a recorded worktree.
+ * @param signal - cancellation of directory validation and of the working-directory change.
+ * @returns the worktree the Session left; the Session now works in its `repositoryRoot`.
+ * @throws when no recorded worktree contains the current directory, or the working-directory
+ * service's error when the source checkout no longer exists.
+ */
+ async exit(agent: Agent, signal?: AbortSignal): Promise {
+ const operationSignal = signal === undefined ? this.lifetime.signal : AbortSignal.any([this.lifetime.signal, signal])
+ operationSignal.throwIfAborted()
+ const cwd = await this.ctx.workingDirectory.ensure(agent, operationSignal)
+ let left: CreatedWorktree | undefined
+ for (const { worktree } of this.projection.stateOf(agent.session).created) {
+ if (within(worktree.path, cwd) && (left === undefined || worktree.path.length >= left.path.length)) left = worktree
+ }
+ if (left === undefined) throw new Error(`worktree: no recorded worktree contains the working directory ${JSON.stringify(cwd)}`)
+ await this.ctx.workingDirectory.set(agent, left.repositoryRoot, operationSignal)
+ return left
+ }
+
/**
* Read the archive cleanup of a Session's created checkout; waiting never
* starts one. Absent without the Workspace and query providers.
@@ -280,7 +303,7 @@ export class WorktreeService extends Service {
const overrides = await filterOverrides(run, path)
onPhase?.('checkout')
await run(path, ['--work-tree', path, 'reset', '--hard', '--no-recurse-submodules', baseCommit], undefined, overrides)
- const { cwd: canonicalPath } = await this.ctx.workingDirectory.relocate(agent, path, { signal })
+ const canonicalPath = await this.ctx.workingDirectory.set(agent, path, signal)
const created: CreatedWorktree = { path: canonicalPath, branch, baseCommit, repositoryRoot }
appendPluginRecord(agent.session, CREATED_RECORD, created)
return created
diff --git a/packages/experimental/worktree/tests/worktree.spec.ts b/packages/experimental/worktree/tests/worktree.spec.ts
index 2070e7a57e..27d209554f 100644
--- a/packages/experimental/worktree/tests/worktree.spec.ts
+++ b/packages/experimental/worktree/tests/worktree.spec.ts
@@ -40,7 +40,6 @@ describe('creating and entering retained worktrees', () => {
expect(result).toEqual({ path: join(root, '.agents/worktrees/topic'), branch: 'topic', baseCommit, repositoryRoot: root })
expect(ctx.workingDirectory.get(agent.session)).toBe(result.path)
expect(ctx.workingDirectory.rootOf(agent.session)).toBe(result.path)
- expect(ctx.workingDirectory.anchorsOf(agent.session)).toEqual([root, result.path])
const events = agent.session.snapshotEvents()
const created = events.findIndex(event => pluginRecordOf(event)?.type === 'plugin:worktree/created')
expect(created).toBeGreaterThan(events.findIndex(event => event.type === 'working-directory/change'))
@@ -53,12 +52,54 @@ describe('creating and entering retained worktrees', () => {
expect(await contents(join(root, '.agents/worktrees/.gitignore'))).toBe('*\n')
expect(await git(root, 'check-ignore', '.agents/worktrees/.gitignore')).toBe('.agents/worktrees/.gitignore')
- await ctx.workingDirectory.set(agent, root)
+ await expect(ctx.worktrees.exit(agent)).resolves.toEqual(result)
+ expect(ctx.workingDirectory.get(agent.session)).toBe(root)
expect(ctx.workingDirectory.rootOf(agent.session)).toBe(root)
expect(await git(root, 'rev-parse', 'topic')).toBe(baseCommit)
expect(await contents(join(result.path, 'tracked.txt'))).toBe('initial\n')
})
+ it('exits a nested worktree to the worktree it was created in, then to the source checkout, and refuses outside one', async () => {
+ const root = await repo()
+ ctx = await harness(root)
+ const agent = testAgent(ctx, root)
+ const outer = await ctx.worktrees.create(agent, { name: 'outer' })
+ const inner = await ctx.worktrees.create(agent, { name: 'inner' })
+ expect(inner.repositoryRoot).toBe(outer.path)
+
+ await expect(ctx.worktrees.exit(agent, new AbortController().signal)).resolves.toEqual(inner)
+ expect(ctx.workingDirectory.get(agent.session)).toBe(outer.path)
+ await expect(ctx.worktrees.exit(agent)).resolves.toEqual(outer)
+ expect(ctx.workingDirectory.get(agent.session)).toBe(root)
+ await expect(ctx.worktrees.exit(agent)).rejects.toThrow(`no recorded worktree contains the working directory ${JSON.stringify(root)}`)
+ expect(existsSync(inner.path)).toBe(true)
+ expect(await git(root, 'rev-parse', '--verify', 'refs/heads/inner')).toBe(inner.baseCommit)
+ })
+
+ it('exits a worktree whose subdirectory a change without the workspace marker recorded', async () => {
+ const root = await repo()
+ ctx = await harness(root)
+ const agent = testAgent(ctx, root)
+ const created = await ctx.worktrees.create(agent, { name: 'topic' })
+ await mkdir(join(created.path, 'src'))
+ agent.session.append('working-directory/change', { cwd: join(created.path, 'src') })
+ await expect(ctx.worktrees.exit(agent)).resolves.toEqual(created)
+ expect(ctx.workingDirectory.get(agent.session)).toBe(root)
+ })
+
+ it('rejects an exit cancelled before it starts, and every exit after service disposal, without changing the directory', async () => {
+ const root = await repo()
+ ctx = await harness(root)
+ const agent = testAgent(ctx, root)
+ const created = await ctx.worktrees.create(agent, { name: 'topic' })
+ await expect(ctx.worktrees.exit(agent, AbortSignal.abort(new Error('caller left')))).rejects.toThrow('caller left')
+ expect(ctx.workingDirectory.get(agent.session)).toBe(created.path)
+ const worktrees = ctx.worktrees
+ await ctx.fiber.dispose()
+ ctx = undefined
+ await expect(worktrees.exit(agent)).rejects.toThrow('worktree service disposed')
+ })
+
it('reports the prepare stage, then the checkout stage, before each begins', async () => {
const root = await repo()
ctx = await harness(root)
@@ -294,7 +335,7 @@ describe('creating and entering retained worktrees', () => {
ctx = await harness(root)
const agent = testAgent(ctx, root)
await ctx.workingDirectory.ensure(agent)
- vi.spyOn(ctx.workingDirectory, 'relocate').mockRejectedValueOnce(new Error('directory publication failed'))
+ vi.spyOn(ctx.workingDirectory, 'set').mockRejectedValueOnce(new Error('directory publication failed'))
await expect(ctx.worktrees.create(agent, { name: 'retained' })).rejects.toThrow('Any created checkout and branch are retained')
expect(ctx.workingDirectory.get(agent.session)).toBe(root)
expect(await git(root, 'branch', '--list', 'retained')).toContain('retained')
diff --git a/packages/extensions/tool-cordis/src/api-catalog.ts b/packages/extensions/tool-cordis/src/api-catalog.ts
index fb4cc81f23..cbb7408d8b 100644
--- a/packages/extensions/tool-cordis/src/api-catalog.ts
+++ b/packages/extensions/tool-cordis/src/api-catalog.ts
@@ -4692,8 +4692,8 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [
},
{
key: 'workingDirectory',
- summary: 'One owner for each Session\'s effective directory, its workspace root, and their model-visible changes.',
- description: 'One owner for each Session\'s effective directory, its workspace root, and their model-visible changes.\n\nThe current directory is the cursor every relative path resolves from. The workspace root is the checkout that cursor is in: the longest registered anchor containing it. Anchors are the original project plus every checkout a relocate entered, so an ordinary set inside the root moves only the cursor, a `set` into another anchor switches the root to that anchor, and a `set` outside every anchor moves the cursor and leaves the root.',
+ summary: 'One owner for each Session\'s directory, its workspace root, and their model-visible changes.',
+ description: 'One owner for each Session\'s directory, its workspace root, and their model-visible changes.\n\nA Session works in one directory. Relative paths resolve from it, and it is the workspace root that the write boundary, file views, and discovery follow. Only Host operations move it, through set or the recovery of ensure; every such change moves both. The two differ only in a Session whose log holds a change without the `workspace` marker.',
methods: [
{
signature: 'readonly defaultDirectory: string',
@@ -4710,42 +4710,22 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [
signature: 'rootOf(session: Session): string',
description: 'Read the committed workspace root without filesystem I/O.',
parameters: [{ name: 'session', description: 'Session whose root is requested.' }],
- returns: 'the registered anchor containing the current directory, or the deployment default when none is recorded.',
- },
- {
- signature: 'anchorsOf(session: Session): readonly string[]',
- description: 'Read the registered workspace anchors without filesystem I/O.',
- parameters: [{ name: 'session', description: 'Session whose anchors are requested.' }],
- returns: 'anchors in registration order, the original project first when the header records one.',
+ returns: 'the directory of the last change that moved the workspace, the original project before any, or the deployment default when none is recorded.',
},
{
signature: 'ensure(agent: Agent, signal?: AbortSignal): Promise',
description: 'Validate the current directory and restore the original project when it disappeared.',
parameters: [{ name: 'agent', description: 'live or unpublished Agent owning the Session.' }, { name: 'signal', description: 'cancellation for filesystem inspection.' }],
- returns: 'the existing directory; recovery is committed before fulfillment. A Session without a recorded project records the deployment fallback as its first anchor on its first validation, and a recovery destination outside every anchor joins the anchors. A notice failure is warned without reverting the committed state.',
+ returns: 'the existing directory; recovery is committed before fulfillment and moves the workspace root with the directory. A notice failure is warned without reverting the committed state.',
throws: ['{@link WorkingDirectoryError} `WORKING_DIRECTORY_UNAVAILABLE` when the original project is also unavailable or the service is disposed, or the rejection of a `working-directory/access` listener.'],
},
{
signature: 'set(agent: Agent, path: string, signal?: AbortSignal): Promise',
- description: 'Change one Session\'s directory without changing existing processes or permissions. The workspace root follows the registered anchors: a path inside the current root keeps it, a path inside another anchor selects that anchor, and a path outside every anchor leaves the root unchanged.',
+ description: 'Move one Session\'s workspace: its current directory and its workspace root become `path`. Existing processes keep their directories. Callers are Host operations that chose the directory; a model-supplied path would move the workspace-write boundary with it.',
parameters: [{ name: 'agent', description: 'live or unpublished Agent owning the Session.' }, { name: 'path', description: 'absolute path or a path relative to its current directory.' }, { name: 'signal', description: 'cancellation before the durable change.' }],
returns: 'the canonical absolute directory, committed before fulfillment. A notice failure is warned; the next request still receives the committed directory.',
throws: ['{@link WorkingDirectoryError} `WORKING_DIRECTORY_INVALID` for an empty path and `WORKING_DIRECTORY_NOT_FOUND` when the path is not an existing directory, or the rejection of a `working-directory/access` listener.'],
},
- {
- signature: 'relocate(agent: Agent, root: string, options: RelocateOptions = {}): Promise',
- description: 'Enter another checkout: register `root` as a workspace anchor of the Session and move its current directory to `options.cwd`, or to the root itself. One committed event carries both; existing processes and permissions are unchanged.',
- parameters: [{ name: 'agent', description: 'live or unpublished Agent owning the Session.' }, { name: 'root', description: 'absolute checkout directory, or a path relative to the current directory.' }, { name: 'options', description: 'directory to enter inside the root and cancellation before the durable change.' }],
- returns: 'the committed current directory and the workspace root selected after the commit; the registered root is that root unless a more specific anchor already contains the directory. A notice failure is warned; the next request still receives the committed directories.',
- throws: ['{@link WorkingDirectoryError} `WORKING_DIRECTORY_INVALID` for an empty path or a directory outside the root and `WORKING_DIRECTORY_NOT_FOUND` when either path is not an existing directory.'],
- },
- {
- signature: 'async inherit(agent: Agent, source: Session, options: InheritOptions): Promise',
- description: 'Start a Session\'s directories from another Session\'s. When `source` works in a registered checkout other than the starting Session\'s own original project and `options.cwd` lies inside that checkout, the checkout is registered as the starting Session\'s anchor and `cwd` entered through relocate; otherwise only the current directory is set through set. Only the source\'s current root is passed on, never its other anchors, and later changes to `source` do not reach the starting Session.',
- parameters: [{ name: 'agent', description: 'live or unpublished Agent owning the Session that starts.' }, { name: 'source', description: 'Session whose current root may be passed on; the call leaves it unchanged.' }, { name: 'options', description: 'canonical absolute directory to start in and cancellation before the durable change.' }],
- returns: 'the committed current directory and the workspace root selected after the commit.',
- throws: ['{@link WorkingDirectoryError} `WORKING_DIRECTORY_NOT_FOUND` when `options.cwd` is not an existing directory, or the rejection of a `working-directory/access` listener.'],
- },
],
},
{
@@ -4976,6 +4956,13 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [
parameters: [{ name: 'agent', description: 'caller whose sandbox policy confines the commands.' }, { name: 'request', description: 'recorded directory, branch, base commit, and source repository root.' }, { name: 'signal', description: 'cancellation of the restoration.' }, { name: 'onPhase', description: 'receives each stage before it begins; it must not throw.' }],
returns: 'the directory and whether the branch was created again.',
},
+ {
+ signature: 'async exit(agent: Agent, signal?: AbortSignal): Promise',
+ description: 'Return the calling Session from the worktree it works in to the source checkout that worktree was created from. The worktree is the recorded creation, the Session\'s own or fork-inherited, with the longest directory containing the Session\'s current directory. Its checkout and branch remain.',
+ parameters: [{ name: 'agent', description: 'caller whose current directory lies in a recorded worktree.' }, { name: 'signal', description: 'cancellation of directory validation and of the working-directory change.' }],
+ returns: 'the worktree the Session left; the Session now works in its `repositoryRoot`.',
+ throws: ['when no recorded worktree contains the current directory, or the working-directory service\'s error when the source checkout no longer exists.'],
+ },
{
signature: 'async cleanupOf(session: Session, revision: number | null): Promise',
description: 'Read the archive cleanup of a Session\'s created checkout; waiting never starts one. Absent without the Workspace and query providers.',
@@ -7196,10 +7183,6 @@ export const TYPE_API: readonly TypeApiEntry[] = [
name: 'IndexInjectionPlacement',
declaration: 'export type IndexInjectionPlacement = \'head\' | \'body\';',
},
- {
- name: 'InheritOptions',
- declaration: 'export interface InheritOptions {\n cwd: string;\n signal?: AbortSignal;\n}',
- },
{
name: 'InspectOptions',
declaration: 'export interface InspectOptions {\n readonly registry?: Registry;\n}',
@@ -8400,14 +8383,6 @@ export const TYPE_API: readonly TypeApiEntry[] = [
name: 'Reload',
declaration: 'export interface Reload {\n filename: string;\n modules: ReloadModules;\n runtime?: Plugin.Runtime | undefined;\n}',
},
- {
- name: 'RelocatedDirectories',
- declaration: 'export interface RelocatedDirectories {\n root: string;\n cwd: string;\n}',
- },
- {
- name: 'RelocateOptions',
- declaration: 'export interface RelocateOptions {\n cwd?: string;\n signal?: AbortSignal;\n}',
- },
{
name: 'RemoteAccessAction',
declaration: 'export type RemoteAccessAction = RemoteAccessEndpoint | `event:${string}`;',
diff --git a/packages/fs/tool-fs-search/README.i18n.yaml b/packages/fs/tool-fs-search/README.i18n.yaml
index 7a0b05ae8c..36160722e1 100644
--- a/packages/fs/tool-fs-search/README.i18n.yaml
+++ b/packages/fs/tool-fs-search/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-tool-fs-search/use-this-package:
- en: 494119ddc7157140
- zh: 2fb6e69531ccb2b8
+ en: 757279ecd784f631
+ zh: 0293aafacaf3c803
/deepseek-ai-dsh-tool-fs-search/use-this-package/minimal-composition:
en: a5a01d14e0bec814
zh: 409298cfafd91b05
diff --git a/packages/fs/tool-fs-search/README.md b/packages/fs/tool-fs-search/README.md
index 3c9abfb28f..4e74cf6beb 100644
--- a/packages/fs/tool-fs-search/README.md
+++ b/packages/fs/tool-fs-search/README.md
@@ -25,7 +25,7 @@ Use `dsh-tool-fs-search` to give models `glob` file discovery and `grep` content
## Use this package
-Searches use the Session's current working directory, including changes made with `working_directory`.
+Searches use the Session's current working directory, including a directory entered through a Host operation such as worktree creation.
Mount the tools after a `ctx.subprocess` backend; no host `rg` install is needed, and no filesystem provider is required. The model then gets modification-time-ordered file discovery and line-oriented content search, each bounded and timeout-guarded.
diff --git a/packages/fs/tool-fs-search/README.zh.md b/packages/fs/tool-fs-search/README.zh.md
index 793d4e3ca9..d939256c33 100644
--- a/packages/fs/tool-fs-search/README.zh.md
+++ b/packages/fs/tool-fs-search/README.zh.md
@@ -25,7 +25,7 @@ kind: "package-reference"
## 使用本包
-搜索使用 Session 的当前工作目录,包括通过 `working_directory` 切换后的目录。
+搜索使用 Session 的当前工作目录,包括经创建工作树等 Host 操作进入的目录。
在 `ctx.subprocess` 后端之后挂载工具;无需宿主 `rg` 安装,也无需文件系统提供方。模型随后获得按修改时间排序的文件发现与按行组织的内容搜索,两者都有界并受超时防护。
diff --git a/packages/preset/agent-preset/skills/dsh-doc/references/packages.md b/packages/preset/agent-preset/skills/dsh-doc/references/packages.md
index 489d3c98ce..52e1babf34 100644
--- a/packages/preset/agent-preset/skills/dsh-doc/references/packages.md
+++ b/packages/preset/agent-preset/skills/dsh-doc/references/packages.md
@@ -394,7 +394,6 @@ Every package below exports a Cordis plugin that a bundle patch can name in a Lo
| `@deepseek-ai/dsh-session-title` | yes | Log-backed session title service and provider registry for the DeepSeek Harness |
| `@deepseek-ai/dsh-session-title-first-prompt-llm` | yes | First-message LLM provider plugin for DeepSeek Harness session titles |
| `@deepseek-ai/dsh-session-turn-outline` | no | Whole-log turn outline projection (turnOutline) for the DeepSeek Harness |
-| `@deepseek-ai/dsh-tool-working-directory` | no | Read and change the active Session working directory |
| `@deepseek-ai/dsh-working-directory` | yes | Session working directories with durable changes and model context |
## session-query
diff --git a/packages/sdk/client/README.i18n.yaml b/packages/sdk/client/README.i18n.yaml
index f09d71e902..69eb4586c6 100644
--- a/packages/sdk/client/README.i18n.yaml
+++ b/packages/sdk/client/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-sdk-client/use-this-package:
- en: 57e8b2f9a5321c27
- zh: 0af1d3e4ed6f6fd3
+ en: e4a67206e52d524e
+ zh: db85694ac394a8ea
/deepseek-ai-dsh-sdk-client/use-this-package/running-agent-turns-with-deepseekharness:
en: 1a36c54463e17340
zh: ad67f9cbccc56def
diff --git a/packages/sdk/client/README.md b/packages/sdk/client/README.md
index a9b55134da..9638de2b3d 100644
--- a/packages/sdk/client/README.md
+++ b/packages/sdk/client/README.md
@@ -55,7 +55,7 @@ try {
`await harness.resumeSession(savedId)` restores a persisted session from the configured `dshHome` and returns a `HarnessSession` ready for `run()`. Save the original session id and reuse its home and workspace. Restoration preserves conversation history and its directory, repairs an interrupted final turn, and sends no new input. Missing, unreadable, incompatible, or occupied sessions reject without creating a replacement. `session(id)` remains a lazy handle for an in-process session; it does not request persisted restoration. Shell, browser, and other external processes are not restored by this API.
-`HarnessSession.getWorkingDirectory()` reads the effective directory; `getWorkspaceRoot()` reads the workspace root that directory is in; `setWorkingDirectory(path)` changes the directory and returns the validated absolute path. Each method creates an unknown Session without starting a model turn. Relative paths use the Session's current directory. Origin metadata, permissions, and existing processes remain unchanged. `HarnessClient` exposes the same methods with a leading `sessionId` argument.
+`HarnessSession.getWorkingDirectory()` reads the effective directory; `setWorkingDirectory(path)` changes it and returns the validated absolute path. Either method creates an unknown Session without starting a model turn. Relative paths use the Session's current directory. Origin metadata, permissions, and existing processes remain unchanged. `HarnessClient` exposes the same methods with a leading `sessionId` argument.
### Running agent turns with DeepSeekHarness
diff --git a/packages/sdk/client/README.zh.md b/packages/sdk/client/README.zh.md
index 4413d0ba8b..289cf114e8 100644
--- a/packages/sdk/client/README.zh.md
+++ b/packages/sdk/client/README.zh.md
@@ -55,7 +55,7 @@ try {
`await harness.resumeSession(savedId)` 从配置的 `dshHome` 恢复持久化会话,并返回可调用 `run()` 的 `HarnessSession`。请保存原会话 id,并沿用其 home 和工作区。恢复会保留对话历史及其目录、修复最后一个被中断的轮次,且不发送新输入。会话缺失、不可读、不兼容或被占用时,请求失败且不创建替代会话。`session(id)` 仍是当前进程内会话的惰性句柄,不会请求持久化恢复。此 API 不恢复 shell、浏览器或其他外部进程。
-`HarnessSession.getWorkingDirectory()` 读取有效目录;`getWorkspaceRoot()` 读取该目录所在的工作区根;`setWorkingDirectory(path)` 修改目录并返回校验后的绝对路径。每个方法都可创建未知 Session,而不启动模型轮次。相对路径以 Session 当前目录解析。起始目录元数据、权限与已有进程保持不变。`HarnessClient` 提供同名方法,并以 `sessionId` 作为首个参数。
+`HarnessSession.getWorkingDirectory()` 读取有效目录;`setWorkingDirectory(path)` 修改目录并返回校验后的绝对路径。两个方法都可创建未知 Session,而不启动模型轮次。相对路径以 Session 当前目录解析。起始目录元数据、权限与已有进程保持不变。`HarnessClient` 提供同名方法,并以 `sessionId` 作为首个参数。
### 用 DeepSeekHarness 运行 agent 轮次
diff --git a/packages/sdk/client/src/api.ts b/packages/sdk/client/src/api.ts
index bb9ff80155..34b644aadf 100644
--- a/packages/sdk/client/src/api.ts
+++ b/packages/sdk/client/src/api.ts
@@ -238,15 +238,6 @@ export class HarnessSession {
return this.harness.client.getWorkingDirectory(this.id)
}
- /**
- * Read the workspace root the effective directory is in, recovering a missing directory to the Session origin.
- * @returns the absolute checkout directory that file views and the write boundary follow.
- */
- async getWorkspaceRoot(): Promise {
- await this.harness.start()
- return this.harness.client.getWorkspaceRoot(this.id)
- }
-
/**
* Change the effective directory without moving existing processes or changing permissions.
* @param path - absolute or Session-current-directory-relative directory.
diff --git a/packages/sdk/client/src/client.ts b/packages/sdk/client/src/client.ts
index 5dd6f06a1c..078acbbff6 100644
--- a/packages/sdk/client/src/client.ts
+++ b/packages/sdk/client/src/client.ts
@@ -374,17 +374,8 @@ export class HarnessClient {
* @param sessionId - target Session; an unknown id creates it.
* @returns the absolute effective directory.
*/
- async getWorkingDirectory(sessionId: string): Promise {
- return (await this.workingDirectoryRequest('session/working-directory/get', { sessionId })).cwd
- }
-
- /**
- * Read the workspace root a Session's effective directory is in, recovering the directory if missing.
- * @param sessionId - target Session; an unknown id creates it.
- * @returns the absolute workspace root.
- */
- async getWorkspaceRoot(sessionId: string): Promise {
- return (await this.workingDirectoryRequest('session/working-directory/get', { sessionId })).root
+ getWorkingDirectory(sessionId: string): Promise {
+ return this.workingDirectoryRequest('session/working-directory/get', { sessionId })
}
/**
@@ -393,16 +384,16 @@ export class HarnessClient {
* @param path - absolute or Session-current-directory-relative path.
* @returns the validated absolute directory.
*/
- async setWorkingDirectory(sessionId: string, path: string): Promise {
- return (await this.workingDirectoryRequest('session/working-directory/set', { sessionId, path })).cwd
+ setWorkingDirectory(sessionId: string, path: string): Promise {
+ return this.workingDirectoryRequest('session/working-directory/set', { sessionId, path })
}
- private async workingDirectoryRequest(method: string, params: object): Promise<{ cwd: string; root: string }> {
+ private async workingDirectoryRequest(method: string, params: object): Promise {
const result = await this.request(method, params)
- if (!isRecord(result) || typeof result.cwd !== 'string' || typeof result.root !== 'string') {
+ if (!isRecord(result) || typeof result.cwd !== 'string') {
throw new SdkProtocolError(`${method} returned no working directory: ${JSON.stringify(result)}`)
}
- return { cwd: result.cwd, root: result.root }
+ return result.cwd
}
/**
diff --git a/packages/sdk/client/tests/fake-runtime.ts b/packages/sdk/client/tests/fake-runtime.ts
index fdc3655b7b..8ff3cd6445 100644
--- a/packages/sdk/client/tests/fake-runtime.ts
+++ b/packages/sdk/client/tests/fake-runtime.ts
@@ -314,7 +314,7 @@ reader.on('line', (line) => {
? resolve(previous, String(frame.params?.path))
: previous
workingDirectories.set(sessionId, cwd)
- respond({ cwd, root: originCwd })
+ respond({ cwd })
return
}
case 'session/query':
diff --git a/packages/sdk/client/tests/sdk-client.spec.ts b/packages/sdk/client/tests/sdk-client.spec.ts
index f9a1cc649c..7cb2b2ea65 100644
--- a/packages/sdk/client/tests/sdk-client.spec.ts
+++ b/packages/sdk/client/tests/sdk-client.spec.ts
@@ -105,14 +105,12 @@ describe('DeepSeekHarness', () => {
const origin = await first.getWorkingDirectory()
expect(await first.setWorkingDirectory('child')).toBe(join(origin, 'child'))
expect(await first.getWorkingDirectory()).toBe(join(origin, 'child'))
- expect(await first.getWorkspaceRoot()).toBe(origin)
expect(await second.getWorkingDirectory()).toBe(origin)
})
it('rejects a malformed working-directory response', async () => {
const harness = harnessWith({ FAKE_MALFORMED_DIRECTORY: '1' })
await expect(harness.session().getWorkingDirectory()).rejects.toThrow('returned no working directory')
- await expect(harness.session().getWorkspaceRoot()).rejects.toThrow('returned no working directory')
await expect(harness.session().setWorkingDirectory('.')).rejects.toThrow('returned no working directory')
})
it('ignores notifications that precede the submitted message receipt', async () => {
diff --git a/packages/sdk/protocol/src/types.ts b/packages/sdk/protocol/src/types.ts
index 3d76ea7ee8..6bcd2de704 100644
--- a/packages/sdk/protocol/src/types.ts
+++ b/packages/sdk/protocol/src/types.ts
@@ -143,8 +143,6 @@ export interface SessionWorkingDirectorySetParams extends SessionWorkingDirector
export interface SessionWorkingDirectoryResult {
/** Absolute directory used by future independent operations and new processes. */
cwd: string
- /** Absolute workspace root: the checkout `cwd` is in, which file views and the write boundary follow. */
- root: string
}
/** Deployment-mapped SDK outcome: `ok` for an accepted result, `error` otherwise. */
diff --git a/packages/sdk/server/README.i18n.yaml b/packages/sdk/server/README.i18n.yaml
index 58789ed0e0..fcc20f3d98 100644
--- a/packages/sdk/server/README.i18n.yaml
+++ b/packages/sdk/server/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-sdk-jsonrpc-server/use-this-package:
- en: ab783c9bddff0173
- zh: 33af618c0f01aaa9
+ en: 1a8598a9ca7ec995
+ zh: dbbd0dd3aecb7d24
/deepseek-ai-dsh-sdk-jsonrpc-server/use-this-package/wiring:
en: 47a33e9397e36e15
zh: e6d173820f9ea6e5
diff --git a/packages/sdk/server/README.md b/packages/sdk/server/README.md
index 9a6585e8c8..b2fe1e211a 100644
--- a/packages/sdk/server/README.md
+++ b/packages/sdk/server/README.md
@@ -53,7 +53,7 @@ Without attachments, `/plan` and `/plan off` change only native plan state. `/pl
Creation and edit accept images as reference material before the next round; show, pause, resume, and clear reject attachments without changing goal state. Compact and permission commands also reject attachments. Handler refusals never fall back to ordinary prompts; an image may already be stored before the handler refuses, as on Desktop. These SDK inputs accept raster images, not general file uploads or client-supplied attachment references.
-`session/working-directory/get` accepts `{ sessionId }`; `session/working-directory/set` accepts `{ sessionId, path }`. Both return `{ cwd, root }`, the effective directory and the workspace root it is in, and create an unknown Session without starting a model turn. Reads recover missing directories through the working-directory service; changes preserve origin metadata and permissions, and reach the model through logged user context.
+`session/working-directory/get` accepts `{ sessionId }`; `session/working-directory/set` accepts `{ sessionId, path }`. Both return `{ cwd }` and create an unknown Session without starting a model turn. Reads recover missing directories through the working-directory service; changes preserve origin metadata and permissions, and reach the model through logged user context.
### Wiring
diff --git a/packages/sdk/server/README.zh.md b/packages/sdk/server/README.zh.md
index 15a80fcd3f..ac9bc98399 100644
--- a/packages/sdk/server/README.zh.md
+++ b/packages/sdk/server/README.zh.md
@@ -53,7 +53,7 @@ Host 与桌面适配器共用 `dsh-commands/builtin` 的定义身份及中英文
创建和编辑接受图片,作为下一轮前的参考材料;查看、暂停、恢复和清除拒绝附件,不修改目标状态。压缩和权限命令也拒绝附件。处理器拒绝后绝不回退为普通提示词;与 Desktop 相同,图片可能在处理器拒绝前已被存储。这些 SDK 输入接受栅格图片,不接受一般文件上传或客户端提供的附件引用。
-`session/working-directory/get` 接收 `{ sessionId }`;`session/working-directory/set` 接收 `{ sessionId, path }`。两者均返回 `{ cwd, root }`,即有效目录及其所在的工作区根,并可创建未知 Session,而不启动模型轮次。读取通过工作目录服务恢复缺失目录;修改保留起始目录元数据与权限,并通过已记录的用户上下文告知模型。
+`session/working-directory/get` 接收 `{ sessionId }`;`session/working-directory/set` 接收 `{ sessionId, path }`。两者均返回 `{ cwd }`,并可创建未知 Session,而不启动模型轮次。读取通过工作目录服务恢复缺失目录;修改保留起始目录元数据与权限,并通过已记录的用户上下文告知模型。
### 组装
diff --git a/packages/sdk/server/src/server.ts b/packages/sdk/server/src/server.ts
index a10dceba1a..82a3bd9e27 100644
--- a/packages/sdk/server/src/server.ts
+++ b/packages/sdk/server/src/server.ts
@@ -413,25 +413,23 @@ export class HarnessSdkJsonRpcServer {
}
/**
- * Read a Session's effective directory and workspace root, recovering a missing directory to its origin.
+ * Read a Session's effective directory, recovering a missing directory to its origin.
* @param params - target Session; an unknown id creates it.
- * @returns the absolute effective directory and the root it is in.
+ * @returns the absolute effective directory.
*/
async getWorkingDirectory(params: SessionWorkingDirectoryParams): Promise {
const agent = await this.workingDirectoryAgent(params.sessionId)
- const cwd = await this.ctx.workingDirectory.ensure(agent)
- return { cwd, root: this.ctx.workingDirectory.rootOf(agent.session) }
+ return { cwd: await this.ctx.workingDirectory.ensure(agent) }
}
/**
* Change a Session's directory and queue its model-visible transition.
* @param params - target Session and absolute or current-directory-relative path.
- * @returns the validated absolute directory and the root it is in; origin and permissions are unchanged.
+ * @returns the validated absolute directory; origin and permissions are unchanged.
*/
async setWorkingDirectory(params: SessionWorkingDirectorySetParams): Promise {
const agent = await this.workingDirectoryAgent(params.sessionId)
- const cwd = await this.ctx.workingDirectory.set(agent, params.path)
- return { cwd, root: this.ctx.workingDirectory.rootOf(agent.session) }
+ return { cwd: await this.ctx.workingDirectory.set(agent, params.path) }
}
private async workingDirectoryAgent(sessionId: string): Promise {
diff --git a/packages/sdk/server/tests/server.spec.ts b/packages/sdk/server/tests/server.spec.ts
index 4f61652506..25bab4c9ed 100644
--- a/packages/sdk/server/tests/server.spec.ts
+++ b/packages/sdk/server/tests/server.spec.ts
@@ -236,12 +236,12 @@ describe('HarnessSdkJsonRpcServer', () => {
.rejects.toThrow('SDK server is not initialized')
expect(ctx.agents.list()).toEqual([])
await server.initialize({ cwd: root, provider: 'mock', model: 'mock' })
- // The header and the root carry the canonical spelling of the configured directory.
+ // The header carries the canonical spelling of the configured directory.
const canonicalRoot = await realpath(root)
- await expect(server.handleRequest('session/working-directory/get', { sessionId: 'a' })).resolves.toEqual({ cwd: canonicalRoot, root: canonicalRoot })
+ await expect(server.handleRequest('session/working-directory/get', { sessionId: 'a' })).resolves.toEqual({ cwd: canonicalRoot })
const selected = await realpath(child)
- await expect(server.handleRequest('session/working-directory/set', { sessionId: 'a', path: 'child' })).resolves.toEqual({ cwd: selected, root: canonicalRoot })
- await expect(server.handleRequest('session/working-directory/get', { sessionId: 'b' })).resolves.toEqual({ cwd: canonicalRoot, root: canonicalRoot })
+ await expect(server.handleRequest('session/working-directory/set', { sessionId: 'a', path: 'child' })).resolves.toEqual({ cwd: selected })
+ await expect(server.handleRequest('session/working-directory/get', { sessionId: 'b' })).resolves.toEqual({ cwd: canonicalRoot })
const agent = ctx.agents.get(SessionId('a'))!
expect(agent.session.header.cwd).toBe(canonicalRoot)
await server.prompt({ sessionId: 'a', contentBlocks: [{ type: 'text', text: 'where' }] })
diff --git a/packages/session/README.i18n.yaml b/packages/session/README.i18n.yaml
index 2d1ca1a8ce..a825ab0d10 100644
--- a/packages/session/README.i18n.yaml
+++ b/packages/session/README.i18n.yaml
@@ -21,8 +21,8 @@
en: cbe033c3f37b8aa7
zh: 69aa84f0712d0111
/session-durable-session-data-plane/packages/projection:
- en: 771237f055ad360c
- zh: 418d3284a574cbec
+ en: 27b4476aaed9cadd
+ zh: 1ff3b5f6223da93e
/session-durable-session-data-plane/packages/titles:
en: 81245e5ca5f8b773
zh: 0abee7434238c342
diff --git a/packages/session/README.md b/packages/session/README.md
index 012b5248b8..a8bc0d7224 100644
--- a/packages/session/README.md
+++ b/packages/session/README.md
@@ -45,8 +45,7 @@ The group splits into four families: durable storage (persistence seam, backends
| Package | Role | ctx key |
|---|---|---|
| [`session-projection/`](session-projection/README.md) | Defines and drives projection units that fold committed events into whole current values | `ctx.sessionProjections` |
-| [`working-directory/`](working-directory/README.md) | Owns each Session's effective execution directory, the workspace root it is in, and user-context changes | `ctx.workingDirectory` |
-| [`tool-working-directory/`](tool-working-directory/README.md) | Reads or changes the active directory through one tool | `working_directory` |
+| [`working-directory/`](working-directory/README.md) | Owns each Session's effective execution directory, its workspace root, and user-context changes | `ctx.workingDirectory` |
| [`session-projection-cache/`](session-projection-cache/README.md) | Persists projection checkpoints so cold reads skip full log loads | `ctx.sessionProjectionCache` |
| [`session-stats/`](session-stats/README.md) | Serves whole-log conversation counts and wall times through the `sessionStats` unit | registers on `ctx.sessionProjections` |
| [`session-turn-outline/`](session-turn-outline/README.md) | Serves the whole-log turn outline (turn, `turn/start` seq, prompt preview) through the `turnOutline` unit | registers on `ctx.sessionProjections` |
diff --git a/packages/session/README.zh.md b/packages/session/README.zh.md
index b93c815f28..32cc733950 100644
--- a/packages/session/README.zh.md
+++ b/packages/session/README.zh.md
@@ -45,8 +45,7 @@ session 组让对话持久保存,恢复已发布的日志格式,并使已提
| 包 | 职责 | ctx key |
|---|---|---|
| [`session-projection/`](session-projection/README.zh.md) | 定义并驱动把已提交事件折叠为完整当前值的投影单元 | `ctx.sessionProjections` |
-| [`working-directory/`](working-directory/README.zh.md) | 拥有每个 Session 的有效执行目录、它所在的工作区根和用户上下文变更 | `ctx.workingDirectory` |
-| [`tool-working-directory/`](tool-working-directory/README.zh.md) | 通过一个工具读取或改变当前目录 | `working_directory` |
+| [`working-directory/`](working-directory/README.zh.md) | 拥有每个 Session 的有效执行目录、工作区根和用户上下文变更 | `ctx.workingDirectory` |
| [`session-projection-cache/`](session-projection-cache/README.zh.md) | 持久化投影检查点,使冷读跳过全量日志加载 | `ctx.sessionProjectionCache` |
| [`session-stats/`](session-stats/README.zh.md) | 通过 `sessionStats` 单元提供全日志会话计数与墙钟时间 | 注册到 `ctx.sessionProjections` |
| [`session-turn-outline/`](session-turn-outline/README.zh.md) | 通过 `turnOutline` 单元提供全日志轮次大纲(轮次、`turn/start` seq、提示词预览) | 注册到 `ctx.sessionProjections` |
diff --git a/packages/session/tool-working-directory/README.i18n.yaml b/packages/session/tool-working-directory/README.i18n.yaml
deleted file mode 100644
index 9e45d5365a..0000000000
--- a/packages/session/tool-working-directory/README.i18n.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
-# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
-# After editing either side, bring the other along and re-record with:
-# pnpm run verify-translation-pairing --write packages/session/tool-working-directory/README.md
-/:
- en: 98cfd91158449dab
- zh: 5235a85797dc16a6
-/deepseek-ai-dsh-tool-working-directory:
- en: 1cbdc6d915999dbc
- zh: 0c6cc71c43276a63
-/deepseek-ai-dsh-tool-working-directory/summary:
- en: 9a02398f19196e04
- zh: 490c400f5c7c23cd
-/deepseek-ai-dsh-tool-working-directory/table-of-contents:
- en: d152484eb41ac6b4
- zh: 87d7d2dbd7777429
-/deepseek-ai-dsh-tool-working-directory/use-this-package:
- en: 83ab57140ebea28e
- zh: 213c36a664a21f65
-/deepseek-ai-dsh-tool-working-directory/understand-the-implementation:
- en: f361fe510916fce8
- zh: a2127f768ef9ac95
-/deepseek-ai-dsh-tool-working-directory/further-exploration:
- en: eabff683146786c8
- zh: 7997dec17802ef64
-/deepseek-ai-dsh-tool-working-directory/model-experience:
- en: 215e7ba838619b7b
- zh: a311da3843709f90
-/deepseek-ai-dsh-tool-working-directory/model-experience/tool-schema-and-result:
- en: bc924247b1806144
- zh: af4cc374d7d16917
-/deepseek-ai-dsh-tool-working-directory/model-experience/tool-schema-and-result/what-the-model-sees:
- en: e69a26e66bc5e3c4
- zh: 9a7515def45d139c
-/deepseek-ai-dsh-tool-working-directory/model-experience/tool-schema-and-result/token-effect:
- en: a8379dea8db4e2a2
- zh: 5b8c86352564ba68
-/deepseek-ai-dsh-tool-working-directory/model-experience/tool-schema-and-result/kv-cache-effect:
- en: ae50eb17ba3b6545
- zh: 6f5eed7bb30209e4
-/deepseek-ai-dsh-tool-working-directory/known-limitations-and-deferred-work:
- en: 58cd03e27224e8b8
- zh: 4bd8752b74d1b05f
-/deepseek-ai-dsh-tool-working-directory/known-limitations-and-deferred-work/dev-note:
- en: e67f633dc6fe7773
- zh: a4b126f9a4eaca6f
diff --git a/packages/session/tool-working-directory/README.md b/packages/session/tool-working-directory/README.md
deleted file mode 100644
index 379743d651..0000000000
--- a/packages/session/tool-working-directory/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
----
-description: "Read the Session’s current directory or enter an existing directory with the same tool. Relative changes use the current directory. The returned absolute path can be passed to other tools."
-kind: "package-reference"
----
-
-# @deepseek-ai/dsh-tool-working-directory
-
-English | [中文](README.zh.md)
-
-## Summary
-
-Read the Session’s current directory or enter an existing directory with the same tool. Relative changes use the current directory. The returned absolute path can be passed to other tools.
-
-## Table of Contents
-
-- [Use this package](#use-this-package)
-- [Understand the implementation](#understand-the-implementation)
-- [Further Exploration](#further-exploration)
-- [Model Experience](#model-experience)
-- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
-- [Dev Note](#dev-note)
-
------
-
-
-## Use this package
-
-Mount alongside `tools` and `workingDirectory`. Call `working_directory({})` to read or `working_directory({ cd: "src" })` to change directory. The tool has no configuration fields. A call without a calling Agent fails with `ToolContextUnavailableError` (`TOOL_CONTEXT_UNAVAILABLE`), an empty `cd` with `ToolArgsError` (`INVALID_ARGS`), and a missing directory with the service's `WorkingDirectoryError` codes.
-
-```yaml
-- name: '@deepseek-ai/dsh-tool-working-directory'
-```
-
------
-
-
-## Understand the implementation
-
-
-Implementation internals — click to expand
-
-The tool delegates validation, recovery, persistence, and context notices to the directory owner. Its canonical result contains `cwd`; native rendering returns that path. The generic tool card displays the arguments and result without a separate GUI renderer.
-
-No runtime invariant companion is published because the tool delegates all directory state and mutations to `workingDirectory`.
-
-
-
------
-
-
-## Further Exploration
-
-- [Working directories](../../../docs/subsystems/working-directory.md) — shared runtime behavior.
-- [Session group](../README.md) — durable Session services.
-- [Testing](../../../docs/testing.md) — composition and replay verification.
-
------
-
-
-## Model Experience
-
-### Tool schema and result
-
-#### What the model sees
-
-The [tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-working-directory) defines the optional `cd` argument and canonical `cwd` result. Directory notices are owned by `dsh-working-directory`.
-
-#### Token effect
-
-The registered schema and returned path contribute tokens when the tool is available and invoked.
-
-#### KV Cache effect
-
-Changing tool availability changes its schema context. A tool call appends ordinary call and result history without replacing prior messages.
-
-## Known Limitations and Deferred Work
-
-
-
-- **Calling Session required** — the tool requires an Agent and changes neither existing processes nor write permissions.
-
-
-### Dev Note
-
-
-Working context for maintainers — click to expand
-
-None.
-
-
diff --git a/packages/session/tool-working-directory/README.zh.md b/packages/session/tool-working-directory/README.zh.md
deleted file mode 100644
index 5c8cc05bd6..0000000000
--- a/packages/session/tool-working-directory/README.zh.md
+++ /dev/null
@@ -1,90 +0,0 @@
----
-description: "使用同一工具读取 Session 的当前目录,或进入一个现有目录。相对路径变更基于当前目录解析。返回的绝对路径可传给其他工具。"
-kind: "package-reference"
----
-
-# @deepseek-ai/dsh-tool-working-directory
-
-[English](README.md) | 中文
-
-## 概述
-
-使用同一工具读取 Session 的当前目录,或进入一个现有目录。相对路径变更基于当前目录解析。返回的绝对路径可传给其他工具。
-
-## 目录
-
-- [使用此包](#use-this-package)
-- [理解实现](#understand-the-implementation)
-- [进一步阅读](#further-exploration)
-- [模型体验](#model-experience)
-- [已知限制与后续工作](#known-limitations-and-deferred-work)
-- [开发备注](#dev-note)
-
------
-
-
-## 使用此包
-
-与 `tools` 和 `workingDirectory` 一起挂载。调用 `working_directory({})` 读取目录,或调用 `working_directory({ cd: "src" })` 改变目录。此工具没有配置字段。没有调用方 Agent 的调用以 `ToolContextUnavailableError`(`TOOL_CONTEXT_UNAVAILABLE`)失败,`cd` 为空以 `ToolArgsError`(`INVALID_ARGS`)失败,目录不存在时使用服务的 `WorkingDirectoryError` code。
-
-```yaml
-- name: '@deepseek-ai/dsh-tool-working-directory'
-```
-
------
-
-
-## 理解实现
-
-
-实现细节 — 点击展开
-
-此工具将验证、恢复、持久化和上下文通知委托给目录服务。规范结果包含 `cwd`;原生渲染返回该路径。通用工具卡展示参数和结果,无需独立 GUI 渲染器。
-
-不发布 `./invariant` 伴生模块,因为工具将全部目录状态和变更委托给 `workingDirectory`。
-
-
-
------
-
-
-## 进一步阅读
-
-- [工作目录](../../../docs/subsystems/working-directory.zh.md) — 共享运行时行为。
-- [Session 包组](../README.zh.md) — 持久化 Session 服务。
-- [测试](../../../docs/testing.zh.md) — 组合与回放验证。
-
------
-
-
-## 模型体验
-
-### 工具 schema 与结果
-
-#### 模型可见内容
-
-[工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-working-directory) 定义可选的 `cd` 参数与规范 `cwd` 结果。目录通知由 `dsh-working-directory` 拥有。
-
-#### Token 影响
-
-工具可用及被调用时,注册的 schema 和返回路径贡献 token。
-
-#### KV Cache 影响
-
-改变工具可用性会改变其 schema 上下文。工具调用追加普通调用和结果历史,不替换已有消息。
-
-## 已知限制与后续工作
-
-
-
-- **需要调用方 Session** — 此工具需要 Agent,不改变已有进程或写权限。
-
-
-### 开发备注
-
-
-维护工作上下文 — 点击展开
-
-无。
-
-
diff --git a/packages/session/tool-working-directory/locale/de.json b/packages/session/tool-working-directory/locale/de.json
deleted file mode 100644
index e0b0406058..0000000000
--- a/packages/session/tool-working-directory/locale/de.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Arbeitsverzeichnis-Tools",
- "description": "Lesen und ändern Sie das Arbeitsverzeichnis der aktuellen Sitzung."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/en.json b/packages/session/tool-working-directory/locale/en.json
deleted file mode 100644
index e36e12288c..0000000000
--- a/packages/session/tool-working-directory/locale/en.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Working directory tools",
- "description": "Read and change the current session's working directory."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/es.json b/packages/session/tool-working-directory/locale/es.json
deleted file mode 100644
index 9c66b23400..0000000000
--- a/packages/session/tool-working-directory/locale/es.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Herramientas del directorio de trabajo",
- "description": "Lea y cambie el directorio de trabajo de la sesión actual."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/fr.json b/packages/session/tool-working-directory/locale/fr.json
deleted file mode 100644
index 2aea6a9d53..0000000000
--- a/packages/session/tool-working-directory/locale/fr.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Outils du répertoire de travail",
- "description": "Lire et modifier le répertoire de travail de la session en cours."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/ja.json b/packages/session/tool-working-directory/locale/ja.json
deleted file mode 100644
index c52f9760b3..0000000000
--- a/packages/session/tool-working-directory/locale/ja.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "作業ディレクトリツール",
- "description": "現在のセッションの作業ディレクトリを読み取り、変更します。"
- }
-}
diff --git a/packages/session/tool-working-directory/locale/pt.json b/packages/session/tool-working-directory/locale/pt.json
deleted file mode 100644
index d4db416054..0000000000
--- a/packages/session/tool-working-directory/locale/pt.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Ferramentas de diretório de trabalho",
- "description": "Leia e altere o diretório de trabalho da sessão atual."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/ru.json b/packages/session/tool-working-directory/locale/ru.json
deleted file mode 100644
index 74037c4030..0000000000
--- a/packages/session/tool-working-directory/locale/ru.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "Инструменты рабочего каталога",
- "description": "Прочитайте и измените рабочий каталог текущего сеанса."
- }
-}
diff --git a/packages/session/tool-working-directory/locale/zh.json b/packages/session/tool-working-directory/locale/zh.json
deleted file mode 100644
index 2d8865eb23..0000000000
--- a/packages/session/tool-working-directory/locale/zh.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "meta": {
- "title": "工作目录工具",
- "description": "读取和修改当前会话的工作目录。"
- }
-}
diff --git a/packages/session/tool-working-directory/package.json b/packages/session/tool-working-directory/package.json
deleted file mode 100644
index 1366af2e7b..0000000000
--- a/packages/session/tool-working-directory/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "@deepseek-ai/dsh-tool-working-directory",
- "description": "Read and change the active Session working directory",
- "version": "0.2.2-rc.1",
- "publishConfig": {
- "access": "public"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
- "directory": "packages/session/tool-working-directory"
- },
- "type": "module",
- "main": "lib/index.js",
- "types": "lib/types/index.d.ts",
- "exports": {
- ".": {
- "types": "./lib/types/index.d.ts",
- "default": "./lib/index.js"
- },
- "./src/*": "./src/*",
- "./locale/*.json": "./locale/*.json",
- "./package.json": "./package.json"
- },
- "files": [
- "locale/*.json",
- "lib/index.js",
- "lib/types/**/*.d.ts",
- "lib/types/**/*.d.ts.map",
- "lib/**/*.js.map",
- "src"
- ],
- "license": "MIT",
- "peerDependencies": {
- "@deepseek-ai/cordis": "workspace:~",
- "@deepseek-ai/dsh-tools": "workspace:*",
- "@deepseek-ai/dsh-working-directory": "workspace:*"
- },
- "devDependencies": {
- "@deepseek-ai/cordis": "workspace:~",
- "@deepseek-ai/dsh-tools": "workspace:*",
- "@deepseek-ai/dsh-working-directory": "workspace:*",
- "@deepseek-ai/dsh-agent-loop-testkit": "workspace:*",
- "@deepseek-ai/dsh-fs-local": "workspace:*",
- "@deepseek-ai/dsh-agent-loop": "workspace:*",
- "@deepseek-ai/dsh-llm": "workspace:*",
- "@deepseek-ai/dsh-session": "workspace:*",
- "@deepseek-ai/dsh-session-projection": "workspace:*",
- "@deepseek-ai/dsh-system-prompt": "workspace:*"
- }
-}
diff --git a/packages/session/tool-working-directory/src/index.ts b/packages/session/tool-working-directory/src/index.ts
deleted file mode 100644
index 89022d3e57..0000000000
--- a/packages/session/tool-working-directory/src/index.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Read or change the calling Session's working directory.
- * @module @deepseek-ai/dsh-tool-working-directory
- */
-
-import type { Context } from '@deepseek-ai/cordis'
-import { defineTool, ToolArgsError, ToolContextUnavailableError } from '@deepseek-ai/dsh-tools'
-import type {} from '@deepseek-ai/dsh-working-directory'
-
-/** Cordis plugin name. */
-export const name = 'tool-working-directory'
-/** Services used by the tool. */
-export const inject = ['tools', 'workingDirectory']
-
-/**
- * Register the working-directory tool for this composition.
- * @param ctx - context providing the tool registry and directory owner.
- */
-export function apply(ctx: Context): void {
- ctx.tools.register(defineTool({
- name: 'working_directory',
- description: 'Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.',
- parameters: {
- cd: { type: 'string', description: 'Existing directory to enter. Omit to read the current directory.' },
- },
- output: {
- schema: {
- type: 'object',
- additionalProperties: false,
- properties: { cwd: { type: 'string', required: true, description: 'Current absolute working directory.' } },
- },
- render: (_args, value) => [{ type: 'text', text: value.cwd }],
- },
- async execute(args, exec) {
- if (exec.agent === undefined) throw new ToolContextUnavailableError('working_directory requires an agent Session')
- if (args.cd === '') throw new ToolArgsError(['cd must not be empty; omit it to read the current directory'])
- const cwd = args.cd === undefined
- ? await ctx.workingDirectory.ensure(exec.agent, exec.signal)
- : await ctx.workingDirectory.set(exec.agent, args.cd, exec.signal)
- return { cwd }
- },
- }))
-}
diff --git a/packages/session/tool-working-directory/tsconfig.json b/packages/session/tool-working-directory/tsconfig.json
deleted file mode 100644
index fd834e85e4..0000000000
--- a/packages/session/tool-working-directory/tsconfig.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "rootDir": "src",
- "outDir": "lib/types"
- },
- "include": [
- "src"
- ],
- "references": [
- {
- "path": "../../../vendor/cordis"
- },
- {
- "path": "../../core/tools"
- },
- {
- "path": "../working-directory"
- }
- ]
-}
diff --git a/packages/session/working-directory/README.i18n.yaml b/packages/session/working-directory/README.i18n.yaml
index 20228c41b1..a288819f3a 100644
--- a/packages/session/working-directory/README.i18n.yaml
+++ b/packages/session/working-directory/README.i18n.yaml
@@ -18,8 +18,8 @@
en: e65405026debde7c
zh: e12a648eb10ed16b
/deepseek-ai-dsh-working-directory/understand-the-implementation:
- en: 220bf8657f796659
- zh: 37b887cccd597dad
+ en: 606371537f85d289
+ zh: 231b4d95ed1ba372
/deepseek-ai-dsh-working-directory/further-exploration:
en: eabff683146786c8
zh: 7997dec17802ef64
@@ -30,8 +30,8 @@
en: 6fcebaf8006123ef
zh: 950162891001da33
/deepseek-ai-dsh-working-directory/model-experience/working-directory-context/what-the-model-sees:
- en: 6bb8af74078aa3b8
- zh: 8c4d054cc4013185
+ en: 9a9f7113edc9f15f
+ zh: 56ac4fbd55b73ef0
/deepseek-ai-dsh-working-directory/model-experience/working-directory-context/token-effect:
en: a02a00deaddbccea
zh: b3f216eb7e95f5ce
@@ -39,8 +39,8 @@
en: f5a095acef81df3b
zh: 758796edbc4337fc
/deepseek-ai-dsh-working-directory/known-limitations-and-deferred-work:
- en: 58cca70579607e4e
- zh: 8d64cda409f83369
+ en: 73b943fd56830534
+ zh: 863b6ca8ee736909
/deepseek-ai-dsh-working-directory/known-limitations-and-deferred-work/dev-note:
en: e67f633dc6fe7773
zh: a4b126f9a4eaca6f
diff --git a/packages/session/working-directory/README.md b/packages/session/working-directory/README.md
index 5fd5cfe981..7a6692ecd6 100644
--- a/packages/session/working-directory/README.md
+++ b/packages/session/working-directory/README.md
@@ -41,7 +41,7 @@ Directory validation and publication delegate through `working-directory/access`
Implementation internals — click to expand
-The Session projection owns the effective directory and exposes it in Session observations, so cold readers can use it without activating an Agent; the header continues to identify the original project. A second projection folds the workspace anchors and the root they select from the same event, and `relocate` validates the root and the directory inside it before committing one event that carries `anchor`; `inherit` starts a Session's directories from another Session's, registering the checkout the source works in when the starting directory lies inside it and setting only the directory otherwise. Changes serialize per Session, validate through the filesystem provider, check cancellation and Agent lifetime, commit an event, and queue a user-context notice. If notice queuing fails after commit, the operation returns the committed directory and logs a warning; the next request or resume still receives the required directory context. Prompt assembly validates the current directory before publishing its required context contribution. Existing processes and sandbox grants keep their independent ownership. The [service implementation](src/index.ts) defines the API. Failures are `WorkingDirectoryError` instances: `WORKING_DIRECTORY_INVALID` for an empty or malformed path, including a `relocate` directory outside its root, `WORKING_DIRECTORY_NOT_FOUND` when a requested change names no existing directory, and `WORKING_DIRECTORY_UNAVAILABLE` when neither the current directory nor the original project exists or the service has been disposed.
+The Session projection owns the effective directory and exposes it in Session observations, so cold readers can use it without activating an Agent; the header continues to identify the original project. A second projection folds the workspace root from the same event: every change the service records carries `workspace: true` and moves the root with the directory, while a change without the marker moves only the directory. Changes serialize per Session, validate through the filesystem provider, check cancellation and Agent lifetime, commit an event, and queue a user-context notice. If notice queuing fails after commit, the operation returns the committed directory and logs a warning; the next request or resume still receives the required directory context. Prompt assembly validates the current directory before publishing its required context contribution. Existing processes and sandbox grants keep their independent ownership. The [service implementation](src/index.ts) defines the API. Failures are `WorkingDirectoryError` instances: `WORKING_DIRECTORY_INVALID` for an empty or malformed path, `WORKING_DIRECTORY_NOT_FOUND` when a requested change names no existing directory, and `WORKING_DIRECTORY_UNAVAILABLE` when neither the current directory nor the original project exists or the service has been disposed.
No runtime invariant companion is published because the service reads its only directory state from the Session projection and checks filesystem validity at use.
@@ -65,7 +65,7 @@ No runtime invariant companion is published because the service reads its only d
#### What the model sees
-The current value is `Current working directory: .`, followed by `Workspace root: .` on a second line while the two differ. Each committed change, including automatic recovery, attempts to queue a user-context notice through the ordinary Agent inbox; a change that selects another root ends its notice with ` is now the workspace root.` Cancellation or disposal may discard unadmitted notices; the durable directory remains available to the next request. Directory context stays outside the system prompt and remains enabled when optional runtime context is disabled.
+The current value is `Current working directory: .` Each committed change, including automatic recovery, attempts to queue a user-context notice through the ordinary Agent inbox. Cancellation or disposal may discard unadmitted notices; the durable directory remains available to the next request. Directory context stays outside the system prompt and remains enabled when optional runtime context is disabled.
#### Token effect
@@ -79,9 +79,8 @@ Directory transitions append context without replacing the stable system-prompt
+- **Root without consumers** — besides the subagent manager, which starts a child in its parent's root, `workspaceRoot` has no consumer yet: the sandbox write boundary, the workspace file service, the change recorder, sidebar terminals, `@` file candidates, the skill catalog, project instructions, and the LSP workspace still read the header or the current directory. Connecting them is the deferred work the [workspace-root note](../../../.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md#deferred) lists.
- **Missing original project** — when the current directory and the original project are both unavailable, prompt assembly rejects every model turn, including chat-only turns. The service does not choose or recreate a repository. Restore the original directory, or use SDK `setWorkingDirectory` (`set_working_directory` in Python) or `ctx.workingDirectory.set` to select an existing absolute directory before retrying. Existing shells retain their process-local directories.
-- **Headers recorded by another spelling** — producers now record the original project by its canonical path, but a Session created earlier, or by a client that supplied a symlinked or differently cased path, keeps that spelling as its first anchor while `set` and `relocate` record canonical paths. After such a Session enters another checkout, a `cd` back into the original project by the header's spelling keeps the previous root; recovery registers the canonical original as an anchor once the entered checkout disappears.
-- **Root without consumers** — `workspaceRoot` has no consumer yet: the sandbox write boundary, the workspace file service, the change recorder, sidebar terminals, `@` file candidates, the skill catalog, project instructions, and the LSP workspace still read the header or the current directory. Connecting them is the deferred work the [workspace-root note](../../../.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.md#deferred) lists; `rootOf` alone changes none of their behavior.
### Dev Note
diff --git a/packages/session/working-directory/README.zh.md b/packages/session/working-directory/README.zh.md
index 080d4a27d4..5e13076950 100644
--- a/packages/session/working-directory/README.zh.md
+++ b/packages/session/working-directory/README.zh.md
@@ -41,7 +41,7 @@ kind: "package-reference"
实现细节 — 点击展开
-Session 投影拥有当前目录,并通过 Session observation 暴露它,因此冷态读取方无需激活 Agent 即可使用;header 继续标识原始项目。第二个投影从同一事件折叠工作区锚及其选出的根,`relocate` 在提交一条携带 `anchor` 的事件前验证根及其内部的目录;`inherit` 让一个 Session 的目录从另一个 Session 出发,起始目录位于来源所在的检出目录内时登记该检出目录,否则只设置目录。每个 Session 的变更串行执行,通过文件系统 provider 验证,并检查取消状态与 Agent 生命周期,提交事件后排入用户上下文通知。若提交后通知入队失败,操作仍返回已提交的目录并记录警告;下一次请求或恢复仍会收到必需的目录上下文。提示词组装在发布必需的上下文条目前验证当前目录。已有进程与沙箱授权继续由各自的服务拥有。[服务实现](src/index.ts) 定义 API。失败均为 `WorkingDirectoryError`:路径为空或格式错误时为 `WORKING_DIRECTORY_INVALID`,包括 `relocate` 的目录在其根之外;请求切换到不存在的目录时为 `WORKING_DIRECTORY_NOT_FOUND`;当前目录与原始项目都不存在或服务已释放时为 `WORKING_DIRECTORY_UNAVAILABLE`。
+Session 投影拥有当前目录,并通过 Session observation 暴露它,因此冷态读取方无需激活 Agent 即可使用;header 继续标识原始项目。第二个投影从同一事件折叠出工作区根:服务记录的每次变更都带有 `workspace: true`,根随目录一起移动;不带该标记的变更只移动目录。每个 Session 的变更串行执行,通过文件系统 provider 验证,并检查取消状态与 Agent 生命周期,提交事件后排入用户上下文通知。若提交后通知入队失败,操作仍返回已提交的目录并记录警告;下一次请求或恢复仍会收到必需的目录上下文。提示词组装在发布必需的上下文条目前验证当前目录。已有进程与沙箱授权继续由各自的服务拥有。[服务实现](src/index.ts) 定义 API。失败均为 `WorkingDirectoryError`:路径为空或格式错误时为 `WORKING_DIRECTORY_INVALID`,请求切换到不存在的目录时为 `WORKING_DIRECTORY_NOT_FOUND`,当前目录与原始项目都不存在或服务已释放时为 `WORKING_DIRECTORY_UNAVAILABLE`。
不发布 `./invariant` 伴生模块,因为服务从 Session 投影读取唯一的目录状态,并在使用时检查文件系统有效性。
@@ -65,7 +65,7 @@ Session 投影拥有当前目录,并通过 Session observation 暴露它,因
#### 模型可见内容
-当前值为 `Current working directory: .`,当前目录与工作区根不同时,第二行为 `Workspace root: .`。每次已提交变更(包括自动恢复)都会尝试通过普通 Agent 收件箱排入用户上下文通知;选中另一个根的变更在通知末尾给出 ` is now the workspace root.`。取消或销毁可能丢弃尚未进入请求的通知;持久化目录仍可供下一次请求使用。目录上下文不进入系统提示词,即使可选运行时上下文被禁用,也仍然保留。
+当前值为 `Current working directory: .` 每次已提交变更(包括自动恢复)都会尝试通过普通 Agent 收件箱排入用户上下文通知。取消或销毁可能丢弃尚未进入请求的通知;持久化目录仍可供下一次请求使用。目录上下文不进入系统提示词,即使可选运行时上下文被禁用,也仍然保留。
#### Token 影响
@@ -79,9 +79,8 @@ Session 投影拥有当前目录,并通过 Session observation 暴露它,因
+- **根尚无消费方** — 除子代理管理器让子会话从父会话的根启动之外,`workspaceRoot` 还没有消费方:沙箱写边界、工作区文件服务、变更记录器、侧栏终端、`@` 文件候选、技能目录、项目指令和 LSP 工作区仍然读取 header 或当前目录。接入它们是[工作区根记录](../../../.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md#deferred)列出的后续工作。
- **原始项目缺失** — 当前目录与原始项目均不可用时,提示词组装会拒绝每个模型轮次,包括纯聊天轮次。服务不会另选或重建仓库。请先恢复原始目录,或通过 SDK 的 `setWorkingDirectory`(Python 中为 `set_working_directory`)或 `ctx.workingDirectory.set` 选择现有的绝对目录,再重试。已有 shell 保留各自进程的目录。
-- **以其他拼写记录的 header** — 生产方现在以规范路径记录原始项目,但更早创建的 Session,或由客户端传入符号链接或大小写不同路径的 Session,仍以该拼写作为第一个锚,而 `set` 与 `relocate` 记录的是规范路径。这类 Session 进入另一个检出目录后,以 header 的拼写 `cd` 回原始项目时保留先前的根;进入的检出目录消失时,恢复会把规范的原始项目登记为锚。
-- **根尚无消费方** — `workspaceRoot` 目前没有消费方:沙箱写边界、工作区文件服务、变更记录器、侧栏终端、`@` 文件候选、技能目录、项目指令与 LSP 工作区仍读取 header 或当前目录。接入它们是[工作区根记录](../../../.agents/notes/implemented/architecture/2026-11-03-session-workspace-root.zh.md#deferred)列出的后续工作;仅有 `rootOf` 不改变它们的任何行为。
### 开发备注
diff --git a/packages/session/working-directory/package.json b/packages/session/working-directory/package.json
index 9682f5da41..781fbb01eb 100644
--- a/packages/session/working-directory/package.json
+++ b/packages/session/working-directory/package.json
@@ -53,9 +53,6 @@
"@deepseek-ai/dsh-system-prompt": "workspace:*",
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:*",
"@deepseek-ai/dsh-fs-local": "workspace:*",
- "@deepseek-ai/dsh-tool-testkit": "workspace:*",
- "@deepseek-ai/dsh-tool-working-directory": "workspace:*",
- "@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-error": "workspace:*"
},
"dependencies": {
diff --git a/packages/session/working-directory/src/index.ts b/packages/session/working-directory/src/index.ts
index 84c7ea5b47..b20d7e3053 100644
--- a/packages/session/working-directory/src/index.ts
+++ b/packages/session/working-directory/src/index.ts
@@ -14,7 +14,6 @@ import type { Session } from '@deepseek-ai/dsh-session'
import type { ProjectionHandle } from '@deepseek-ai/dsh-session-projection'
import type {} from '@deepseek-ai/dsh-system-prompt'
import { WorkingDirectoryError } from './error.ts'
-import { within } from './within.ts'
export { WorkingDirectoryError, type WorkingDirectoryErrorCode } from './error.ts'
@@ -57,10 +56,11 @@ declare module '@deepseek-ai/dsh-session/types' {
/** Absolute directory used by subsequent directory-based operations. */
cwd: string
/**
- * Absolute checkout directory this change registers as a workspace anchor of the Session; it contains `cwd`.
- * Present only when the change enters another checkout, such as a created worktree; an ordinary `cd` omits it.
+ * Present when the change moves the Session's workspace: `cwd` is the workspace root from this
+ * event on. The service sets it on every change it records. A change without it, recorded while
+ * the model could move the directory, moves only the current directory.
*/
- anchor?: string
+ workspace?: true
}
}
}
@@ -69,7 +69,7 @@ declare module '@deepseek-ai/dsh-session-projection/types' {
interface SessionProjectionMap {
/** Recorded current directory for Session observations, or null when none is recorded. */
workingDirectory: string | null
- /** Workspace root: the registered anchor containing the current directory, or null when none is recorded. */
+ /** Workspace root: the directory of the last change that moved the workspace, else the original project; null when none is recorded. */
workspaceRoot: string | null
}
}
@@ -80,60 +80,13 @@ export interface Config {
defaultDirectory?: string
}
-/** Options of {@link WorkingDirectoryService.relocate}. */
-export interface RelocateOptions {
- /** Directory to enter inside the new root, absolute or relative to that root; omission enters the root itself. */
- cwd?: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-
-/** Options of {@link WorkingDirectoryService.inherit}. */
-export interface InheritOptions {
- /** Canonical absolute directory the Session starts in, spelled as the service records directories. */
- cwd: string
- /** Cancellation before the durable change. */
- signal?: AbortSignal
-}
-
-/** The committed outcome of {@link WorkingDirectoryService.relocate} and {@link WorkingDirectoryService.inherit}. */
-export interface RelocatedDirectories {
- /**
- * Canonical absolute workspace root the commit selected: the longest registered anchor containing
- * `cwd`. This is the registered root unless a more specific anchor, such as an original project
- * inside it, already contains `cwd`.
- */
- root: string
- /** Canonical absolute current directory inside `root`. */
- cwd: string
-}
-
-/** Workspace anchors and the root they select, folded from the Session log. */
-interface WorkspaceRootState {
- /** The longest registered anchor containing the current directory, or null while no anchor contains it. */
- root: string | null
- /** Registered anchors in registration order; the original project comes first when the header records one. */
- anchors: string[]
-}
-
-/** The longest anchor containing `path`, or undefined when none does. */
-function anchorContaining(anchors: readonly string[], path: string): string | undefined {
- let selected: string | undefined
- for (const anchor of anchors) {
- if (within(anchor, path) && (selected === undefined || anchor.length > selected.length)) selected = anchor
- }
- return selected
-}
-
/**
- * One owner for each Session's effective directory, its workspace root, and their model-visible changes.
+ * One owner for each Session's directory, its workspace root, and their model-visible changes.
*
- * The current directory is the cursor every relative path resolves from. The
- * workspace root is the checkout that cursor is in: the longest registered
- * anchor containing it. Anchors are the original project plus every checkout a
- * {@link relocate} entered, so an ordinary {@link set} inside the root moves
- * only the cursor, a `set` into another anchor switches the root to that
- * anchor, and a `set` outside every anchor moves the cursor and leaves the root.
+ * A Session works in one directory. Relative paths resolve from it, and it is the workspace root that
+ * the write boundary, file views, and discovery follow. Only Host operations move it, through {@link set}
+ * or the recovery of {@link ensure}; every such change moves both. The two differ only in a Session whose
+ * log holds a change without the `workspace` marker.
*/
export class WorkingDirectoryService extends Service {
static inject = ['fs', 'sessionProjections', 'systemPrompt']
@@ -149,7 +102,7 @@ export class WorkingDirectoryService extends Service {
private readonly lifecycle = new AbortController()
private workingDirectoryProjectionHandle!: ProjectionHandle
- private workspaceRootProjectionHandle!: ProjectionHandle
+ private workspaceRootProjectionHandle!: ProjectionHandle
constructor(ctx: Context, config: Config) {
super(ctx, 'workingDirectory')
@@ -161,7 +114,6 @@ export class WorkingDirectoryService extends Service {
protected async [Service.init](): Promise {
const ctx = this.ctx
const directorySchema = zod.string().min(1).refine(isAbsolute).nullable()
- const anchorSchema = zod.string().min(1).refine(isAbsolute)
this.workingDirectoryProjectionHandle = await ctx.sessionProjections.register({
key: 'workingDirectory',
stateVersion: 1,
@@ -173,16 +125,10 @@ export class WorkingDirectoryService extends Service {
this.workspaceRootProjectionHandle = await ctx.sessionProjections.register({
key: 'workspaceRoot',
stateVersion: 1,
- stateSchema: zod.object({ root: directorySchema, anchors: zod.array(anchorSchema) }),
- init: header => header.cwd === undefined ? { root: null, anchors: [] } : { root: header.cwd, anchors: [header.cwd] },
- apply: (state, event) => {
- if (event.type !== 'working-directory/change') return state
- const { cwd, anchor } = event.data
- const anchors = anchor === undefined || state.anchors.includes(anchor) ? state.anchors : [...state.anchors, anchor]
- const root = anchorContaining(anchors, cwd) ?? state.root
- return root === state.root && anchors === state.anchors ? state : { root, anchors }
- },
- wire: { viewSchema: directorySchema, view: state => state.root },
+ stateSchema: directorySchema,
+ init: header => header.cwd ?? null,
+ apply: (state, event) => event.type === 'working-directory/change' && event.data.workspace === true ? event.data.cwd : state,
+ wire: { viewSchema: directorySchema, view: state => state },
})
ctx.systemPrompt.context({
name: 'working-directory:current',
@@ -223,29 +169,19 @@ export class WorkingDirectoryService extends Service {
/**
* Read the committed workspace root without filesystem I/O.
* @param session - Session whose root is requested.
- * @returns the registered anchor containing the current directory, or the deployment default when none is recorded.
+ * @returns the directory of the last change that moved the workspace, the original project before any,
+ * or the deployment default when none is recorded.
*/
rootOf(session: Session): string {
- return this.workspaceRootProjectionHandle.stateOf(session).root ?? this.defaultDirectory
- }
-
- /**
- * Read the registered workspace anchors without filesystem I/O.
- * @param session - Session whose anchors are requested.
- * @returns anchors in registration order, the original project first when the header records one.
- */
- anchorsOf(session: Session): readonly string[] {
- return this.workspaceRootProjectionHandle.stateOf(session).anchors
+ return this.workspaceRootProjectionHandle.stateOf(session) ?? this.defaultDirectory
}
/**
* Validate the current directory and restore the original project when it disappeared.
* @param agent - live or unpublished Agent owning the Session.
* @param signal - cancellation for filesystem inspection.
- * @returns the existing directory; recovery is committed before fulfillment.
- * A Session without a recorded project records the deployment fallback as its first anchor on its
- * first validation, and a recovery destination outside every anchor joins the anchors.
- * A notice failure is warned without reverting the committed state.
+ * @returns the existing directory; recovery is committed before fulfillment and moves the workspace
+ * root with the directory. A notice failure is warned without reverting the committed state.
* @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_UNAVAILABLE` when the original project is also
* unavailable or the service is disposed, or the rejection of a `working-directory/access` listener.
*/
@@ -258,10 +194,7 @@ export class WorkingDirectoryService extends Service {
agent.ctx.fiber.assertActive()
if (info?.type === 'directory') {
if (this.workingDirectoryProjectionHandle.stateOf(agent.session) === null) {
- // A Session without a recorded project records the deployment fallback as its first anchor.
- const fallback = this.ctx.fs.processPath(target)
- agent.session.append('working-directory/change', { cwd: fallback, anchor: fallback })
- return fallback
+ agent.session.append('working-directory/change', { cwd: current, workspace: true })
}
return current
}
@@ -270,18 +203,15 @@ export class WorkingDirectoryService extends Service {
`working-directory: directory does not exist: ${JSON.stringify(original)}; the current working directory ${JSON.stringify(current)} is also unavailable`,
'WORKING_DIRECTORY_UNAVAILABLE',
))
- // A destination no anchor contains, such as a header recorded by another spelling, becomes one.
- const anchor = anchorContaining(this.anchorsOf(agent.session), restored) === undefined ? restored : undefined
- this.commit(agent, restored, true, control, anchor)
+ this.commit(agent, restored, true, control)
return restored
}))
}
/**
- * Change one Session's directory without changing existing processes or permissions.
- * The workspace root follows the registered anchors: a path inside the current
- * root keeps it, a path inside another anchor selects that anchor, and a path
- * outside every anchor leaves the root unchanged.
+ * Move one Session's workspace: its current directory and its workspace root become `path`.
+ * Existing processes keep their directories. Callers are Host operations that chose the
+ * directory; a model-supplied path would move the workspace-write boundary with it.
* @param agent - live or unpublished Agent owning the Session.
* @param path - absolute path or a path relative to its current directory.
* @param signal - cancellation before the durable change.
@@ -293,77 +223,15 @@ export class WorkingDirectoryService extends Service {
*/
set(agent: Agent, path: string, signal?: AbortSignal): Promise {
return this.serialize(agent, signal, control => this.ctx.waterfall('working-directory/access', { agent, path, signal: control }, async () => {
- if (path.length === 0) throw new WorkingDirectoryError('working-directory: cd must not be empty', 'WORKING_DIRECTORY_INVALID')
+ if (path.length === 0) throw new WorkingDirectoryError('working-directory: path must not be empty', 'WORKING_DIRECTORY_INVALID')
const directory = await this.directory(path, this.get(agent.session), control)
this.commit(agent, directory, false, control)
return directory
}))
}
- /**
- * Enter another checkout: register `root` as a workspace anchor of the Session and
- * move its current directory to `options.cwd`, or to the root itself. One committed
- * event carries both; existing processes and permissions are unchanged.
- * @param agent - live or unpublished Agent owning the Session.
- * @param root - absolute checkout directory, or a path relative to the current directory.
- * @param options - directory to enter inside the root and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit;
- * the registered root is that root unless a more specific anchor already contains the directory.
- * A notice failure is warned; the next request still receives the committed directories.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_INVALID` for an empty path or a directory outside
- * the root and `WORKING_DIRECTORY_NOT_FOUND` when either path is not an existing directory.
- */
- relocate(agent: Agent, root: string, options: RelocateOptions = {}): Promise {
- return this.serialize(agent, options.signal, async (control) => {
- if (root.length === 0) throw new WorkingDirectoryError('working-directory: root must not be empty', 'WORKING_DIRECTORY_INVALID')
- if (options.cwd !== undefined && options.cwd.length === 0) {
- throw new WorkingDirectoryError('working-directory: cwd must not be empty', 'WORKING_DIRECTORY_INVALID')
- }
- const anchor = await this.directory(root, this.get(agent.session), control)
- const cwd = options.cwd === undefined ? anchor : await this.directory(options.cwd, anchor, control)
- if (!within(anchor, cwd)) {
- throw new WorkingDirectoryError(
- `working-directory: ${JSON.stringify(cwd)} lies outside the workspace root ${JSON.stringify(anchor)}`, 'WORKING_DIRECTORY_INVALID',
- )
- }
- if (agent.session.header.cwd === undefined && this.anchorsOf(agent.session).length === 0) {
- // The deployment fallback is the recovery destination; registering it first lets leaving the checkout select it.
- const fallback = await this.directory(this.defaultDirectory, this.defaultDirectory, control)
- agent.session.append('working-directory/change', { cwd: this.get(agent.session), anchor: fallback })
- }
- this.commit(agent, cwd, false, control, anchor)
- return { root: this.rootOf(agent.session), cwd }
- })
- }
-
- /**
- * Start a Session's directories from another Session's. When `source` works in a registered checkout
- * other than the starting Session's own original project and `options.cwd` lies inside that checkout,
- * the checkout is registered as the starting Session's anchor and `cwd` entered through {@link relocate};
- * otherwise only the current directory is set through {@link set}. Only the source's current root is
- * passed on, never its other anchors, and later changes to `source` do not reach the starting Session.
- * @param agent - live or unpublished Agent owning the Session that starts.
- * @param source - Session whose current root may be passed on; the call leaves it unchanged.
- * @param options - canonical absolute directory to start in and cancellation before the durable change.
- * @returns the committed current directory and the workspace root selected after the commit.
- * @throws {@link WorkingDirectoryError} `WORKING_DIRECTORY_NOT_FOUND` when `options.cwd` is not an existing
- * directory, or the rejection of a `working-directory/access` listener.
- */
- async inherit(agent: Agent, source: Session, options: InheritOptions): Promise {
- const root = this.rootOf(source)
- // The deployment fallback a source without a recorded project reports is no anchor, and the starting
- // Session's own original project is registered already.
- const checkout = this.anchorsOf(source).includes(root) && root !== agent.session.header.cwd && within(root, options.cwd)
- if (checkout) return this.relocate(agent, root, options)
- const cwd = await this.set(agent, options.cwd, options.signal)
- return { root: this.rootOf(agent.session), cwd }
- }
-
private contextText(session: Session): string {
- const cwd = this.get(session)
- const root = this.rootOf(session)
- const current = `Current working directory: ${JSON.stringify(cwd)}.`
- return root === cwd ? current : `${current}\nWorkspace root: ${JSON.stringify(root)}.`
+ return `Current working directory: ${JSON.stringify(this.get(session))}.`
}
private async directory(
@@ -382,25 +250,21 @@ export class WorkingDirectoryService extends Service {
return this.ctx.fs.processPath(target)
}
- private commit(agent: Agent, directory: string, recovered: boolean, signal: AbortSignal, anchor?: string): void {
+ private commit(agent: Agent, directory: string, recovered: boolean, signal: AbortSignal): void {
signal.throwIfAborted()
agent.ctx.fiber.assertActive()
- const session = agent.session
- const previous = this.get(session)
- const previousRoot = this.rootOf(session)
- if (previous === directory && (anchor === undefined || this.anchorsOf(session).includes(anchor))) return
- session.append('working-directory/change', { cwd: directory, ...anchor === undefined ? {} : { anchor } })
- const root = this.rootOf(session)
- const rootChange = root === previousRoot ? '' : `${JSON.stringify(root)} is now the workspace root.`
- const directoryChange = previous === directory
- ? ''
- : recovered
- ? `The working directory ${JSON.stringify(previous)} is unavailable. The working directory is now ${JSON.stringify(directory)}.`
- : `The working directory changed from ${JSON.stringify(previous)} to ${JSON.stringify(directory)}.`
- const text = [directoryChange, rootChange].filter(part => part !== '').join(' ')
- if (text === '') return
+ const previous = this.get(agent.session)
+ if (previous === directory && this.rootOf(agent.session) === directory) return
+ agent.session.append('working-directory/change', { cwd: directory, workspace: true })
+ // Only the root moved: the directory was recorded by a change without the workspace marker.
+ if (previous === directory) return
const notice = createUserMessage({
- content: [{ type: 'text', text }],
+ content: [{
+ type: 'text',
+ text: recovered
+ ? `The working directory ${JSON.stringify(previous)} is unavailable. The working directory is now ${JSON.stringify(directory)}.`
+ : `The working directory changed from ${JSON.stringify(previous)} to ${JSON.stringify(directory)}.`,
+ }],
source: { kind: 'working-directory' },
})
try {
diff --git a/packages/session/working-directory/src/within.ts b/packages/session/working-directory/src/within.ts
deleted file mode 100644
index 9e94367d9c..0000000000
--- a/packages/session/working-directory/src/within.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Lexical path containment shared by the working-directory service and its tests.
- * @module @deepseek-ai/dsh-working-directory/within
- */
-import { isAbsolute, relative, sep } from 'node:path'
-
-/**
- * Whether `path` is `root` or lies below it. Both paths are canonical absolute
- * paths of one execution world; the test is lexical and never touches the filesystem.
- * @param root - canonical absolute directory.
- * @param path - canonical absolute path to test.
- * @returns true for `root` itself and every path below it.
- */
-export function within(root: string, path: string): boolean {
- const rest = relative(root, path)
- return rest === '' || (rest !== '..' && !rest.startsWith(`..${sep}`) && !isAbsolute(rest))
-}
diff --git a/packages/session/working-directory/tests/working-directory.spec.ts b/packages/session/working-directory/tests/working-directory.spec.ts
index 1905cae639..a75af5377d 100644
--- a/packages/session/working-directory/tests/working-directory.spec.ts
+++ b/packages/session/working-directory/tests/working-directory.spec.ts
@@ -1,4 +1,3 @@
-import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import { mkdtemp, mkdir, realpath, rm, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
@@ -9,9 +8,7 @@ import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
import WorkingDirectory, { type Config as WorkingDirectoryConfig } from '@deepseek-ai/dsh-working-directory'
import { mountAgentLoopTestDependencies, mountAgentLoopTestHarness } from '@deepseek-ai/dsh-agent-loop-testkit'
import { SessionId } from '@deepseek-ai/dsh-session'
-import { ToolCallId } from '@deepseek-ai/dsh-llm'
import { renderContextSnapshot, renderPrompt } from '@deepseek-ai/dsh-system-prompt'
-import * as WorkingDirectoryTool from '@deepseek-ai/dsh-tool-working-directory'
async function fixture(config?: (root: string) => WorkingDirectoryConfig) {
const root = await realpath(await mkdtemp(join(tmpdir(), 'dsh-working-directory-')))
@@ -48,7 +45,7 @@ describe('Session working directories', () => {
expect(f.ctx.workingDirectory.get(sibling.session)).toBe(f.root)
expect(f.agent.session.header.cwd).toBe(f.root)
expect(f.agent.session.snapshotEvents()).toContainEqual(expect.objectContaining({
- type: 'working-directory/change', data: { cwd: child },
+ type: 'working-directory/change', data: { cwd: child, workspace: true },
}))
const messages = f.harness.claim(f.agent, 'next-step', 1)
expect(messages).toEqual([expect.objectContaining({
@@ -128,7 +125,7 @@ describe('Session working directories', () => {
await writeFile(join(f.root, 'file'), '')
await expect(f.ctx.workingDirectory.set(f.agent, 'file')).rejects.toThrow('directory does not exist')
await expect(f.ctx.workingDirectory.set(f.agent, 'file')).rejects.toMatchObject({ name: 'WorkingDirectoryError', code: 'WORKING_DIRECTORY_NOT_FOUND' })
- await expect(f.ctx.workingDirectory.set(f.agent, '')).rejects.toThrow('cd must not be empty')
+ await expect(f.ctx.workingDirectory.set(f.agent, '')).rejects.toThrow('path must not be empty')
await expect(f.ctx.workingDirectory.set(f.agent, '')).rejects.toMatchObject({ name: 'WorkingDirectoryError', code: 'WORKING_DIRECTORY_INVALID' })
const controller = new AbortController()
controller.abort(new Error('cancelled directory change'))
@@ -159,13 +156,11 @@ describe('Session working directories', () => {
it('uses and records the configured launch fallback for a Session without origin metadata', async () => {
await using f = await fixture()
const agent = await f.harness.create(SessionId('without-origin'))
- // The first validation records the canonical fallback as the Session's first anchor.
- const fallback = await realpath(f.ctx.workingDirectory.defaultDirectory)
+ const fallback = f.ctx.workingDirectory.defaultDirectory
await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(fallback)
expect(agent.session.snapshotEvents()).toContainEqual(expect.objectContaining({
- type: 'working-directory/change', data: { cwd: fallback, anchor: fallback },
+ type: 'working-directory/change', data: { cwd: fallback, workspace: true },
}))
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([fallback])
})
it('rejects a relative deployment default before accepting Sessions', async () => {
@@ -241,7 +236,7 @@ describe('Session working directories', () => {
await rejection
await expect(queued).resolves.toBe(join(f.root, 'second'))
expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: join(f.root, 'second') } })])
+ .toEqual([expect.objectContaining({ data: { cwd: join(f.root, 'second'), workspace: true } })])
expect(f.harness.claim(f.agent, 'next-step', 1)).toHaveLength(1)
} finally {
release.resolve(undefined)
@@ -351,30 +346,4 @@ describe('Session working directories', () => {
}
})
- it('exposes reading and changing through the same model tool and unregisters it on disposal', async () => {
- await using f = await fixture()
- await mkdir(join(f.root, 'child'))
- const fiber = f.ctx.plugin(WorkingDirectoryTool)
- await fiber
- const execute = (arguments_: { cd?: string }, withAgent = true) => executeToolFixture(f.ctx, {
- name: 'working_directory', callId: ToolCallId('directory-call'), arguments: arguments_,
- signal: new AbortController().signal, ...withAgent ? { agent: f.agent } : {},
- })
- expect(await execute({})).toMatchObject({ value: { cwd: f.root }, isError: false })
- expect(await execute({ cd: 'child' })).toMatchObject({ value: { cwd: join(f.root, 'child') }, isError: false })
- expect(await execute({}, false)).toMatchObject({
- isError: true,
- error: { info: { name: 'ToolContextUnavailableError', code: 'TOOL_CONTEXT_UNAVAILABLE' } },
- })
- expect(await execute({ cd: '' })).toMatchObject({
- isError: true,
- error: { info: { name: 'ToolArgsError', code: 'INVALID_ARGS' } },
- })
- expect(await execute({ cd: 'missing' })).toMatchObject({
- isError: true,
- error: { info: { name: 'WorkingDirectoryError', code: 'WORKING_DIRECTORY_NOT_FOUND' } },
- })
- await fiber.dispose()
- expect(f.ctx.tools.schemas().some(tool => tool.name === 'working_directory')).toBe(false)
- })
})
diff --git a/packages/session/working-directory/tests/workspace-root.spec.ts b/packages/session/working-directory/tests/workspace-root.spec.ts
index fad008c736..f959989c82 100644
--- a/packages/session/working-directory/tests/workspace-root.spec.ts
+++ b/packages/session/working-directory/tests/workspace-root.spec.ts
@@ -1,4 +1,4 @@
-/** Workspace roots: anchors registered by relocation, the root the cursor selects, and the context both reach the model through. */
+/** Workspace roots: the root every recorded change moves with the directory, and the directory-only changes of earlier logs. */
import { mkdtemp, mkdir, realpath, rm, symlink } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { dirname, join } from 'node:path'
@@ -9,7 +9,6 @@ import WorkingDirectory from '@deepseek-ai/dsh-working-directory'
import { mountAgentLoopTestDependencies, mountAgentLoopTestHarness } from '@deepseek-ai/dsh-agent-loop-testkit'
import { SessionId } from '@deepseek-ai/dsh-session'
import { renderContextSnapshot } from '@deepseek-ai/dsh-system-prompt'
-import { within } from '../src/within.ts'
async function fixture() {
const scratch = await realpath(await mkdtemp(join(tmpdir(), 'dsh-workspace-root-')))
@@ -17,7 +16,6 @@ async function fixture() {
const worktree = join(scratch, 'elsewhere', 'wt')
const outside = join(scratch, 'outside')
await mkdir(join(root, 'packages', 'foo'), { recursive: true })
- await mkdir(join(root, '.agents', 'worktrees', 'nested', 'src'), { recursive: true })
await mkdir(join(worktree, 'src'), { recursive: true })
await mkdir(outside)
const ctx = new Context()
@@ -28,7 +26,7 @@ async function fixture() {
const harness = await mountAgentLoopTestHarness(ctx)
const agent = await harness.create(SessionId('root-owner'), {}, { cwd: root })
return {
- ctx, root, worktree, outside, nested: join(root, '.agents', 'worktrees', 'nested'), agent, harness,
+ ctx, root, worktree, outside, agent, harness,
notices: () => harness.claim(agent, 'next-step', 1).map(message => message.content.map(block => block.type === 'text' ? block.text : '').join('')),
context: async () => renderContextSnapshot(await ctx.systemPrompt.assemble({ agent, scope: agent })),
async [Symbol.asyncDispose]() {
@@ -43,267 +41,122 @@ async function fixture() {
}
}
+/** Text of the notices one Agent has queued for its next step. */
+function noticesOf(f: Awaited>, agent: Awaited>['agent']): string[] {
+ return f.harness.claim(agent, 'next-step', 1).map(message => message.content.map(block => block.type === 'text' ? block.text : '').join(''))
+}
+
describe('Session workspace roots', () => {
- it('starts with the original project as the only anchor and root', async () => {
+ it('starts with the original project as the workspace root', async () => {
await using f = await fixture()
expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- expect(f.ctx.workingDirectory.anchorsOf(f.agent.session)).toEqual([f.root])
expect(f.ctx.sessionProjections.snapshot(f.agent.session).values.workspaceRoot).toBe(f.root)
expect(await f.context()).toContain(`Current working directory: ${JSON.stringify(f.root)}.`)
- expect(await f.context()).not.toContain('Workspace root:')
})
- it('moves only the cursor inside the root and reports both to the model', async () => {
+ it('moves the directory and the root together with one marked change per move', async () => {
await using f = await fixture()
- const foo = join(f.root, 'packages', 'foo')
- await f.ctx.workingDirectory.set(f.agent, 'packages/foo')
- expect(f.ctx.workingDirectory.get(f.agent.session)).toBe(foo)
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- expect(f.notices()).toEqual([`The working directory changed from ${JSON.stringify(f.root)} to ${JSON.stringify(foo)}.`])
- expect(await f.context()).toContain(`Current working directory: ${JSON.stringify(foo)}.\nWorkspace root: ${JSON.stringify(f.root)}.`)
- expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: foo } })])
- })
-
- it('leaves the root behind when the cursor goes outside every anchor', async () => {
- await using f = await fixture()
- await f.ctx.workingDirectory.set(f.agent, f.outside)
- expect(f.ctx.workingDirectory.get(f.agent.session)).toBe(f.outside)
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- expect(f.notices()).toEqual([`The working directory changed from ${JSON.stringify(f.root)} to ${JSON.stringify(f.outside)}.`])
- expect(await f.context()).toContain(`Workspace root: ${JSON.stringify(f.root)}.`)
- })
-
- it('relocates into another checkout with one event, then returns to the original project through an ordinary change', async () => {
- await using f = await fixture()
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.worktree)).resolves.toEqual({ root: f.worktree, cwd: f.worktree })
+ await expect(f.ctx.workingDirectory.set(f.agent, f.worktree)).resolves.toBe(f.worktree)
+ expect(f.ctx.workingDirectory.get(f.agent.session)).toBe(f.worktree)
expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.worktree)
- expect(f.ctx.workingDirectory.anchorsOf(f.agent.session)).toEqual([f.root, f.worktree])
expect(f.ctx.sessionProjections.snapshot(f.agent.session).values.workspaceRoot).toBe(f.worktree)
- expect(f.notices()).toEqual([
- `The working directory changed from ${JSON.stringify(f.root)} to ${JSON.stringify(f.worktree)}. ${JSON.stringify(f.worktree)} is now the workspace root.`,
- ])
- expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: f.worktree, anchor: f.worktree } })])
- expect(await f.context()).not.toContain('Workspace root:')
+ expect(f.notices()).toEqual([`The working directory changed from ${JSON.stringify(f.root)} to ${JSON.stringify(f.worktree)}.`])
- await f.ctx.workingDirectory.set(f.agent, 'src')
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.worktree)
- expect(f.notices()).toEqual([`The working directory changed from ${JSON.stringify(f.worktree)} to ${JSON.stringify(join(f.worktree, 'src'))}.`])
-
- await f.ctx.workingDirectory.set(f.agent, f.root)
+ await expect(f.ctx.workingDirectory.set(f.agent, f.outside)).resolves.toBe(f.outside)
+ expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.outside)
+ await expect(f.ctx.workingDirectory.set(f.agent, f.root)).resolves.toBe(f.root)
expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- expect(f.ctx.workingDirectory.anchorsOf(f.agent.session)).toEqual([f.root, f.worktree])
- expect(f.notices()).toEqual([
- `The working directory changed from ${JSON.stringify(join(f.worktree, 'src'))} to ${JSON.stringify(f.root)}. ${JSON.stringify(f.root)} is now the workspace root.`,
+ expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change').map(event => event.data)).toEqual([
+ { cwd: f.worktree, workspace: true },
+ { cwd: f.outside, workspace: true },
+ { cwd: f.root, workspace: true },
])
+ expect(await f.context()).toContain(`Current working directory: ${JSON.stringify(f.root)}.`)
})
- it('selects the longest anchor when checkouts nest and enters a directory inside the new root', async () => {
+ it('records nothing for a move to the current workspace', async () => {
await using f = await fixture()
- const src = join(f.nested, 'src')
- await expect(f.ctx.workingDirectory.relocate(f.agent, '.agents/worktrees/nested', { cwd: 'src' })).resolves.toEqual({ root: f.nested, cwd: src })
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.nested)
- expect(f.notices()).toEqual([
- `The working directory changed from ${JSON.stringify(f.root)} to ${JSON.stringify(src)}. ${JSON.stringify(f.nested)} is now the workspace root.`,
- ])
- expect(await f.context()).toContain(`Current working directory: ${JSON.stringify(src)}.\nWorkspace root: ${JSON.stringify(f.nested)}.`)
- await f.ctx.workingDirectory.set(f.agent, join(f.root, 'packages'))
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- })
-
- it('registers an anchor without moving the cursor and ignores a repeated anchor', async () => {
- await using f = await fixture()
- const src = join(f.nested, 'src')
- await f.ctx.workingDirectory.set(f.agent, src)
- f.notices()
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.nested, { cwd: src })).resolves.toEqual({ root: f.nested, cwd: src })
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.nested)
- expect(f.notices()).toEqual([`${JSON.stringify(f.nested)} is now the workspace root.`])
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.nested, { cwd: src })).resolves.toEqual({ root: f.nested, cwd: src })
+ await expect(f.ctx.workingDirectory.set(f.agent, f.root)).resolves.toBe(f.root)
+ expect(f.agent.session.snapshotEvents().some(event => event.type === 'working-directory/change')).toBe(false)
expect(f.notices()).toEqual([])
- expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change')).toHaveLength(2)
})
- it('records an enclosing anchor that changes neither the cursor nor the root without a notice', async () => {
+ it('returns the directory and the root to the original project when the workspace disappears', async () => {
await using f = await fixture()
- const packages = join(f.root, 'packages')
- const agent = await f.harness.create(SessionId('enclosed-origin'), {}, { cwd: packages })
- // The enclosing anchor is registered, but the original project stays the longest anchor containing the cursor.
- await expect(f.ctx.workingDirectory.relocate(agent, f.root, { cwd: packages })).resolves.toEqual({ root: packages, cwd: packages })
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(packages)
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([packages, f.root])
- expect(f.harness.claim(agent, 'next-step', 1)).toEqual([])
- expect(agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: packages, anchor: f.root } })])
- await f.ctx.workingDirectory.set(agent, f.root)
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.root)
- })
-
- it('rejects a relocation whose directory lies outside the root, a missing root, and empty paths without committing', async () => {
- await using f = await fixture()
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.worktree, { cwd: f.outside })).rejects.toThrow('lies outside the workspace root')
- await expect(f.ctx.workingDirectory.relocate(f.agent, join(f.root, 'missing'))).rejects.toThrow('directory does not exist')
- await expect(f.ctx.workingDirectory.relocate(f.agent, '')).rejects.toThrow('root must not be empty')
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.worktree, { cwd: '' })).rejects.toThrow('cwd must not be empty')
- const controller = new AbortController()
- controller.abort(new Error('cancelled relocation'))
- await expect(f.ctx.workingDirectory.relocate(f.agent, f.worktree, { signal: controller.signal })).rejects.toThrow('cancelled relocation')
- expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
- expect(f.ctx.workingDirectory.anchorsOf(f.agent.session)).toEqual([f.root])
- expect(f.agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change')).toEqual([])
- })
-
- it('returns root and cursor to the original project when the entered checkout disappears', async () => {
- await using f = await fixture()
- await f.ctx.workingDirectory.relocate(f.agent, f.worktree, { cwd: 'src' })
+ await f.ctx.workingDirectory.set(f.agent, join(f.worktree, 'src'))
f.notices()
await rm(f.worktree, { recursive: true })
await expect(f.ctx.workingDirectory.ensure(f.agent)).resolves.toBe(f.root)
expect(f.ctx.workingDirectory.rootOf(f.agent.session)).toBe(f.root)
expect(f.notices()).toEqual([
- `The working directory ${JSON.stringify(join(f.worktree, 'src'))} is unavailable. The working directory is now ${JSON.stringify(f.root)}. ${JSON.stringify(f.root)} is now the workspace root.`,
+ `The working directory ${JSON.stringify(join(f.worktree, 'src'))} is unavailable. The working directory is now ${JSON.stringify(f.root)}.`,
])
})
- it('restores anchors and root from the log and from a log without anchors', async () => {
+ it('restores the root from the log, and a change without the marker moves only the directory', async () => {
await using f = await fixture()
- await f.ctx.workingDirectory.relocate(f.agent, f.worktree, { cwd: 'src' })
+ await f.ctx.workingDirectory.set(f.agent, f.worktree)
const restored = f.ctx.sessions.create(SessionId('restored'), { meta: { cwd: f.root }, seed: f.agent.session.snapshotEvents() })
expect(f.ctx.workingDirectory.rootOf(restored)).toBe(f.worktree)
- expect(f.ctx.workingDirectory.anchorsOf(restored)).toEqual([f.root, f.worktree])
expect(f.ctx.sessionProjections.snapshot(restored).values.workspaceRoot).toBe(f.worktree)
- const legacy = f.ctx.sessions.create(SessionId('legacy'), { meta: { cwd: f.root } })
- legacy.append('working-directory/change', { cwd: join(f.worktree, 'src') })
- expect(f.ctx.workingDirectory.get(legacy)).toBe(join(f.worktree, 'src'))
- expect(f.ctx.workingDirectory.rootOf(legacy)).toBe(f.root)
- expect(f.ctx.workingDirectory.anchorsOf(legacy)).toEqual([f.root])
+
+ const unmarked = f.ctx.sessions.create(SessionId('unmarked'), { meta: { cwd: f.root } })
+ unmarked.append('working-directory/change', { cwd: join(f.worktree, 'src') })
+ expect(f.ctx.workingDirectory.get(unmarked)).toBe(join(f.worktree, 'src'))
+ expect(f.ctx.workingDirectory.rootOf(unmarked)).toBe(f.root)
+ expect(f.ctx.sessionProjections.snapshot(unmarked).values.workspaceRoot).toBe(f.root)
})
- it('falls back to the deployment default for a Session without origin metadata until it relocates', async () => {
+ it('moves the root onto a directory recorded without the marker, without a notice', async () => {
+ await using f = await fixture()
+ const agent = await f.harness.create(SessionId('unmarked-owner'), {}, { cwd: f.root })
+ agent.session.append('working-directory/change', { cwd: f.worktree })
+ await expect(f.ctx.workingDirectory.set(agent, f.worktree)).resolves.toBe(f.worktree)
+ expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.worktree)
+ expect(agent.session.snapshotEvents().filter(event => event.type === 'working-directory/change').map(event => event.data)).toEqual([
+ { cwd: f.worktree },
+ { cwd: f.worktree, workspace: true },
+ ])
+ expect(noticesOf(f, agent)).toEqual([])
+
+ await f.ctx.workingDirectory.set(agent, f.root)
+ expect(f.ctx.workingDirectory.get(agent.session)).toBe(f.root)
+ expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.root)
+ })
+
+ it('uses the deployment default as the root of a Session without origin metadata until a change is recorded', async () => {
await using f = await fixture()
const agent = await f.harness.create(SessionId('without-origin'))
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.ctx.workingDirectory.defaultDirectory)
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([])
- expect(f.ctx.sessionProjections.snapshot(agent.session).values.workspaceRoot).toBeNull()
- // Relocation registers the deployment fallback first, so leaving the checkout later selects it.
- const fallback = await realpath(f.ctx.workingDirectory.defaultDirectory)
- await f.ctx.workingDirectory.relocate(agent, f.worktree)
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.worktree)
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([fallback, f.worktree])
- })
-
- it('registers the deployment fallback of a Session without origin metadata as its first anchor and returns to it', async () => {
- await using f = await fixture()
- const agent = await f.harness.create(SessionId('without-origin-recovery'))
- const fallback = await realpath(f.ctx.workingDirectory.defaultDirectory)
- await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(fallback)
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([fallback])
+ const fallback = f.ctx.workingDirectory.defaultDirectory
expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(fallback)
- await f.ctx.workingDirectory.relocate(agent, f.worktree, { cwd: 'src' })
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([fallback, f.worktree])
+ expect(f.ctx.sessionProjections.snapshot(agent.session).values.workspaceRoot).toBeNull()
+ await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(fallback)
+ expect(f.ctx.sessionProjections.snapshot(agent.session).values.workspaceRoot).toBe(fallback)
+
+ await f.ctx.workingDirectory.set(agent, join(f.worktree, 'src'))
f.harness.claim(agent, 'next-step', 1)
await rm(f.worktree, { recursive: true })
- await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(fallback)
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(fallback)
- expect(f.ctx.workingDirectory.get(agent.session)).toBe(fallback)
+ await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(await realpath(fallback))
+ expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(await realpath(fallback))
})
- it('recovers a Session whose header spells the original project through a symlink onto the canonical project', async () => {
+ it('records the canonical project when a Session whose header spells it through a symlink returns or recovers', async () => {
await using f = await fixture()
const link = join(dirname(f.root), 'link')
await symlink(f.root, link)
const agent = await f.harness.create(SessionId('linked-origin'), {}, { cwd: link })
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([link])
- await f.ctx.workingDirectory.relocate(agent, f.worktree, { cwd: 'src' })
+ expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(link)
+ await f.ctx.workingDirectory.set(agent, f.worktree)
+ await expect(f.ctx.workingDirectory.set(agent, link)).resolves.toBe(f.root)
+ expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.root)
+
+ await f.ctx.workingDirectory.set(agent, join(f.worktree, 'src'))
f.harness.claim(agent, 'next-step', 1)
await rm(f.worktree, { recursive: true })
- // The recovery destination is canonical and no anchor contains it, so it joins the anchors and becomes the root.
await expect(f.ctx.workingDirectory.ensure(agent)).resolves.toBe(f.root)
expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.root)
- expect(f.ctx.workingDirectory.anchorsOf(agent.session)).toEqual([link, f.worktree, f.root])
- expect(f.harness.claim(agent, 'next-step', 1).map(message => message.content.map(block => block.type === 'text' ? block.text : '').join(''))).toEqual([
- `The working directory ${JSON.stringify(join(f.worktree, 'src'))} is unavailable. The working directory is now ${JSON.stringify(f.root)}. ${JSON.stringify(f.root)} is now the workspace root.`,
+ expect(noticesOf(f, agent)).toEqual([
+ `The working directory ${JSON.stringify(join(f.worktree, 'src'))} is unavailable. The working directory is now ${JSON.stringify(f.root)}.`,
])
})
-
- it('keeps the previous root when a Session with a symlinked header returns to the original project by that spelling', async () => {
- await using f = await fixture()
- const link = join(dirname(f.root), 'link-return')
- await symlink(f.root, link)
- const agent = await f.harness.create(SessionId('linked-origin-return'), {}, { cwd: link })
- await f.ctx.workingDirectory.relocate(agent, f.worktree)
- // Documented limitation: the canonical project is not an anchor until recovery registers it.
- await expect(f.ctx.workingDirectory.set(agent, link)).resolves.toBe(f.root)
- expect(f.ctx.workingDirectory.rootOf(agent.session)).toBe(f.worktree)
- })
-
- it('passes the checkout a source works in on to a Session starting inside it, and only the directory otherwise', async () => {
- await using f = await fixture()
- const src = join(f.worktree, 'src')
- await f.ctx.workingDirectory.relocate(f.agent, f.worktree, { cwd: src })
- // Starting inside the source's checkout registers it; the child header still records the original project.
- const inside = await f.harness.create(SessionId('inherits-checkout'), {}, { cwd: f.root })
- await expect(f.ctx.workingDirectory.inherit(inside, f.agent.session, { cwd: src }))
- .resolves.toEqual({ root: f.worktree, cwd: src })
- expect(f.ctx.workingDirectory.anchorsOf(inside.session)).toEqual([f.root, f.worktree])
- expect(inside.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: src, anchor: f.worktree } })])
- // Starting outside the source's checkout sets the directory and keeps the original project as the root.
- const outside = await f.harness.create(SessionId('starts-outside'), {}, { cwd: f.root })
- const packages = join(f.root, 'packages')
- await expect(f.ctx.workingDirectory.inherit(outside, f.agent.session, { cwd: packages }))
- .resolves.toEqual({ root: f.root, cwd: packages })
- expect(f.ctx.workingDirectory.anchorsOf(outside.session)).toEqual([f.root])
- expect(outside.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: packages } })])
- // The source's other anchors are not passed on: a later change into one leaves the child's root alone.
- await f.ctx.workingDirectory.set(inside, f.root)
- await f.ctx.workingDirectory.relocate(f.agent, f.nested)
- await f.ctx.workingDirectory.set(inside, join(f.nested, 'src'))
- expect(f.ctx.workingDirectory.rootOf(inside.session)).toBe(f.root)
- // A missing directory is refused before anything is committed.
- await expect(f.ctx.workingDirectory.inherit(outside, f.agent.session, { cwd: join(f.root, 'missing') })).rejects.toThrow('directory does not exist')
- })
-
- it('passes no root on from a source whose root is its original project or the deployment fallback', async () => {
- await using f = await fixture()
- // The source works in its original project: the child's own header already registers it.
- const child = await f.harness.create(SessionId('same-project'), {}, { cwd: f.root })
- const foo = join(f.root, 'packages', 'foo')
- await expect(f.ctx.workingDirectory.inherit(child, f.agent.session, { cwd: foo })).resolves.toEqual({ root: f.root, cwd: foo })
- expect(child.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: foo } })])
- // A source without a recorded project reports the deployment fallback, which is no anchor to pass on:
- // the started Session only sets its directory and registers nothing.
- const bare = await f.harness.create(SessionId('bare-source'))
- const started = await f.harness.create(SessionId('bare-child'))
- await expect(f.ctx.workingDirectory.inherit(started, bare.session, { cwd: f.outside }))
- .resolves.toEqual({ root: f.ctx.workingDirectory.defaultDirectory, cwd: f.outside })
- expect(f.ctx.workingDirectory.anchorsOf(started.session)).toEqual([])
- expect(started.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: f.outside } })])
- })
-
- it('keeps the original project as the root when it is more specific than the inherited checkout', async () => {
- await using f = await fixture()
- const packages = join(f.root, 'packages')
- // The source relocated into a checkout enclosing the project the child's header records.
- const source = await f.harness.create(SessionId('enclosing-source'), {}, { cwd: packages })
- await f.ctx.workingDirectory.relocate(source, f.root)
- const child = await f.harness.create(SessionId('enclosed-child'), {}, { cwd: packages })
- const foo = join(packages, 'foo')
- await expect(f.ctx.workingDirectory.inherit(child, source.session, { cwd: foo })).resolves.toEqual({ root: packages, cwd: foo })
- expect(f.ctx.workingDirectory.anchorsOf(child.session)).toEqual([packages, f.root])
- expect(f.ctx.workingDirectory.rootOf(child.session)).toBe(packages)
- })
-
- it('tests containment lexically on canonical absolute paths', () => {
- expect(within('/repo', '/repo')).toBe(true)
- expect(within('/repo', '/repo/src')).toBe(true)
- expect(within('/repo', '/repo-sibling')).toBe(false)
- expect(within('/repo', '/')).toBe(false)
- expect(within('/repo/src', '/repo')).toBe(false)
- })
})
diff --git a/packages/subagent/subagent-claude-code/tests/loader-composition.e2e.ts b/packages/subagent/subagent-claude-code/tests/loader-composition.e2e.ts
index 6c3234b2f8..ba1b5f8872 100644
--- a/packages/subagent/subagent-claude-code/tests/loader-composition.e2e.ts
+++ b/packages/subagent/subagent-claude-code/tests/loader-composition.e2e.ts
@@ -79,22 +79,22 @@ describe('product-provider public Loader composition', () => {
tools: [
{
name: 'subagent_codex',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
{
name: 'subagent_claude_code',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
{
name: 'subagent_claude_primary',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
{
name: 'subagent_claude_secondary',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
],
diff --git a/packages/subagent/subagent-codex/tests/loader-composition.e2e.ts b/packages/subagent/subagent-codex/tests/loader-composition.e2e.ts
index e77ad6cd73..8ae70884d0 100644
--- a/packages/subagent/subagent-codex/tests/loader-composition.e2e.ts
+++ b/packages/subagent/subagent-codex/tests/loader-composition.e2e.ts
@@ -69,17 +69,17 @@ describe('Codex provider public Loader composition', () => {
tools: [
{
name: 'subagent_codex',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
{
name: 'subagent_codex_primary',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
{
name: 'subagent_codex_secondary',
- parameterNames: ['cwd', 'description', 'name', 'prompt'],
+ parameterNames: ['description', 'name', 'prompt'],
required: ['description', 'prompt'],
},
],
diff --git a/packages/subagent/subagent/README.i18n.yaml b/packages/subagent/subagent/README.i18n.yaml
index 35ef95a449..c5abb69485 100644
--- a/packages/subagent/subagent/README.i18n.yaml
+++ b/packages/subagent/subagent/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-subagent/use-this-package:
- en: f6b1472754d90c07
- zh: 672ad5f7f91fcff4
+ en: f94c7033e492ee4d
+ zh: dd82c54809d07b23
/deepseek-ai-dsh-subagent/use-this-package/enabling-delegation:
en: c0718955687ff245
zh: eb2d3cdbe92e0fe2
diff --git a/packages/subagent/subagent/README.md b/packages/subagent/subagent/README.md
index 69f26aa109..2fdfbdcf80 100644
--- a/packages/subagent/subagent/README.md
+++ b/packages/subagent/subagent/README.md
@@ -25,7 +25,7 @@ Use `dsh-subagent` to delegate work through named providers and collect managed
## Use this package
-Each start accepts an optional `cwd`; relative paths resolve against the parent's current working directory, and omission captures that current directory. The child keeps its parent's origin metadata and permission roots. The child's directories start through the working-directory service's `inherit`: when the parent works in a registered checkout other than its original project, a child that starts inside that checkout registers it as a workspace anchor; the child's root is the longest of its anchors containing its directory, which is that checkout unless the original project recorded in its header already contains the directory. The child registers only the parent's current root, not the parent's other anchors, so a later `cd` into another checkout the parent entered leaves the child's root unchanged. A child-owned directory value follows any inherited history, survives continuation and restart, and is independent of later parent changes.
+Each start accepts an optional Host-chosen `cwd`; a relative path resolves against the parent's workspace root, and omission starts the child in that root. The child keeps its parent's origin metadata, and the directory it starts in becomes its workspace through `ctx.workingDirectory.set`. A child-owned directory value follows any inherited history, survives continuation and restart, and is independent of later parent changes.
This package is the contract every delegation setup shares. You enable it by mounting the service together with one or more provider backends and the model-facing delegation tool; from then on, an agent can delegate work and the service routes each request to the named provider.
diff --git a/packages/subagent/subagent/README.zh.md b/packages/subagent/subagent/README.zh.md
index 6a2d9615c1..cb309c9a42 100644
--- a/packages/subagent/subagent/README.zh.md
+++ b/packages/subagent/subagent/README.zh.md
@@ -25,7 +25,7 @@ kind: "package-reference"
## 使用本包
-每次启动可传入可选的 `cwd`;相对路径以父级当前工作目录解析,省略时捕获该当前目录。子级保留父级的起始目录元数据与权限根目录。子级的目录通过工作目录服务的 `inherit` 启动:父级在原始项目之外的已登记检出目录中工作时,在该检出目录内启动的子级把它登记为工作区锚;子级的根是其锚中包含其目录的最长者,即该检出目录,除非 header 记录的原始项目本身已包含该目录。子级只登记父级当前的根,不登记父级的其他锚,因此之后 `cd` 进父级进入过的另一个检出目录时子级的根不变。子级自己的目录值位于继承历史之后,在继续与重启后保留,并独立于父级之后的目录变化。
+每次启动可传入由 Host 选定的可选 `cwd`;相对路径以父级的工作区根解析,省略时子级从该根启动。子级保留父级的起始目录元数据,它启动所在的目录通过 `ctx.workingDirectory.set` 成为它的工作区。子级自己的目录值位于继承历史之后,在继续与重启后保留,并独立于父级之后的目录变化。
本包是每个委派组合都共享的约定。你通过把服务与一个或多个提供方后端以及面向模型的委派工具一起挂载来启用它;此后 agent 即可委派工作,服务会把每个请求路由到具名提供方。
diff --git a/packages/subagent/subagent/package.json b/packages/subagent/subagent/package.json
index 639946d565..6bff46b9ee 100644
--- a/packages/subagent/subagent/package.json
+++ b/packages/subagent/subagent/package.json
@@ -106,33 +106,32 @@
},
"devDependencies": {
"@deepseek-ai/cordis": "workspace:~",
- "@deepseek-ai/cordis-plugin-include": "workspace:~",
- "@deepseek-ai/cordis-plugin-loader": "workspace:~",
"@deepseek-ai/dsh-agent": "workspace:*",
- "@deepseek-ai/dsh-agent-loop": "workspace:*",
- "@deepseek-ai/dsh-agent-loop-testkit": "workspace:*",
"@deepseek-ai/dsh-agent-preset-registry": "workspace:*",
"@deepseek-ai/dsh-attachment": "workspace:*",
- "@deepseek-ai/dsh-fs": "workspace:*",
- "@deepseek-ai/dsh-fs-sandbox": "workspace:*",
"@deepseek-ai/dsh-llm": "workspace:*",
- "@deepseek-ai/dsh-permission-presets": "workspace:*",
"@deepseek-ai/dsh-sandbox": "workspace:*",
"@deepseek-ai/dsh-sandbox-policy": "workspace:*",
"@deepseek-ai/dsh-scope": "workspace:*",
"@deepseek-ai/dsh-session": "workspace:*",
"@deepseek-ai/dsh-session-persistence": "workspace:*",
- "@deepseek-ai/dsh-session-persistence-jsonl": "workspace:*",
"@deepseek-ai/dsh-session-projection": "workspace:*",
"@deepseek-ai/dsh-session-query": "workspace:*",
"@deepseek-ai/dsh-system-prompt": "workspace:*",
- "@deepseek-ai/dsh-tool-fs": "workspace:*",
"@deepseek-ai/dsh-tool-testkit": "workspace:*",
"@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-typert-protocol": "workspace:*",
"@deepseek-ai/dsh-user-approval": "workspace:*",
"@deepseek-ai/dsh-util-time": "workspace:*",
- "@deepseek-ai/dsh-working-directory": "workspace:*",
- "@deepseek-ai/dsh-workspace": "workspace:*"
+ "@deepseek-ai/dsh-permission-presets": "workspace:*",
+ "@deepseek-ai/dsh-workspace": "workspace:*",
+ "@deepseek-ai/cordis-plugin-include": "workspace:~",
+ "@deepseek-ai/cordis-plugin-loader": "workspace:~",
+ "@deepseek-ai/dsh-agent-loop": "workspace:*",
+ "@deepseek-ai/dsh-agent-loop-testkit": "workspace:*",
+ "@deepseek-ai/dsh-fs-sandbox": "workspace:*",
+ "@deepseek-ai/dsh-tool-fs": "workspace:*",
+ "@deepseek-ai/dsh-session-persistence-jsonl": "workspace:*",
+ "@deepseek-ai/dsh-working-directory": "workspace:*"
}
}
diff --git a/packages/subagent/subagent/src/manager.ts b/packages/subagent/subagent/src/manager.ts
index 60f1d85665..dddb289052 100644
--- a/packages/subagent/subagent/src/manager.ts
+++ b/packages/subagent/subagent/src/manager.ts
@@ -8,7 +8,6 @@
import { randomUUID } from 'node:crypto'
import { isAbsolute, resolve } from 'node:path'
-import type {} from '@deepseek-ai/dsh-fs'
import type {} from '@deepseek-ai/dsh-working-directory'
import { FiberState, type Context } from '@deepseek-ai/cordis'
import type { Agent, AgentOptions, CreateAgentOptions } from '@deepseek-ai/dsh-agent'
@@ -492,17 +491,14 @@ export class SubagentManager {
})
}
- /**
- * Capture the explicit or inherited directory while the parent still owns startup. The result carries
- * the canonical spelling the directory service records, so containment against the parent's root sees
- * the same path a symlinked request denotes; an orchestration fixture without a filesystem keeps it lexical.
- */
+ /** Capture the explicit directory, or the parent's workspace root, while the parent still owns startup. */
private async resolveDirectory(request: Pick, signal: AbortSignal): Promise {
- const lexical = request.cwd !== undefined && isAbsolute(request.cwd)
- ? request.cwd
- : resolve(await this.ctx.workingDirectory.ensure(request.parent, signal), request.cwd ?? '.')
- const fs = this.ctx.get('fs')
- const cwd = fs === undefined ? lexical : fs.processPath(await fs.resolve(lexical, { signal }))
+ let cwd = request.cwd
+ if (cwd === undefined || !isAbsolute(cwd)) {
+ // Validation can restore the parent's workspace before its root is read.
+ await this.ctx.workingDirectory.ensure(request.parent, signal)
+ cwd = resolve(this.ctx.workingDirectory.rootOf(request.parent.session), cwd ?? '.')
+ }
signal.throwIfAborted()
return cwd
}
@@ -844,9 +840,7 @@ export class SubagentManager {
appendDelegatedPolicyOverrides(child.session, create.delegatedPolicies)
const workingDirectory = childCtx.get('workingDirectory')
if (workingDirectory === undefined) throw new Error('local subagents require the working-directory service')
- // The child header records the parent's original project; the directory service decides whether
- // the checkout the parent works in becomes the child's root as well.
- await workingDirectory.inherit(child, create.parent.session, { cwd: create.cwd, signal: inputs.signal })
+ await workingDirectory.set(child, create.cwd, inputs.signal)
}
if (inputs.composition.agentPreset === undefined) await applyChildComposition(childCtx, create?.parent, inputs.composition)
if (inputs.outputSchema !== undefined) {
diff --git a/packages/subagent/subagent/src/types.ts b/packages/subagent/subagent/src/types.ts
index 1786ed8e2e..7de6f89287 100644
--- a/packages/subagent/subagent/src/types.ts
+++ b/packages/subagent/subagent/src/types.ts
@@ -142,7 +142,10 @@ export interface SubagentCapabilities {
* shares these task options and defines its own label and cancellation policy.
*/
export interface SubagentStartRequest {
- /** Initial child directory; relative paths resolve against the parent's current directory. Omitted inherits that directory at start. */
+ /**
+ * Host-chosen initial child directory, which becomes the child's workspace; a relative path resolves
+ * against the parent's workspace root. Omitted starts the child in that root.
+ */
readonly cwd?: string
/**
* Independent preset id; omission joins the parent's current generation.
@@ -155,7 +158,7 @@ export interface SubagentStartRequest {
/** Content delivered as the child's user message. */
readonly prompt: ContentBlock[]
/**
- * The spawning agent. Its effective directory supplies the default cwd;
+ * The spawning agent. Its workspace root supplies the default cwd;
* in-process children retain its origin, lineage, and delegation depth.
*/
readonly parent: Agent
diff --git a/packages/subagent/subagent/tests/working-directory-fixture.ts b/packages/subagent/subagent/tests/working-directory-fixture.ts
index e05a67adfb..e2e5b030d8 100644
--- a/packages/subagent/subagent/tests/working-directory-fixture.ts
+++ b/packages/subagent/subagent/tests/working-directory-fixture.ts
@@ -1,19 +1,11 @@
import { Context, Service } from '@deepseek-ai/cordis'
-import { isAbsolute, relative, resolve, sep } from 'node:path'
+import { resolve } from 'node:path'
import type { Agent } from '@deepseek-ai/dsh-agent'
import type { Session } from '@deepseek-ai/dsh-session'
-import type { InheritOptions, RelocateOptions, RelocatedDirectories } from '@deepseek-ai/dsh-working-directory'
-
-/** Whether `path` is `root` or lies below it, lexically. */
-function within(root: string, path: string): boolean {
- const rest = relative(root, path)
- return rest === '' || (rest !== '..' && !rest.startsWith(`..${sep}`) && !isAbsolute(rest))
-}
/** Directory selection for orchestration fixtures whose paths are symbolic and whose logs exclude context providers. */
class FixtureWorkingDirectory extends Service {
private readonly directories = new WeakMap()
- private readonly anchors = new WeakMap()
constructor(ctx: Context) {
super(ctx, 'workingDirectory')
@@ -24,13 +16,7 @@ class FixtureWorkingDirectory extends Service {
}
rootOf(session: Session): string {
- const cwd = this.get(session)
- return this.anchorsOf(session).filter(anchor => within(anchor, cwd)).sort((a, b) => b.length - a.length)[0]
- ?? session?.header.cwd ?? process.cwd()
- }
-
- anchorsOf(session: Session): readonly string[] {
- return this.anchors.get(session) ?? [session?.header.cwd ?? process.cwd()]
+ return this.get(session)
}
async ensure(agent: Agent, signal?: AbortSignal): Promise {
@@ -44,26 +30,6 @@ class FixtureWorkingDirectory extends Service {
this.directories.set(agent.session, cwd)
return cwd
}
-
- async relocate(agent: Agent, root: string, options: RelocateOptions = {}): Promise {
- options.signal?.throwIfAborted()
- const anchor = resolve(this.get(agent.session), root)
- const cwd = options.cwd === undefined ? anchor : resolve(anchor, options.cwd)
- const anchors = [...this.anchorsOf(agent.session)]
- if (!anchors.includes(anchor)) anchors.push(anchor)
- this.anchors.set(agent.session, anchors)
- this.directories.set(agent.session, cwd)
- return { root: anchor, cwd }
- }
-
- async inherit(agent: Agent, source: Session, options: InheritOptions): Promise {
- const root = this.rootOf(source)
- if (this.anchorsOf(source).includes(root) && root !== agent.session.header.cwd && within(root, options.cwd)) {
- return this.relocate(agent, root, options)
- }
- const cwd = await this.set(agent, options.cwd, options.signal)
- return { root: this.rootOf(agent.session), cwd }
- }
}
/** Mount the directory collaborator without filesystem or model-context behavior unrelated to an orchestration test. */
diff --git a/packages/subagent/subagent/tests/working-directory.spec.ts b/packages/subagent/subagent/tests/working-directory.spec.ts
index 5f2622a581..e7998179a8 100644
--- a/packages/subagent/subagent/tests/working-directory.spec.ts
+++ b/packages/subagent/subagent/tests/working-directory.spec.ts
@@ -1,6 +1,6 @@
import { startTestActivation } from './local-activation.ts'
import { mountWorkingDirectoryFixture } from './working-directory-fixture.ts'
-import { mkdtemp, mkdir, realpath, rm, symlink } from 'node:fs/promises'
+import { mkdtemp, mkdir, realpath, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { Context } from '@deepseek-ai/cordis'
@@ -43,7 +43,7 @@ async function fixture() {
meta: { cwd: origin },
agentOptions: { provider: 'mock', model: 'mock' },
})
- return { ctx, root, parent, origin, first, second, adapter }
+ return { ctx, parent, origin, first, second, adapter }
}
describe('subagent working directories', () => {
@@ -60,70 +60,21 @@ describe('subagent working directories', () => {
const child = run.localAgent
expect(child.session.header.cwd).toBe(origin)
expect(ctx.workingDirectory.get(child.session)).toBe(selected)
- expect(ctx.workingDirectory.rootOf(child.session)).toBe(origin)
+ expect(ctx.workingDirectory.rootOf(child.session)).toBe(selected)
await ctx.workingDirectory.set(parent, first)
expect(ctx.workingDirectory.get(child.session)).toBe(selected)
await run.dispose()
})
- it.each(['spawn', 'fork'])('%s inherits the parent workspace root when the parent works in another checkout', async (provider) => {
- const { ctx, parent, origin, second } = await fixture()
- const inside = join(second, 'inside')
- await mkdir(inside)
- await ctx.workingDirectory.relocate(parent, second, { cwd: inside })
- const run = await startTestActivation(ctx, provider, {
+ it('starts a child in the parent workspace root, not in a directory a change without the marker recorded', async () => {
+ const { ctx, parent, origin, first } = await fixture()
+ parent.session.append('working-directory/change', { cwd: await realpath(first) })
+ const run = await startTestActivation(ctx, 'spawn', {
parent, prompt: [{ type: 'text', text: 'child' }], signal: new AbortController().signal,
})
await run.result
- const child = run.localAgent
- expect(child.session.header.cwd).toBe(origin)
- expect(ctx.workingDirectory.get(child.session)).toBe(await realpath(inside))
- expect(ctx.workingDirectory.rootOf(child.session)).toBe(await realpath(second))
- expect(ctx.workingDirectory.anchorsOf(child.session)).toEqual([origin, await realpath(second)])
- await run.dispose()
- })
-
- it('relocates a child whose explicit directory is a symlinked spelling inside the parent checkout', async () => {
- const { ctx, root, parent, origin, second } = await fixture()
- const inside = join(second, 'inside')
- await mkdir(inside)
- const link = join(root, 'link')
- await symlink(second, link)
- await ctx.workingDirectory.relocate(parent, second)
- const run = await startTestActivation(ctx, 'spawn', {
- parent, cwd: join(link, 'inside'), prompt: [{ type: 'text', text: 'child' }], signal: new AbortController().signal,
- })
- await run.result
- const child = run.localAgent
- expect(ctx.workingDirectory.get(child.session)).toBe(await realpath(inside))
- expect(ctx.workingDirectory.rootOf(child.session)).toBe(await realpath(second))
- expect(ctx.workingDirectory.anchorsOf(child.session)).toEqual([origin, await realpath(second)])
- await run.dispose()
- })
-
- it('does not relocate a child of a parent without a recorded project; the child registers the fallback itself', async () => {
- const { ctx } = await fixture()
- const fallback = ctx.workingDirectory.defaultDirectory
- const { agent: parent } = await ctx.agents.create({
- sessionId: SessionId('fallback-parent'),
- meta: {},
- agentOptions: { provider: 'mock', model: 'mock' },
- })
- expect(ctx.workingDirectory.rootOf(parent.session)).toBe(fallback)
- const run = await startTestActivation(ctx, 'spawn', {
- parent, cwd: fallback, prompt: [{ type: 'text', text: 'child' }], signal: new AbortController().signal,
- })
- await run.result
- const child = run.localAgent
- expect(child.session.header.cwd).toBeUndefined()
- // The parent's fallback root is no registered anchor, so the child is not relocated into it; the
- // child's own first validation records the canonical fallback as its first anchor.
- const canonical = await realpath(fallback)
- expect(ctx.workingDirectory.get(child.session)).toBe(canonical)
- expect(ctx.workingDirectory.rootOf(child.session)).toBe(canonical)
- expect(ctx.workingDirectory.anchorsOf(child.session)).toEqual([canonical])
- expect(child.session.snapshotEvents().filter(event => event.type === 'working-directory/change'))
- .toEqual([expect.objectContaining({ data: { cwd: canonical, anchor: canonical } })])
+ expect(ctx.workingDirectory.get(run.localAgent.session)).toBe(await realpath(origin))
+ expect(ctx.workingDirectory.rootOf(run.localAgent.session)).toBe(await realpath(origin))
await run.dispose()
})
@@ -145,7 +96,7 @@ describe('subagent working directories', () => {
using observed = await ctx.sessionQuery.observeSession(started.childId)
expect(observed.header.cwd).toBe(origin)
const last = observed.events.findLast(event => event.type === 'working-directory/change')
- expect(last?.data).toMatchObject({ cwd: selected })
+ expect(last?.data).toEqual({ cwd: selected, workspace: true })
})
it('rolls back a local child whose setup realm has no directory service', async () => {
diff --git a/packages/subagent/subagent/tsconfig.json b/packages/subagent/subagent/tsconfig.json
index aacaa3a1e4..8783b69afc 100644
--- a/packages/subagent/subagent/tsconfig.json
+++ b/packages/subagent/subagent/tsconfig.json
@@ -71,9 +71,6 @@
{
"path": "../../util/chunked-list"
},
- {
- "path": "../../fs/fs"
- },
{
"path": "../../session/working-directory"
}
diff --git a/packages/subagent/tool-subagent/README.i18n.yaml b/packages/subagent/tool-subagent/README.i18n.yaml
index 35252c76ab..b495bfc1cd 100644
--- a/packages/subagent/tool-subagent/README.i18n.yaml
+++ b/packages/subagent/tool-subagent/README.i18n.yaml
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-tool-subagent/use-this-package:
- en: 93f1701f5209ecb5
- zh: 6310fd012400aead
+ en: 76236371849f929c
+ zh: 341fb5d40fdb6d36
/deepseek-ai-dsh-tool-subagent/use-this-package/minimal-configuration:
en: 1a23808ca32b8f2d
zh: e637a35220da0564
diff --git a/packages/subagent/tool-subagent/README.md b/packages/subagent/tool-subagent/README.md
index e41c2161b6..23bffbbc44 100644
--- a/packages/subagent/tool-subagent/README.md
+++ b/packages/subagent/tool-subagent/README.md
@@ -25,7 +25,7 @@ Use this package to give an agent a named tool that delegates work to a configur
## Use this package
-The optional `cwd` argument selects the child's initial working directory. Relative paths resolve against the caller's current directory; omission inherits it. Existing children retain their own directories when the caller changes directory.
+The child starts in the caller's workspace directory; the tool takes no directory argument. Existing children retain their own directories when the caller's directory changes.
Mount one instance per delegation target, each with a distinct `toolName`. The tool exists exactly while its provider does, so sibling load order and provider reloads never strand it.
diff --git a/packages/subagent/tool-subagent/README.zh.md b/packages/subagent/tool-subagent/README.zh.md
index 2093ff093a..b377e4152a 100644
--- a/packages/subagent/tool-subagent/README.zh.md
+++ b/packages/subagent/tool-subagent/README.zh.md
@@ -25,7 +25,7 @@ kind: "package-reference"
## 使用本包
-可选参数 `cwd` 选择子级的初始工作目录。相对路径以调用者当前目录解析;省略时继承该目录。调用者切换目录时,已有子级保留自己的目录。
+子级从调用者的工作区目录启动;工具不接受目录参数。调用者的目录变化时,已有子级保留自己的目录。
每个委派目标挂载一个实例,且每个实例的 `toolName` 必须不同。工具与其提供方同时存在、同时消失,因此同级加载顺序与提供方重新加载都不会让工具悬空。
diff --git a/packages/subagent/tool-subagent/src/index.ts b/packages/subagent/tool-subagent/src/index.ts
index 5f2f089363..6530325a27 100644
--- a/packages/subagent/tool-subagent/src/index.ts
+++ b/packages/subagent/tool-subagent/src/index.ts
@@ -216,10 +216,6 @@ export async function apply(ctx: Context, config: Config): Promise {
? ' Changing the route can prevent provider-side reuse of the inherited conversation prefix.'
: ''),
parameters: {
- cwd: {
- type: 'string',
- description: 'Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent.',
- },
description: {
type: 'string',
required: true,
@@ -315,7 +311,6 @@ export async function apply(ctx: Context, config: Config): Promise {
exec.signal.throwIfAborted()
const maxDepth = ctx.subagents.resolveMaxDepth(config.maxDepth)
const request = {
- ...args.cwd === undefined ? {} : { cwd: args.cwd },
prompt: [{ type: 'text', text: args.prompt }] as ContentBlock[],
parent,
...agentPreset === undefined ? {} : { agentPreset },
diff --git a/packages/subagent/tool-subagent/tests/model-selection.spec.ts b/packages/subagent/tool-subagent/tests/model-selection.spec.ts
index 014acf6d5b..a84306e9d6 100644
--- a/packages/subagent/tool-subagent/tests/model-selection.spec.ts
+++ b/packages/subagent/tool-subagent/tests/model-selection.spec.ts
@@ -92,7 +92,6 @@ describe('dsh-tool-subagent model selection', () => {
const schema = ctx.tools.schemas(agent).find(entry => entry.name === 'subagent')!
const props = (schema.parameters as { properties?: Record }).properties ?? {}
expect(Object.keys(props).sort()).toEqual([
- 'cwd',
'description',
'model',
'name',
@@ -125,7 +124,7 @@ describe('dsh-tool-subagent model selection', () => {
const ctx = await setup({ provider: 'mock', parentAgentOptions: { provider: 'alpha', model: 'parent-model' } })
const schema = ctx.tools.schemas().find(entry => entry.name === 'subagent')!
const props = (schema.parameters as { properties?: Record }).properties ?? {}
- expect(Object.keys(props).sort()).toEqual(['cwd', 'description', 'name', 'prompt'])
+ expect(Object.keys(props).sort()).toEqual(['description', 'name', 'prompt'])
expect(schema.description).not.toContain('list_subagent_models')
expect(ctx.tools.get('list_subagent_models')).toBeUndefined()
@@ -186,7 +185,7 @@ describe('dsh-tool-subagent model selection', () => {
const agent = modelSelectionSetupAgent(ctx)
const schema = ctx.tools.schemas(agent).find(entry => entry.name === 'subagent')!
const props = (schema.parameters as { properties?: Record }).properties ?? {}
- expect(Object.keys(props).sort()).toEqual(['cwd', 'description', 'model', 'name', 'prompt', 'provider', 'reasoning_effort'])
+ expect(Object.keys(props).sort()).toEqual(['description', 'model', 'name', 'prompt', 'provider', 'reasoning_effort'])
expect(schema.description).not.toContain('list_subagent_models')
expect(schema.description).not.toContain('Changing the route can prevent provider-side reuse')
expect(ctx.tools.get('list_subagent_models', agent)).toBeDefined()
@@ -587,7 +586,7 @@ describe('dsh-tool-subagent model selection', () => {
})
const schema = ctx.tools.schemas(agent).find(entry => entry.name === 'subagent')!
const props = (schema.parameters as { properties?: Record }).properties ?? {}
- expect(Object.keys(props).sort()).toEqual(['cwd', 'description', 'name', 'prompt'])
+ expect(Object.keys(props).sort()).toEqual(['description', 'name', 'prompt'])
expect(schema.description).toContain('inherits this conversation')
expect(schema.description).not.toContain('list_subagent_models')
expect(ctx.tools.get('list_subagent_models', agent)).toBeUndefined()
diff --git a/packages/subagent/tool-subagent/tests/tool-subagent.spec.ts b/packages/subagent/tool-subagent/tests/tool-subagent.spec.ts
index 095d1de42c..7b79879eb9 100644
--- a/packages/subagent/tool-subagent/tests/tool-subagent.spec.ts
+++ b/packages/subagent/tool-subagent/tests/tool-subagent.spec.ts
@@ -78,7 +78,7 @@ describe('dsh-tool-subagent', () => {
expect(text(result)).toMatch(/^started subagent /)
})
- it('resolves an explicit child directory without changing the parent directory', async () => {
+ it('starts the child in the parent directory without changing it', async () => {
let childCwd: string | undefined
const ctx = await setup({ provider: 'mock' }, {
onStart: (request) => { childCwd = request.cwd },
@@ -89,10 +89,9 @@ describe('dsh-tool-subagent', () => {
const result = await callSubagent(ctx, {
description: 'inspect packages',
prompt: 'list the packages',
- cwd: 'packages',
}, { agent: parent })
expect(result.isError).toBe(false)
- expect(childCwd).toBe(path.resolve(parentCwd, 'packages'))
+ expect(childCwd).toBe(parentCwd)
expect(ctx.workingDirectory.get(parent.session)).toBe(parentCwd)
} finally {
await ctx.fiber.dispose()
@@ -104,7 +103,6 @@ describe('dsh-tool-subagent', () => {
const schema = ctx.tools.schemas().find(s => s.name === 'subagent')
const props = (schema!.parameters as { properties?: Record }).properties ?? {}
expect(Object.keys(props).sort()).toEqual([
- 'cwd',
'description',
'name',
'prompt',
diff --git a/packages/test-support/agent-loop-testkit/src/working-directory-fixture.ts b/packages/test-support/agent-loop-testkit/src/working-directory-fixture.ts
index 93d4b3d7da..c1f6013b10 100644
--- a/packages/test-support/agent-loop-testkit/src/working-directory-fixture.ts
+++ b/packages/test-support/agent-loop-testkit/src/working-directory-fixture.ts
@@ -5,6 +5,7 @@ import type { Session } from '@deepseek-ai/dsh-session'
/**
* Supply fixed directory values without filesystem checks or durable changes.
+ * The workspace root equals the directory.
* @param ctx - context owning this test collaborator.
* @param defaultDirectory - fallback for fixtures without a Session directory.
*/
@@ -13,6 +14,7 @@ export function provideWorkingDirectoryFixture(ctx: Context, defaultDirectory =
ctx.provide('workingDirectory', {
defaultDirectory,
get,
+ rootOf: get,
ensure: (agent: Agent): Promise => Promise.resolve(get(agent.session)),
})
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a6c5a76fb8..aaf66622ab 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -129,9 +129,6 @@ importers:
'@deepseek-ai/dsh-tool-terminal':
specifier: workspace:*
version: link:packages/experimental/tool-terminal
- '@deepseek-ai/dsh-tool-working-directory':
- specifier: workspace:*
- version: link:packages/session/tool-working-directory
'@deepseek-ai/dsh-tool-workspace-dependencies':
specifier: workspace:*
version: link:packages/skill/tool-workspace-dependencies
@@ -2643,9 +2640,6 @@ importers:
'@deepseek-ai/dsh-tool-workflow':
specifier: workspace:*
version: link:../../workflow/tool-workflow
- '@deepseek-ai/dsh-tool-working-directory':
- specifier: workspace:*
- version: link:../../session/tool-working-directory
'@deepseek-ai/dsh-tools':
specifier: workspace:*
version: link:../../core/tools
@@ -2910,9 +2904,6 @@ importers:
'@deepseek-ai/dsh-tool-pwsh-persistent':
specifier: workspace:*
version: link:../../shell/tool-pwsh-persistent
- '@deepseek-ai/dsh-tool-working-directory':
- specifier: workspace:*
- version: link:../../session/tool-working-directory
'@deepseek-ai/dsh-tools':
specifier: workspace:*
version: link:../../core/tools
@@ -15320,39 +15311,6 @@ importers:
specifier: workspace:*
version: link:../session-projection
- packages/session/tool-working-directory:
- devDependencies:
- '@deepseek-ai/cordis':
- specifier: workspace:~
- version: link:../../../vendor/cordis
- '@deepseek-ai/dsh-agent-loop':
- specifier: workspace:*
- version: link:../../core/agent-loop
- '@deepseek-ai/dsh-agent-loop-testkit':
- specifier: workspace:*
- version: link:../../test-support/agent-loop-testkit
- '@deepseek-ai/dsh-fs-local':
- specifier: workspace:*
- version: link:../../fs/fs-local
- '@deepseek-ai/dsh-llm':
- specifier: workspace:*
- version: link:../../llm/llm
- '@deepseek-ai/dsh-session':
- specifier: workspace:*
- version: link:../../core/session
- '@deepseek-ai/dsh-session-projection':
- specifier: workspace:*
- version: link:../session-projection
- '@deepseek-ai/dsh-system-prompt':
- specifier: workspace:*
- version: link:../../core/system-prompt
- '@deepseek-ai/dsh-tools':
- specifier: workspace:*
- version: link:../../core/tools
- '@deepseek-ai/dsh-working-directory':
- specifier: workspace:*
- version: link:../working-directory
-
packages/session/working-directory:
dependencies:
'@deepseek-ai/schemastery':
@@ -15395,15 +15353,6 @@ importers:
'@deepseek-ai/dsh-system-prompt':
specifier: workspace:*
version: link:../../core/system-prompt
- '@deepseek-ai/dsh-tool-testkit':
- specifier: workspace:*
- version: link:../../test-support/tool-testkit
- '@deepseek-ai/dsh-tool-working-directory':
- specifier: workspace:*
- version: link:../tool-working-directory
- '@deepseek-ai/dsh-tools':
- specifier: workspace:*
- version: link:../../core/tools
'@deepseek-ai/dsh-user-approval':
specifier: workspace:*
version: link:../../interaction/user-approval
@@ -16508,9 +16457,6 @@ importers:
'@deepseek-ai/dsh-attachment':
specifier: workspace:*
version: link:../../attachment/attachment
- '@deepseek-ai/dsh-fs':
- specifier: workspace:*
- version: link:../../fs/fs
'@deepseek-ai/dsh-fs-sandbox':
specifier: workspace:*
version: link:../../fs/fs-sandbox
@@ -18798,9 +18744,6 @@ importers:
'@deepseek-ai/dsh-tool-workflow':
specifier: workspace:*
version: link:../../packages/workflow/tool-workflow
- '@deepseek-ai/dsh-tool-working-directory':
- specifier: workspace:*
- version: link:../../packages/session/tool-working-directory
'@deepseek-ai/dsh-tool-workspace-dependencies':
specifier: workspace:*
version: link:../../packages/skill/tool-workspace-dependencies
diff --git a/python/sdk-runtime/package.json b/python/sdk-runtime/package.json
index bf94634746..0f48fd4226 100644
--- a/python/sdk-runtime/package.json
+++ b/python/sdk-runtime/package.json
@@ -146,7 +146,6 @@
"@deepseek-ai/dsh-tool-todo": "workspace:*",
"@deepseek-ai/dsh-tool-web": "workspace:*",
"@deepseek-ai/dsh-tool-workflow": "workspace:*",
- "@deepseek-ai/dsh-tool-working-directory": "workspace:*",
"@deepseek-ai/dsh-tool-workspace-dependencies": "workspace:*",
"@deepseek-ai/dsh-tools": "workspace:*",
"@deepseek-ai/dsh-typert-protocol": "workspace:*",
diff --git a/python/sdk/README.i18n.yaml b/python/sdk/README.i18n.yaml
index cdbaf74304..fe2dc970c9 100644
--- a/python/sdk/README.i18n.yaml
+++ b/python/sdk/README.i18n.yaml
@@ -18,11 +18,11 @@
en: 1d18c09832dd4a42
zh: 6e7260b650a1f987
/deepseek-harness-python-sdk/customize-plugins:
- en: 0cfa22d329a704db
- zh: ff04b5e01e2c5936
+ en: 5d91d1905add265f
+ zh: ecec2471aba1d2ad
/deepseek-harness-python-sdk/native-user-questions:
en: 979ad00fe498b2be
zh: 4b656bd268292a13
/deepseek-harness-python-sdk/results-and-notifications:
- en: 5ffe82e8d28abdbf
- zh: 94de9eeee9acb32f
+ en: 6b81899ea865ffd2
+ zh: d9e326a3fb04e696
diff --git a/python/sdk/README.md b/python/sdk/README.md
index af7f726fc3..0194721797 100644
--- a/python/sdk/README.md
+++ b/python/sdk/README.md
@@ -129,7 +129,7 @@ with DeepSeekHarness(
`provider` selects a provider route registered by the chosen Cordis composition; `model` is the model id resolved by that adapter. `reasoning_effort` is an optional non-empty adapter-owned identifier for that exact route; omission preserves the model's own default. `max_tokens` is an optional positive per-request output-token cap for the root agent and its in-process descendants; omission leaves the provider default in control. Initialization rejects a missing adapter, unavailable model, or unsupported effort before a prompt runs. Compaction summaries keep the separate limit configured by their compaction plugin. The bundled default composition registers `deepseek-official`. A custom composition can mount `llm-pi-ai`, configure provider-specific credentials/endpoints there, and select any provider/model present in pi-ai's installed catalog.
-The shipped `sdk-minimal` profile is a standalone explicit tree rather than an overlay on `dsh-base`. Select it with `profile="sdk-minimal"`; the ordinary `model` argument is the sole runtime model selection, including for model ids outside the adapter's advisory catalog. It provides a platform-selected persistent shell, `read_image`, `working_directory`, local execution, JSONL sessions, and automatic compaction. Text file tools, settings, managed credentials, telemetry, Web tools, and the full default tool roster remain available through the separate full `sdk` and `web` profiles. The `sdk-minimal` profile leaves unsupported slash input on the ordinary prompt path.
+The shipped `sdk-minimal` profile is a standalone explicit tree rather than an overlay on `dsh-base`. Select it with `profile="sdk-minimal"`; the ordinary `model` argument is the sole runtime model selection, including for model ids outside the adapter's advisory catalog. It provides a platform-selected persistent shell, `read_image`, local execution, JSONL sessions, and automatic compaction. Text file tools, settings, managed credentials, telemetry, Web tools, and the full default tool roster remain available through the separate full `sdk` and `web` profiles. The `sdk-minimal` profile leaves unsupported slash input on the ordinary prompt path.
## Native user questions
@@ -149,4 +149,4 @@ The selected home stores profiles, plugins, and every profile-owned durable reso
See the [Python tutorial](../../docs/user/guide/python-sdk.md), [runnable example](examples/README.md), and [runtime wheel reference](../sdk-runtime/README.md).
-`Session.get_working_directory()` reads the effective working directory; `get_workspace_root()` reads the workspace root that directory is in; `set_working_directory(path)` changes the directory and returns the validated absolute path. Each creates an unknown Session without running a model turn. Relative paths use that Session's current directory. Origin metadata, permissions, and existing processes remain unchanged. The low-level client provides the same methods with a leading `session_id` argument.
+`Session.get_working_directory()` reads the effective working directory; `set_working_directory(path)` changes it and returns the validated absolute path. Both create an unknown Session without running a model turn. Relative paths use that Session's current directory. Origin metadata, permissions, and existing processes remain unchanged. The low-level client provides the same methods with a leading `session_id` argument.
diff --git a/python/sdk/README.zh.md b/python/sdk/README.zh.md
index 4582927e10..81f7eb5c94 100644
--- a/python/sdk/README.zh.md
+++ b/python/sdk/README.zh.md
@@ -129,7 +129,7 @@ with DeepSeekHarness(
`provider` 选择指定 Cordis 组合所注册的提供方路由;`model` 是该适配器解析出的模型 ID。`reasoning_effort` 是该确切路由可选的非空适配器自有标识符;省略时保留模型自身的默认值。`max_tokens` 是一个可选的正整数,用于限制根 agent 及其进程内后代在每次请求中输出的 token 数量;省略该参数时,由提供方的默认行为决定输出上限。缺少适配器、模型不可用或推理强度不受支持时,初始化会在提示词运行前拒绝。压缩(compaction)摘要继续使用压缩插件单独配置的上限。内置默认组合注册 `deepseek-official`。自定义组合可以挂载 `llm-pi-ai`,在其中配置各提供方专属的凭据和端点,并选择 pi-ai 已安装 catalog 中存在的任意提供方/模型组合。
-随附的 `sdk-minimal` profile 是独立显式配置树,而不是 `dsh-base` 上的 overlay。使用 `profile="sdk-minimal"` 选择它;普通 `model` 参数是唯一运行时模型选择,也适用于不在适配器建议目录中的模型 ID。它提供按平台选择的持久 shell、`read_image`、`working_directory`、本地执行、JSONL 会话和自动压缩。文本文件工具、设置、托管凭据、遥测、Web 工具与完整默认工具清单仍由独立的完整 `sdk` 与 `web` profile 提供。`sdk-minimal` profile 将不支持的斜杠输入保留在普通提示词路径上。
+随附的 `sdk-minimal` profile 是独立显式配置树,而不是 `dsh-base` 上的 overlay。使用 `profile="sdk-minimal"` 选择它;普通 `model` 参数是唯一运行时模型选择,也适用于不在适配器建议目录中的模型 ID。它提供按平台选择的持久 shell、`read_image`、本地执行、JSONL 会话和自动压缩。文本文件工具、设置、托管凭据、遥测、Web 工具与完整默认工具清单仍由独立的完整 `sdk` 与 `web` profile 提供。`sdk-minimal` profile 将不支持的斜杠输入保留在普通提示词路径上。
## 原生用户问答
@@ -149,4 +149,4 @@ with DeepSeekHarness(
另见 [Python 教程](../../docs/user/guide/python-sdk.zh.md)、[可运行示例](examples/README.zh.md) 和 [运行时 wheel 包参考](../sdk-runtime/README.zh.md)。
-`Session.get_working_directory()` 读取有效工作目录;`get_workspace_root()` 读取该目录所在的工作区根;`set_working_directory(path)` 修改目录并返回校验后的绝对路径。每个方法都可创建未知 Session,而不运行模型轮次。相对路径以该 Session 当前目录解析。起始目录元数据、权限与已有进程保持不变。底层客户端提供同名方法,并以 `session_id` 作为首个参数。
+`Session.get_working_directory()` 读取有效工作目录;`set_working_directory(path)` 修改目录并返回校验后的绝对路径。两者都可创建未知 Session,而不运行模型轮次。相对路径以该 Session 当前目录解析。起始目录元数据、权限与已有进程保持不变。底层客户端提供同名方法,并以 `session_id` 作为首个参数。
diff --git a/python/sdk/examples/README.i18n.yaml b/python/sdk/examples/README.i18n.yaml
index 14d0728648..6012598c26 100644
--- a/python/sdk/examples/README.i18n.yaml
+++ b/python/sdk/examples/README.i18n.yaml
@@ -6,8 +6,8 @@
en: c97ffc5ce0f7db05
zh: bdd91202075498a3
/python-sdk-example/run-the-minimal-agent:
- en: ac09bb6bc3ab76a0
- zh: e69d1e2bd796f3bf
+ en: 9807fc909be30878
+ zh: 9cef470f85212250
/python-sdk-example/compact-a-full-sdk-session:
en: 6325ac9aaf9b9b67
zh: 004a0ba5c2ff341b
diff --git a/python/sdk/examples/README.md b/python/sdk/examples/README.md
index 3c6a4b5faf..64d20aacd8 100644
--- a/python/sdk/examples/README.md
+++ b/python/sdk/examples/README.md
@@ -23,7 +23,6 @@ The shipped [`@deepseek-ai/dsh-sdk-minimal` bundle](../../../packages/bundle/sdk
- owner-scoped persistent `bash` on Linux/macOS or `pwsh` on Windows
- `read_image` for PNG/JPEG/WebP/GIF files, with an image-capable model
-- `working_directory` to inspect or change the Session directory
The bundle does not include `dsh-base`, so every additional row is an explicit profile change. Runtime context, text file tools, local instruction discovery, settings, managed credentials, telemetry, Web tools, subagents, and the full default tool roster are absent. The tree retains SDK startup and JSON-RPC serving, one environment-configured DeepSeek adapter, local execution, and JSONL persistence. [Automatic context compaction](../../../packages/bundle/sdk-minimal/README.md#model-experience) summarizes older history through an additional model request while preserving the complete log. This minimal composition leaves unsupported slash input on the ordinary prompt path.
diff --git a/python/sdk/examples/README.zh.md b/python/sdk/examples/README.zh.md
index 679301d7ff..c1d5801f8f 100644
--- a/python/sdk/examples/README.zh.md
+++ b/python/sdk/examples/README.zh.md
@@ -23,7 +23,6 @@ python python/sdk/examples/minimal.py \
- Linux/macOS 上所有者作用域内的持久 `bash`,或 Windows 上的 `pwsh`
- 配合支持图片输入的模型读取 PNG/JPEG/WebP/GIF 文件的 `read_image`
-- 查询或修改 Session 目录的 `working_directory`
该组合包不包含 `dsh-base`,因此每一个新增配置项都是显式 profile 变更。运行时上下文、文本文件工具、本地指令发现、设置、托管凭据、遥测、Web 工具、subagent 与完整默认工具清单均不存在。配置树保留 SDK 启动与 JSON-RPC 服务、一个由环境配置的 DeepSeek 适配器、本地执行和 JSONL 持久化。[自动上下文压缩](../../../packages/bundle/sdk-minimal/README.zh.md#model-experience)通过额外模型请求生成较早历史的摘要,同时保留完整日志。这个最小组合将不支持的斜杠输入保留在普通提示词路径上。
diff --git a/python/sdk/src/deepseek_harness/api.py b/python/sdk/src/deepseek_harness/api.py
index 659fdb8937..fdf46e1bfa 100644
--- a/python/sdk/src/deepseek_harness/api.py
+++ b/python/sdk/src/deepseek_harness/api.py
@@ -206,11 +206,6 @@ class Session:
self.harness.start()
return self.harness.client.get_working_directory(self.id)
- def get_workspace_root(self) -> str:
- """Read the workspace root the effective directory is in, recovering a missing directory first."""
- self.harness.start()
- return self.harness.client.get_workspace_root(self.id)
-
def set_working_directory(self, path: str) -> str:
"""Change the effective directory while existing processes retain their own directories."""
self.harness.start()
diff --git a/python/sdk/src/deepseek_harness/client.py b/python/sdk/src/deepseek_harness/client.py
index eaf7825a12..2717eb85c8 100644
--- a/python/sdk/src/deepseek_harness/client.py
+++ b/python/sdk/src/deepseek_harness/client.py
@@ -249,15 +249,6 @@ class HarnessClient:
)
return response.cwd
- def get_workspace_root(self, session_id: str) -> str:
- """Read the workspace root the effective directory is in, recovering a missing directory first."""
- response = self.request(
- "session/working-directory/get",
- {"sessionId": session_id},
- response_model=_WorkingDirectoryResponse,
- )
- return response.root
-
def set_working_directory(self, session_id: str, path: str) -> str:
"""Enter an absolute or Session-relative directory without changing origin or permissions."""
response = self.request(
@@ -726,7 +717,6 @@ class _SessionPromptResponse(BaseModel):
class _WorkingDirectoryResponse(BaseModel):
cwd: str
- root: str
class _EmptyResponse(BaseModel):
diff --git a/python/sdk/tests/test_working_directory.py b/python/sdk/tests/test_working_directory.py
index a7901bc271..3d46793af2 100644
--- a/python/sdk/tests/test_working_directory.py
+++ b/python/sdk/tests/test_working_directory.py
@@ -31,13 +31,13 @@ for line in sys.stdin:
print(json.dumps({'jsonrpc': '2.0', 'id': frame['id'], 'result': {}}), flush=True)
break
elif method == 'session/working-directory/get':
- result = {'cwd': directories.get(params['sessionId'], origin), 'root': origin}
+ result = {'cwd': directories.get(params['sessionId'], origin)}
elif method == 'session/working-directory/set':
assert not os.path.isabs(params['path']), 'client must preserve relative paths'
previous = directories.get(params['sessionId'], origin)
current = os.path.normpath(os.path.join(previous, params['path']))
directories[params['sessionId']] = current
- result = {'cwd': 7 if params['path'] == 'malformed' else current, 'root': origin}
+ result = {'cwd': 7 if params['path'] == 'malformed' else current}
else:
raise AssertionError(method)
print(json.dumps({'jsonrpc': '2.0', 'id': frame['id'], 'result': result}), flush=True)
@@ -49,7 +49,6 @@ for line in sys.stdin:
assert first.get_working_directory() == str(tmp_path)
assert first.set_working_directory("child") == str(tmp_path / "child")
assert first.get_working_directory() == str(tmp_path / "child")
- assert first.get_workspace_root() == str(tmp_path)
assert second.get_working_directory() == str(tmp_path)
with pytest.raises(ValidationError):
second.set_working_directory("malformed")
diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts
index 1c223983eb..88fc939459 100644
--- a/scripts/gen-cordis-catalog.ts
+++ b/scripts/gen-cordis-catalog.ts
@@ -415,9 +415,6 @@ export const LINK_MAP: Readonly> = {
WorktreeCleanup: 'worktrees.md',
WorktreeCreation: 'worktrees.md',
RestoredWorktree: 'worktrees.md',
- RelocateOptions: 'working-directory.md',
- InheritOptions: 'working-directory.md',
- RelocatedDirectories: 'working-directory.md',
ChangeRequestListener: 'forge.md',
ChangeRequestRef: 'forge.md',
ChangeRequestSnapshot: 'forge.md',
diff --git a/scripts/gen-doc-graphs.ts b/scripts/gen-doc-graphs.ts
index 9ce18957e5..0e4d227c61 100644
--- a/scripts/gen-doc-graphs.ts
+++ b/scripts/gen-doc-graphs.ts
@@ -233,8 +233,8 @@ const SERVICE_ROLES: ServiceRole[] = [
title: 'Session working directory',
mode: 'seam',
implementations: ['working-directory'],
- consumers: ['tool-working-directory', 'tool-fs', 'tool-bash', 'tool-pwsh', 'subagent', 'sdk-jsonrpc-server'],
- note: 'Two Session projections own the effective execution directory and the workspace root it is in. The filesystem validates changes; user context reports them while original metadata and write grants stay fixed.',
+ consumers: ['tool-fs', 'tool-bash', 'tool-pwsh', 'subagent', 'sdk-jsonrpc-server'],
+ note: 'Two Session projections own the effective execution directory and the workspace root; Host operations move both together. The filesystem validates changes; user context reports them while original metadata and write grants stay fixed.',
},
{
key: 'mcpResources',
diff --git a/scripts/gen-tool-catalog.ts b/scripts/gen-tool-catalog.ts
index 7ca0a5d54f..e3fa1efa35 100644
--- a/scripts/gen-tool-catalog.ts
+++ b/scripts/gen-tool-catalog.ts
@@ -32,7 +32,6 @@ import { PwshLocalExecutor } from '@deepseek-ai/dsh-pwsh-local'
import LocalSubprocessRuntime from '@deepseek-ai/dsh-subprocess-local'
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
import WorkingDirectory from '@deepseek-ai/dsh-working-directory'
-import * as ToolWorkingDirectory from '@deepseek-ai/dsh-tool-working-directory'
import * as ToolWorktree from '@deepseek-ai/dsh-experimental-tool-worktree'
import { AttachmentStore } from '@deepseek-ai/dsh-attachment'
import type { ImageAttachmentLimits, ImageAttachmentRef, SaveImageAttachment, StoredImageAttachment } from '@deepseek-ai/dsh-attachment'
@@ -696,17 +695,6 @@ const TOOL_PACKAGES: ToolPackage[] = [
note:
'todo_write is session-owned state; UIs render the latest todo/write event as a checklist. `allowParallelInProgress` is required with no default, so the catalog states its choice: `true`, whose description invites several `in_progress` items. A deployment choosing `false` receives the same tool with a description asking for exactly one active task.',
},
- {
- pkg: '@deepseek-ai/dsh-tool-working-directory',
- dir: 'tool-working-directory',
- source: 'packages/session/tool-working-directory/src/index.ts',
- requires: ['ctx.tools', 'ctx.workingDirectory'],
- writes: ['tool/call', 'working-directory/change', 'user context for directory changes', 'tool/result'],
- async mount(ctx) {
- await ctx.plugin(ToolWorkingDirectory)
- },
- note: 'Reads or changes the calling Session directory. Existing shells and processes retain their own directories; origin metadata and permission roots stay fixed.',
- },
{
pkg: '@deepseek-ai/dsh-experimental-tool-worktree',
dir: 'tool-worktree',
@@ -716,10 +704,11 @@ const TOOL_PACKAGES: ToolPackage[] = [
async mount(ctx) {
ctx.provide('worktrees', {
create: () => Promise.reject(new Error('gen-tool-catalog: worktree creation is unavailable during schema harvest')),
+ exit: () => Promise.reject(new Error('gen-tool-catalog: leaving a worktree is unavailable during schema harvest')),
})
await ctx.plugin(ToolWorktree)
},
- note: 'Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. Leaving retains the branch and checkout.',
+ note: 'Enabled through the Change requests & worktrees bundle on Web and Desktop; other profiles can select the standalone bundle. Creates a new branch and checkout from a pinned local commit under existing write permissions, then changes the Session directory. `exit_worktree` returns the Session to the source checkout; the branch and checkout remain.',
},
{
pkg: '@deepseek-ai/dsh-tool-workflow',
diff --git a/scripts/snapshots/python-sdk-single-exe/advanced/result.json b/scripts/snapshots/python-sdk-single-exe/advanced/result.json
index 8aaf44b0b6..5be9355faf 100644
--- a/scripts/snapshots/python-sdk-single-exe/advanced/result.json
+++ b/scripts/snapshots/python-sdk-single-exe/advanced/result.json
@@ -209,8 +209,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "initial"
@@ -305,8 +304,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "series"
@@ -1771,8 +1769,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "initial"
@@ -1897,8 +1894,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "series"
@@ -3242,8 +3238,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "initial"
@@ -4260,8 +4255,7 @@
"job_output",
"snapshot_double",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
"reason": "initial"
diff --git a/scripts/snapshots/python-sdk-single-exe/advanced/session.1.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/advanced/session.1.v4.jsonl
index ee9fbfd3cb..3f18e9318d 100644
--- a/scripts/snapshots/python-sdk-single-exe/advanced/session.1.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/advanced/session.1.v4.jsonl
@@ -21,7 +21,7 @@
{"type":"user/message","data":{"id":"{{messageId}}","role":"user","content":[{"type":"text","text":"Serial agent creation completed."}],"source":{"kind":"plugin:serial-created-fixture"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Reply with exactly DIRECT_CHILD_OK and nothing else."},{"type":"text","text":"Your final answer is delivered automatically if your parent is still online. Include the result and relevant evidence in that answer; the parent does not receive your full transcript, tool output, or reasoning. If your last action is a message to your parent, the completion notice omits your final answer; include the result and relevant evidence in that message."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","reasoningEffort":"high","maxTokens":256000},"adapterDefaults":{"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","reasoningEffort":"high","maxTokens":256000},"adapterDefaults":{"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Reply with exactly DIRECT_CHILD_OK and","messageSeqs":[20],"source":{"kind":"fallback"}}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{child-1}}","sessionFormatVersion":4,"throughSeq":24}}
diff --git a/scripts/snapshots/python-sdk-single-exe/advanced/session.2.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/advanced/session.2.v4.jsonl
index 6fb5ebae1f..d985128bc5 100644
--- a/scripts/snapshots/python-sdk-single-exe/advanced/session.2.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/advanced/session.2.v4.jsonl
@@ -21,7 +21,7 @@
{"type":"user/message","data":{"id":"{{messageId}}","role":"user","content":[{"type":"text","text":"Serial agent creation completed."}],"source":{"kind":"plugin:serial-created-fixture"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Reply with exactly WORKFLOW_CHILD_OK and nothing else."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nDelegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly.\n\nYou are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"tool:subagent:depth","text":"Delegation depth for `subagent`: current 1, maximum 1, remaining levels 0. Do not call `subagent` at this depth; carry out the work directly."},{"name":"subagent:delegation","text":"You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","reasoningEffort":"high","maxTokens":256000},"adapterDefaults":{"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","reasoningEffort":"high","maxTokens":256000},"adapterDefaults":{"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Reply with exactly WORKFLOW_CHILD_OK and","messageSeqs":[20],"source":{"kind":"fallback"}}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{child-2}}","sessionFormatVersion":4,"throughSeq":24}}
diff --git a/scripts/snapshots/python-sdk-single-exe/advanced/session.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/advanced/session.v4.jsonl
index 89056ecd60..69fafccef7 100644
--- a/scripts/snapshots/python-sdk-single-exe/advanced/session.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/advanced/session.v4.jsonl
@@ -13,12 +13,12 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Run the advanced packaged-runtime snapshot scenario."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"id":"{{messageId}}","role":"user","content":[{"type":"image","attachment":{"attachmentId":"sha256:b1ff9c8ea3a780bad09b346c423d2d0e46815926879b18e841d928376a946640","mediaType":"image/png","width":1,"height":1,"bytes":69}}],"source":{"kind":"python-snapshot-image-offload"}},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Run the advanced packaged-runtime snapsh","messageSeqs":[11],"source":{"kind":"fallback"}}}
{"type":"assistant/attempt","data":{"turn":1,"step":1,"stream":[{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"error","failure":{"code":"IMAGE_OFFLOAD_REQUIRED","message":"authored image budget failure","offloadImages":1}}}}]}}
{"type":"image/offload","data":{"targets":[{"seq":13,"imageIndexes":[0]}]}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow","working_directory"]},"reason":"series"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","snapshot_double","subagent","workflow"]},"reason":"series"}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{parent}}","sessionFormatVersion":4,"throughSeq":19}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"advanced-native","name":"snapshot_double","arguments":"{\"value\": 21}"}],"source":{"kind":"model","provider":"deepseek-official","model":"smoke-model","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"smoke-model"},"blocks":[{"type":"tool-call"}]}},"id":"{{messageId}}"},"usage":{"inputTokens":3,"outputTokens":3,"totalTokens":6},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"advanced-native","name":"snapshot_double","args":[""]},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"advanced-native","args":["{\"value\": 21}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"advanced-native","name":"snapshot_double","arguments":"{\"value\": 21}"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":3,"outputTokens":3,"totalTokens":6}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"smoke-model"},"blocks":[{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"advanced-native","name":"snapshot_double","arguments":"{\"value\": 21}"}}
diff --git a/scripts/snapshots/python-sdk-single-exe/dynamic-tools/tool-history.json b/scripts/snapshots/python-sdk-single-exe/dynamic-tools/tool-history.json
index fd5e22c70b..f7aa8ad6d0 100644
--- a/scripts/snapshots/python-sdk-single-exe/dynamic-tools/tool-history.json
+++ b/scripts/snapshots/python-sdk-single-exe/dynamic-tools/tool-history.json
@@ -74,7 +74,6 @@
"web_fetch",
"web_search",
"workflow",
- "working_directory",
"write"
]
},
@@ -138,7 +137,6 @@
"web_fetch",
"web_search",
"workflow",
- "working_directory",
"write"
]
},
@@ -215,7 +213,6 @@
"web_fetch",
"web_search",
"workflow",
- "working_directory",
"write"
]
},
diff --git a/scripts/snapshots/python-sdk-single-exe/minimal/model-visible.json b/scripts/snapshots/python-sdk-single-exe/minimal/model-visible.json
index 0dd0ebd185..9332d33def 100644
--- a/scripts/snapshots/python-sdk-single-exe/minimal/model-visible.json
+++ b/scripts/snapshots/python-sdk-single-exe/minimal/model-visible.json
@@ -33,19 +33,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
@@ -98,19 +85,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
@@ -182,19 +156,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
diff --git a/scripts/snapshots/python-sdk-single-exe/minimal/win-x64/model-visible.json b/scripts/snapshots/python-sdk-single-exe/minimal/win-x64/model-visible.json
index b5c11870dc..761cb2c574 100644
--- a/scripts/snapshots/python-sdk-single-exe/minimal/win-x64/model-visible.json
+++ b/scripts/snapshots/python-sdk-single-exe/minimal/win-x64/model-visible.json
@@ -33,19 +33,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
@@ -98,19 +85,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
@@ -182,19 +156,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "input_schema": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"messages": [
diff --git a/scripts/snapshots/python-sdk-single-exe/restart/requests.json b/scripts/snapshots/python-sdk-single-exe/restart/requests.json
index fd7dbe76d1..52fb7eb0dd 100644
--- a/scripts/snapshots/python-sdk-single-exe/restart/requests.json
+++ b/scripts/snapshots/python-sdk-single-exe/restart/requests.json
@@ -24,8 +24,7 @@
"job_list",
"job_output",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
},
{
@@ -53,8 +52,7 @@
"job_list",
"job_output",
"subagent",
- "workflow",
- "working_directory"
+ "workflow"
]
}
]
diff --git a/scripts/snapshots/python-sdk-single-exe/restart/session.1.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/restart/session.1.v4.jsonl
index 5da4064245..142e504912 100644
--- a/scripts/snapshots/python-sdk-single-exe/restart/session.1.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/restart/session.1.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{messageId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Complete the first isolated Python SDK process turn."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Complete the first isolated Python","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session-1}}","sessionFormatVersion":4,"throughSeq":12}}
diff --git a/scripts/snapshots/python-sdk-single-exe/restart/session.2.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/restart/session.2.v4.jsonl
index 1af63d30a7..36156b8503 100644
--- a/scripts/snapshots/python-sdk-single-exe/restart/session.2.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/restart/session.2.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{messageId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Complete the second isolated Python SDK process turn."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Complete the second isolated Python","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session-2}}","sessionFormatVersion":4,"throughSeq":12}}
diff --git a/scripts/snapshots/python-sdk-single-exe/scheduler-recovery/session.v4.jsonl b/scripts/snapshots/python-sdk-single-exe/scheduler-recovery/session.v4.jsonl
index 11cf3816b9..d825f323da 100644
--- a/scripts/snapshots/python-sdk-single-exe/scheduler-recovery/session.v4.jsonl
+++ b/scripts/snapshots/python-sdk-single-exe/scheduler-recovery/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{messageId}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Run three todo updates; the scheduler will reject the second call."}],"source":{"kind":"user"},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{messageId}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","todo_write","workflow","working_directory"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"smoke-model","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["cordis_inspect_list","cordis_inspect_query","job_kill","job_list","job_output","subagent","todo_write","workflow"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"smoke-model","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Run three todo updates; the","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"scheduler-complete","name":"todo_write","arguments":"{\"todos\": []}"},{"type":"tool-call","id":"scheduler-fail","name":"todo_write","arguments":"{\"todos\": []}"},{"type":"tool-call","id":"scheduler-unstarted","name":"todo_write","arguments":"{\"todos\": []}"}],"source":{"kind":"model","provider":"deepseek-official","model":"smoke-model","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"smoke-model"},"blocks":[{"type":"tool-call"},{"type":"tool-call"},{"type":"tool-call"}]}},"id":"{{messageId}}"},"usage":{"inputTokens":3,"outputTokens":3,"totalTokens":6},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"scheduler-complete","name":"todo_write","args":[""]},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"scheduler-complete","args":["{\"todos\": []}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"scheduler-complete","name":"todo_write","arguments":"{\"todos\": []}"}}},{"type":"chunk","time":0,"chunk":{"type":"block-start","index":1,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":1,"dt":[],"id":"scheduler-fail","name":"todo_write","args":[""]},{"type":"tool-call-chunks","time0":0,"index":1,"dt":[],"id":"scheduler-fail","args":["{\"todos\": []}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":1,"block":{"type":"tool-call","id":"scheduler-fail","name":"todo_write","arguments":"{\"todos\": []}"}}},{"type":"chunk","time":0,"chunk":{"type":"block-start","index":2,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":2,"dt":[],"id":"scheduler-unstarted","name":"todo_write","args":[""]},{"type":"tool-call-chunks","time0":0,"index":2,"dt":[],"id":"scheduler-unstarted","args":["{\"todos\": []}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":2,"block":{"type":"tool-call","id":"scheduler-unstarted","name":"todo_write","arguments":"{\"todos\": []}"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":3,"outputTokens":3,"totalTokens":6}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"smoke-model"},"blocks":[{"type":"tool-call"},{"type":"tool-call"},{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
diff --git a/scripts/type-equiv.manifest.json b/scripts/type-equiv.manifest.json
index ebbcadba0f..05d5355dcc 100644
--- a/scripts/type-equiv.manifest.json
+++ b/scripts/type-equiv.manifest.json
@@ -2422,21 +2422,6 @@
"symbol": "CreatedWorktree",
"source": "packages/experimental/worktree/src/types.ts"
},
- {
- "doc": "docs/subsystems/working-directory.md",
- "symbol": "RelocateOptions",
- "source": "packages/session/working-directory/src/index.ts"
- },
- {
- "doc": "docs/subsystems/working-directory.md",
- "symbol": "InheritOptions",
- "source": "packages/session/working-directory/src/index.ts"
- },
- {
- "doc": "docs/subsystems/working-directory.md",
- "symbol": "RelocatedDirectories",
- "source": "packages/session/working-directory/src/index.ts"
- },
{
"doc": "docs/subsystems/forge.md",
"symbol": "ForgeRepository",
diff --git a/snapshots/sdk/background-wait-steer/tool-schemas.expected.json b/snapshots/sdk/background-wait-steer/tool-schemas.expected.json
index 3c3f4d2cc9..c329b06d17 100644
--- a/snapshots/sdk/background-wait-steer/tool-schemas.expected.json
+++ b/snapshots/sdk/background-wait-steer/tool-schemas.expected.json
@@ -553,10 +553,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -582,10 +578,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -815,19 +807,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/command-attachments/tool-schemas.expected.json b/snapshots/sdk/command-attachments/tool-schemas.expected.json
index 85bc6d2cf7..2b5634c938 100644
--- a/snapshots/sdk/command-attachments/tool-schemas.expected.json
+++ b/snapshots/sdk/command-attachments/tool-schemas.expected.json
@@ -630,10 +630,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -659,10 +655,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -892,19 +884,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/desktop-context/tool-schemas.expected.json b/snapshots/sdk/desktop-context/tool-schemas.expected.json
index 1209423422..793cac5125 100644
--- a/snapshots/sdk/desktop-context/tool-schemas.expected.json
+++ b/snapshots/sdk/desktop-context/tool-schemas.expected.json
@@ -614,10 +614,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -643,10 +639,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -876,19 +868,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/desktop-ptc-context/system-prompt.expected.md b/snapshots/sdk/desktop-ptc-context/system-prompt.expected.md
index 98d3bca7f1..9389c8b576 100644
--- a/snapshots/sdk/desktop-ptc-context/system-prompt.expected.md
+++ b/snapshots/sdk/desktop-ptc-context/system-prompt.expected.md
@@ -265,8 +265,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -276,8 +274,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -354,11 +350,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -1592,10 +1583,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/sdk/dynamic-tool-updates/notifications.expected.jsonl b/snapshots/sdk/dynamic-tool-updates/notifications.expected.jsonl
index 252ed9695e..dd3915c5f8 100644
--- a/snapshots/sdk/dynamic-tool-updates/notifications.expected.jsonl
+++ b/snapshots/sdk/dynamic-tool-updates/notifications.expected.jsonl
@@ -7,7 +7,7 @@
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":10,"time":0,"data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
-{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":11,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}}}
+{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":11,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/context","seq":12,"time":0,"data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"session/title","seq":13,"time":0,"data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"assistant/message","seq":14,"time":0,"data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}}}
@@ -15,14 +15,14 @@
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"tool/result","seq":16,"time":0,"data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_task_read"},"toolCallId":"call_task_read","content":[{"type":"text","text":"{{cwd}}/task.txt\nfile\n\n1: Reply with the single word DONE after reading this file.\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{sessionId}}"},"meta":{"path":"{{cwd}}/task.txt","offset":1,"lines":[{"number":1,"text":"Reply with the single word DONE after reading this file."}],"totalLines":1}},"sourceEventSeqs":[15],"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/end","seq":17,"time":0,"data":{"turn":1,"step":1}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/start","seq":18,"time":0,"data":{"turn":1,"step":2}}}}
-{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":19,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}}}
+{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":19,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"developer/message","seq":20,"time":0,"data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{sessionId}}"},"headerSeq":19},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"assistant/message","seq":21,"time":0,"data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"tool/call","seq":22,"time":0,"data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"tool/result","seq":23,"time":0,"data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_dynamic_ping"},"toolCallId":"call_dynamic_ping","content":[{"type":"text","text":"pong"}],"isError":false,"id":"{{sessionId}}"}},"sourceEventSeqs":[22],"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/end","seq":24,"time":0,"data":{"turn":1,"step":2}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/start","seq":25,"time":0,"data":{"turn":1,"step":3}}}}
-{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":26,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}}}
+{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":26,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"developer/message","seq":27,"time":0,"data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{sessionId}}"}},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"assistant/message","seq":28,"time":0,"data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":0,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":0,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/end","seq":29,"time":0,"data":{"turn":1,"step":3}}}}
diff --git a/snapshots/sdk/dynamic-tool-updates/session.v4.jsonl b/snapshots/sdk/dynamic-tool-updates/session.v4.jsonl
index 9731e89b0b..5736fb6019 100644
--- a/snapshots/sdk/dynamic-tool-updates/session.v4.jsonl
+++ b/snapshots/sdk/dynamic-tool-updates/session.v4.jsonl
@@ -10,7 +10,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793796109297,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796109297,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":1793796109297,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":1793796109297,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793796109297,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,14 +18,14 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_task_read"},"toolCallId":"call_task_read","content":[{"type":"text","text":"{{cwd}}/task.txt\nfile\n\n1: Reply with the single word DONE after reading this file.\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:6}}"},"meta":{"path":"{{cwd}}/task.txt","offset":1,"lines":[{"number":1,"text":"Reply with the single word DONE after reading this file."}],"totalLines":1}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1793796109316,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796109316,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":1793796109316,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":1793796109316,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_dynamic_ping"},"toolCallId":"call_dynamic_ping","content":[{"type":"text","text":"pong"}],"isError":false,"id":"{{message:9}}"}},"sourceEventSeqs":[22],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:10}}"}},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:11}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1793796109334,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1793796109334,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1793796109334,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1793796109334,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1793796109334,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
diff --git a/snapshots/sdk/minimal-image-compaction/tool-schemas.expected.json b/snapshots/sdk/minimal-image-compaction/tool-schemas.expected.json
index ded9dfa451..bbb88e7217 100644
--- a/snapshots/sdk/minimal-image-compaction/tool-schemas.expected.json
+++ b/snapshots/sdk/minimal-image-compaction/tool-schemas.expected.json
@@ -31,19 +31,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": [
@@ -79,19 +66,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
[
@@ -126,19 +100,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
]
]
diff --git a/snapshots/sdk/persistent-tools/tool-schemas.expected.json b/snapshots/sdk/persistent-tools/tool-schemas.expected.json
index f3c7affe00..73234c5e49 100644
--- a/snapshots/sdk/persistent-tools/tool-schemas.expected.json
+++ b/snapshots/sdk/persistent-tools/tool-schemas.expected.json
@@ -100,19 +100,6 @@
"path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": []
diff --git a/snapshots/sdk/plan-review/session.v4.jsonl b/snapshots/sdk/plan-review/session.v4.jsonl
index 064eee20d6..b9afe065b8 100644
--- a/snapshots/sdk/plan-review/session.v4.jsonl
+++ b/snapshots/sdk/plan-review/session.v4.jsonl
@@ -11,7 +11,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Time sampled while preparing turn 1, step 1: 2026-10-16T00:00:00+00:00[UTC]\nBrowser time zone for this request: unavailable. Ask the user to clarify otherwise-unqualified dates and times.\nElapsed since the preceding model-visible message: unavailable."}],"source":{"kind":"time-context","form":"snapshot","sections":[{"name":"time-context","text":"Time sampled while preparing turn 1, step 1: 2026-10-16T00:00:00+00:00[UTC]\nBrowser time zone for this request: unavailable. Ask the user to clarify otherwise-unqualified dates and times.\nElapsed since the preceding model-visible message: unavailable."}]},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Reply SDK_PLAN_INITIAL without tools.","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session:1}}","sessionFormatVersion":4,"throughSeq":14}}
@@ -29,7 +29,7 @@
{"type":"system/message","data":{"turn":2,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:9}}"}},"sourceEventSeqs":[7],"surfaceOp":{"op":"replace","startSeq":7,"endSeq":7}}
{"type":"user/message","data":{"content":[{"type":"text","text":"The user switched this session to plan mode."}],"source":{"kind":"plan-mode","form":"notice","summary":"The user switched this session to plan mode."},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Prepare a plan through exit_plan_mode; revise after feedback and acknowledge approval."}],"source":{"kind":"user"},"role":"user","id":"{{message:8}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change","startsSeries":true}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change","startsSeries":true}}
{"type":"developer/message","data":{"turn":2,"step":1,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"exit_plan_mode"}],"role":"developer","id":"{{message:10}}"},"headerSeq":30},"surfaceOp":"append"}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session:1}}","sessionFormatVersion":4,"throughSeq":31}}
{"type":"assistant/message","data":{"turn":2,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"commands-tool-1","name":"exit_plan_mode","arguments":"{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"tool-call"}]}},"id":"{{message:11}}"},"usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032},"stream":[{"type":"chunk","time":1792108800000,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1792108800000,"index":0,"dt":[],"id":"commands-tool-1","name":"exit_plan_mode","args":[""]},{"type":"tool-call-chunks","time0":1792108800000,"index":0,"dt":[],"id":"commands-tool-1","args":["{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"]},{"type":"chunk","time":1792108800000,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"commands-tool-1","name":"exit_plan_mode","arguments":"{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"usage","usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
@@ -45,7 +45,7 @@
{"type":"plan/mode","data":{"active":false}}
{"type":"step/start","data":{"turn":2,"step":3}}
{"type":"system/message","data":{"turn":2,"step":3,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:15}}"}},"sourceEventSeqs":[27],"surfaceOp":{"op":"replace","startSeq":27,"endSeq":27}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"series"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"series"}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session:1}}","sessionFormatVersion":4,"throughSeq":46}}
{"type":"assistant/message","data":{"turn":2,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"SDK_PLAN_APPROVED"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"text"}]}},"id":"{{message:16}}"},"usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032},"stream":[{"type":"chunk","time":1792108800000,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1792108800000,"index":0,"dt":[],"texts":["SDK_PLAN_APPROVED"]},{"type":"chunk","time":1792108800000,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"SDK_PLAN_APPROVED"}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"usage","usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"finish","reason":{"kind":"stop"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"text"}]}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":2,"step":3}}
@@ -62,7 +62,7 @@
{"type":"system/message","data":{"turn":3,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:19}}"}},"sourceEventSeqs":[45],"surfaceOp":{"op":"replace","startSeq":45,"endSeq":45}}
{"type":"user/message","data":{"content":[{"type":"text","text":"The user switched this session to plan mode."}],"source":{"kind":"plan-mode","form":"notice","summary":"The user switched this session to plan mode."},"role":"user","id":"{{message:17}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Present another plan for review."}],"source":{"kind":"user"},"role":"user","id":"{{message:18}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"series"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"series"}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session:1}}","sessionFormatVersion":4,"throughSeq":63}}
{"type":"assistant/message","data":{"turn":3,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"commands-tool-4","name":"exit_plan_mode","arguments":"{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"tool-call"}]}},"id":"{{message:20}}"},"usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032},"stream":[{"type":"chunk","time":1792108800000,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1792108800000,"index":0,"dt":[],"id":"commands-tool-4","name":"exit_plan_mode","args":[""]},{"type":"tool-call-chunks","time0":1792108800000,"index":0,"dt":[],"id":"commands-tool-4","args":["{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"]},{"type":"chunk","time":1792108800000,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"commands-tool-4","name":"exit_plan_mode","arguments":"{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"usage","usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":3,"step":1,"callId":"commands-tool-4","name":"exit_plan_mode","arguments":"{\"plan\": \"# Implement the change\\n\\n- Inspect existing code.\\n- Make the smallest change.\\n- Run focused tests.\"}"}}
@@ -81,7 +81,7 @@
{"type":"system/message","data":{"turn":4,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:24}}"}},"sourceEventSeqs":[60],"surfaceOp":{"op":"replace","startSeq":60,"endSeq":60}}
{"type":"user/message","data":{"content":[{"type":"text","text":"The user switched this session back to the default mode."}],"source":{"kind":"plan-mode","form":"notice","summary":"The user switched this session back to the default mode."},"role":"user","id":"{{message:22}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Reply SDK_PLAN_OK without tools."}],"source":{"kind":"user"},"role":"user","id":"{{message:23}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"series"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","exit_plan_mode","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"series"}}
{"type":"session-log-deepseek/delivery-accepted","data":{"sessionId":"{{session:1}}","sessionFormatVersion":4,"throughSeq":82}}
{"type":"assistant/message","data":{"turn":4,"step":1,"message":{"role":"assistant","content":[{"type":"text","text":"SDK_PLAN_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"text"}]}},"id":"{{message:25}}"},"usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032},"stream":[{"type":"chunk","time":1792108800000,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1792108800000,"index":0,"dt":[],"texts":["SDK_PLAN_OK"]},{"type":"chunk","time":1792108800000,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"SDK_PLAN_OK"}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"usage","usage":{"inputTokens":10000,"outputTokens":32,"totalTokens":10032}}},{"type":"chunk","time":1792108800000,"chunk":{"type":"finish","reason":{"kind":"stop"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"text"}]}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":4,"step":1}}
diff --git a/snapshots/sdk/plan-review/tool-schemas.expected.json b/snapshots/sdk/plan-review/tool-schemas.expected.json
index 07f6cdbbe1..b46e2ca775 100644
--- a/snapshots/sdk/plan-review/tool-schemas.expected.json
+++ b/snapshots/sdk/plan-review/tool-schemas.expected.json
@@ -614,10 +614,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -643,10 +639,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -876,19 +868,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1555,10 +1534,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1584,10 +1559,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1817,19 +1788,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -2495,10 +2453,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -2524,10 +2478,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -2757,19 +2707,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -3435,10 +3372,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -3464,10 +3397,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -3697,19 +3626,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -4375,10 +4291,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -4404,10 +4316,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -4637,19 +4545,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/ptc-cancel/cancel.mjs b/snapshots/sdk/ptc-cancel/cancel.mjs
index ea2191874d..42bdabdddc 100644
--- a/snapshots/sdk/ptc-cancel/cancel.mjs
+++ b/snapshots/sdk/ptc-cancel/cancel.mjs
@@ -1,9 +1,9 @@
-/** Cancel after the PTC process completes a nested working_directory call. */
+/** Cancel after the PTC process completes a nested job_list call. */
export const name = 'ptc-cancel-fixture'
export const inject = ['tools']
export function apply(ctx) {
ctx.on('tools/result', (exec) => {
- if (exec.name === 'working_directory' && exec.parent !== undefined && exec.agent !== undefined) {
+ if (exec.name === 'job_list' && exec.parent !== undefined && exec.agent !== undefined) {
exec.agent.cancel({ kind: 'user' })
}
})
diff --git a/snapshots/sdk/ptc-cancel/session.v4.jsonl b/snapshots/sdk/ptc-cancel/session.v4.jsonl
index 2587a23b40..08c8bd59a1 100644
--- a/snapshots/sdk/ptc-cancel/session.v4.jsonl
+++ b/snapshots/sdk/ptc-cancel/session.v4.jsonl
@@ -2,21 +2,21 @@
{"type":"permission/preset","data":{"preset":"danger-full-access"}}
{"type":"sandbox/mode","data":{"mode":"danger-full-access"}}
{"type":"approval/policy","data":{"policy":"never"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Start a run_code program, call working_directory, then keep running until I stop it."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
+{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Start a run_code program, call job_list, then keep running until I stop it."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"Start a run_code program, call working_directory, then keep running until I stop it."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"Start a run_code program, call job_list, then keep running until I stop it."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Start a run_code program, call","messageSeqs":[8],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.working_directory({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"stream":[{"type":"chunk","time":1793796116464,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796116464,"index":0,"dt":[],"id":"ptc-cancel","name":"run_code","args":["{\"code\":\"await tools.working_directory({}); for (;;) {}\",\"description\":\"Run until stopped\"}"]},{"type":"chunk","time":1793796116464,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.working_directory({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}}},{"type":"chunk","time":1793796116464,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":1,"callId":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.working_directory({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}}
-{"type":"tool/ptc-dispatch-start","data":{"rootCallId":"ptc-cancel","parentCallId":"ptc-cancel","subCallId":"ptc-cancel:ptc:1","name":"working_directory","arguments":{}}}
-{"type":"tool/ptc-dispatch","data":{"rootCallId":"ptc-cancel","parentCallId":"ptc-cancel","subCallId":"ptc-cancel:ptc:1","name":"working_directory","arguments":{},"isError":false,"content":[{"type":"text","text":"{{cwd}}"}]}}
+{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.job_list({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"stream":[{"type":"chunk","time":1793796116464,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796116464,"index":0,"dt":[],"id":"ptc-cancel","name":"run_code","args":["{\"code\":\"await tools.job_list({}); for (;;) {}\",\"description\":\"Run until stopped\"}"]},{"type":"chunk","time":1793796116464,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.job_list({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}}},{"type":"chunk","time":1793796116464,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":1,"callId":"ptc-cancel","name":"run_code","arguments":"{\"code\":\"await tools.job_list({}); for (;;) {}\",\"description\":\"Run until stopped\"}"}}
+{"type":"tool/ptc-dispatch-start","data":{"rootCallId":"ptc-cancel","parentCallId":"ptc-cancel","subCallId":"ptc-cancel:ptc:1","name":"job_list","arguments":{}}}
+{"type":"tool/ptc-dispatch","data":{"rootCallId":"ptc-cancel","parentCallId":"ptc-cancel","subCallId":"ptc-cancel:ptc:1","name":"job_list","arguments":{},"isError":false,"content":[{"type":"text","text":"(no background jobs)"}]}}
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"ptc-cancel"},"toolCallId":"ptc-cancel","content":[{"type":"text","text":"Error: tool call aborted"}],"isError":true,"id":"{{message:6}}"},"error":{"name":"AbortError","code":"ABORTED"}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"aborted","reason":{"kind":"user"}}}}
diff --git a/snapshots/sdk/sdk.snapshot.ts b/snapshots/sdk/sdk.snapshot.ts
index f231d3a8d4..cac9e9292c 100644
--- a/snapshots/sdk/sdk.snapshot.ts
+++ b/snapshots/sdk/sdk.snapshot.ts
@@ -205,7 +205,7 @@ const SDK_ASSERTIONS: Readonly> = {
},
'minimal-image-compaction': {
expectedFinalResponse: 'MINIMAL_IMAGE_OK',
- expectedTools: { bash: ['command'], read_image: ['file_path'], working_directory: [] },
+ expectedTools: { bash: ['command'], read_image: ['file_path'] },
},
'session-title-stability': { waitForProviderTitle: true },
'dynamic-tool-updates': {
@@ -247,7 +247,7 @@ const SDK_ASSERTIONS: Readonly> = {
},
'persistent-tools': {
environment: { DSH_SYSTEM_PROMPT: MINIMAL_SYSTEM_PROMPT },
- expectedTools: { bash: ['command'], str_replace_editor: ['command', 'path'], working_directory: [] },
+ expectedTools: { bash: ['command'], str_replace_editor: ['command', 'path'] },
expectedSystem: MINIMAL_SYSTEM_PROMPT,
expectedToolDescriptions: { bash: MINIMAL_BASH_DESCRIPTION },
runtimeContext: {
diff --git a/snapshots/sdk/subagent-activation-limit/tool-schemas.1.expected.json b/snapshots/sdk/subagent-activation-limit/tool-schemas.1.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/sdk/subagent-activation-limit/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-activation-limit/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-continuable-inheritance/tool-schemas.1.expected.json b/snapshots/sdk/subagent-continuable-inheritance/tool-schemas.1.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/sdk/subagent-continuable-inheritance/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-continuable-inheritance/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-continuable/tool-schemas.1.expected.json b/snapshots/sdk/subagent-continuable/tool-schemas.1.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/sdk/subagent-continuable/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-continuable/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-dsh-sdk-diagnostic/tool-schemas.expected.json b/snapshots/sdk/subagent-dsh-sdk-diagnostic/tool-schemas.expected.json
index 81aaececa6..b60f548fdf 100644
--- a/snapshots/sdk/subagent-dsh-sdk-diagnostic/tool-schemas.expected.json
+++ b/snapshots/sdk/subagent-dsh-sdk-diagnostic/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -417,10 +405,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -650,19 +634,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.1.expected.json b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.1.expected.json
index 1f122af658..71a444e217 100644
--- a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -573,19 +565,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json
index 9fd1e04d56..ed2222393c 100644
--- a/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json
+++ b/snapshots/sdk/subagent-dsh-sdk-dynamic-route/tool-schemas.expected.json
@@ -347,10 +347,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +384,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -621,19 +613,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-list-agents/tool-schemas.1.expected.json b/snapshots/sdk/subagent-list-agents/tool-schemas.1.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/sdk/subagent-list-agents/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-list-agents/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/subagent-send-message/tool-schemas.1.expected.json b/snapshots/sdk/subagent-send-message/tool-schemas.1.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/sdk/subagent-send-message/tool-schemas.1.expected.json
+++ b/snapshots/sdk/subagent-send-message/tool-schemas.1.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/team-default-enabled/tool-schemas.1.expected.json b/snapshots/sdk/team-default-enabled/tool-schemas.1.expected.json
index 52d309609b..479df38ca8 100644
--- a/snapshots/sdk/team-default-enabled/tool-schemas.1.expected.json
+++ b/snapshots/sdk/team-default-enabled/tool-schemas.1.expected.json
@@ -586,10 +586,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -615,10 +611,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -999,19 +991,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/team-default-enabled/tool-schemas.expected.json b/snapshots/sdk/team-default-enabled/tool-schemas.expected.json
index 52d309609b..479df38ca8 100644
--- a/snapshots/sdk/team-default-enabled/tool-schemas.expected.json
+++ b/snapshots/sdk/team-default-enabled/tool-schemas.expected.json
@@ -586,10 +586,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -615,10 +611,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -999,19 +991,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/sdk/tool-error-details/notifications.expected.jsonl b/snapshots/sdk/tool-error-details/notifications.expected.jsonl
index d96af775ab..55f7de8c41 100644
--- a/snapshots/sdk/tool-error-details/notifications.expected.jsonl
+++ b/snapshots/sdk/tool-error-details/notifications.expected.jsonl
@@ -7,7 +7,7 @@
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":8,"time":0,"data":{"content":[{"type":"text","text":"Exercise a native denial and a caught PTC inner denial, then reply ERROR_DETAILS_OK."}],"source":{"kind":"user"},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":9,"time":0,"data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"user/message","seq":10,"time":0,"data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{sessionId}}"},"surfaceOp":"append"}}}
-{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":11,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}}}
+{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":11,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/context","seq":12,"time":0,"data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"session/title","seq":13,"time":0,"data":{"title":"Exercise a native denial and","messageSeqs":[8],"source":{"kind":"fallback"}}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"assistant/message","seq":14,"time":0,"data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"denied-native","name":"bash","arguments":"{\"command\":\"echo AUTO_DENIED\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"denied-native","name":"bash","args":["{\"command\":\"echo AUTO_DENIED\"}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"denied-native","name":"bash","arguments":"{\"command\":\"echo AUTO_DENIED\"}"}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}}}
@@ -17,7 +17,7 @@
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"step/start","seq":18,"time":0,"data":{"turn":1,"step":2}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"system/message","seq":19,"time":0,"data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{sessionId}}"}},"sourceEventSeqs":[7],"surfaceOp":{"op":"replace","startSeq":7,"endSeq":7}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"request/header","seq":20,"time":0,"data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["run_code"]},"reason":"change","startsSeries":true}}}}
-{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"developer/message","seq":21,"time":0,"data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"working_directory"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{sessionId}}"},"headerSeq":20},"surfaceOp":"append"}}}
+{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"developer/message","seq":21,"time":0,"data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{sessionId}}"},"headerSeq":20},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"assistant/message","seq":22,"time":0,"data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{sessionId}}"},"stream":[{"type":"chunk","time":0,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":0,"index":0,"dt":[],"id":"denied-code","name":"run_code","args":["{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"]},{"type":"chunk","time":0,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}}},{"type":"chunk","time":0,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"tool/call","seq":23,"time":0,"data":{"turn":1,"step":2,"callId":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}}}}
{"method":"session.event","params":{"sessionId":"{{sessionId}}","event":{"type":"tool/ptc-dispatch-start","seq":24,"time":0,"data":{"rootCallId":"denied-code","parentCallId":"denied-code","subCallId":"denied-code:ptc:1","name":"bash","arguments":{"command":"echo AUTO_DENIED"}}}}}
diff --git a/snapshots/sdk/tool-error-details/session.v4.jsonl b/snapshots/sdk/tool-error-details/session.v4.jsonl
index 0095f09f67..14fe5ee041 100644
--- a/snapshots/sdk/tool-error-details/session.v4.jsonl
+++ b/snapshots/sdk/tool-error-details/session.v4.jsonl
@@ -10,7 +10,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Exercise a native denial and a caught PTC inner denial, then reply ERROR_DETAILS_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Exercise a native denial and","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"denied-native","name":"bash","arguments":"{\"command\":\"echo AUTO_DENIED\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"stream":[{"type":"chunk","time":1793796132469,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796132470,"index":0,"dt":[],"id":"denied-native","name":"bash","args":["{\"command\":\"echo AUTO_DENIED\"}"]},{"type":"chunk","time":1793796132470,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"denied-native","name":"bash","arguments":"{\"command\":\"echo AUTO_DENIED\"}"}}},{"type":"chunk","time":1793796132470,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -20,7 +20,7 @@
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:7}}"}},"sourceEventSeqs":[7],"surfaceOp":{"op":"replace","startSeq":7,"endSeq":7}}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["run_code"]},"reason":"change","startsSeries":true}}
-{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"working_directory"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{message:8}}"},"headerSeq":20},"surfaceOp":"append"}
+{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{message:8}}"},"headerSeq":20},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"stream":[{"type":"chunk","time":1793796132486,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793796132486,"index":0,"dt":[],"id":"denied-code","name":"run_code","args":["{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"]},{"type":"chunk","time":1793796132486,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}}},{"type":"chunk","time":1793796132486,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"denied-code","name":"run_code","arguments":"{\"code\":\"try { await tools.bash({command: \\\"echo AUTO_DENIED\\\"}) } catch (error) { return error.message }\",\"description\":\"Catch one denied inner call\"}"}}
{"type":"tool/ptc-dispatch-start","data":{"rootCallId":"denied-code","parentCallId":"denied-code","subCallId":"denied-code:ptc:1","name":"bash","arguments":{"command":"echo AUTO_DENIED"}}}
diff --git a/snapshots/sdk/tool-error-details/system-prompt.expected.md b/snapshots/sdk/tool-error-details/system-prompt.expected.md
index ccfe4750ea..9dc437c627 100644
--- a/snapshots/sdk/tool-error-details/system-prompt.expected.md
+++ b/snapshots/sdk/tool-error-details/system-prompt.expected.md
@@ -205,8 +205,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -216,8 +214,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -294,11 +290,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -575,10 +566,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/sdk/tool-error-details/tool-schemas.expected.json b/snapshots/sdk/tool-error-details/tool-schemas.expected.json
index bf3d9439fe..e7a513f2a4 100644
--- a/snapshots/sdk/tool-error-details/tool-schemas.expected.json
+++ b/snapshots/sdk/tool-error-details/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/advanced-toolchain/session.v4.jsonl b/snapshots/session/advanced-toolchain/session.v4.jsonl
index c1a09eb618..b9a77d17a7 100644
--- a/snapshots/session/advanced-toolchain/session.v4.jsonl
+++ b/snapshots/session/advanced-toolchain/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Run this advanced flow exactly once: list runtime inspect providers; discover providers through run_code when available; delegate once to a direct spawn child; run one workflow that delegates to another spawn child; list providers again; then reply with exactly ADVANCED_HEADLESS_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","cordis_inspect_list","cordis_inspect_query","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","cordis_inspect_list","cordis_inspect_query","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Run this advanced flow exactly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"advanced-inspect-before","name":"cordis_inspect_list","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":3,"outputTokens":3},"stream":[{"type":"chunk","time":1791315715021,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1791315715022,"index":0,"dt":[],"id":"advanced-inspect-before","name":"cordis_inspect_list","args":["{}"]},{"type":"chunk","time":1791315715022,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"advanced-inspect-before","name":"cordis_inspect_list","arguments":"{}"}}},{"type":"chunk","time":1791315715022,"chunk":{"type":"usage","usage":{"inputTokens":3,"outputTokens":3}}},{"type":"chunk","time":1791315715022,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -19,7 +19,7 @@
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:6}}"}},"sourceEventSeqs":[7],"surfaceOp":{"op":"replace","startSeq":7,"endSeq":7}}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["run_code"]},"reason":"change","startsSeries":true}}
-{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"cordis_inspect_list"},{"type":"tool-removal","toolName":"cordis_inspect_query"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"working_directory"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
+{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"run_code"},{"type":"tool-removal","toolName":"apply_patch"},{"type":"tool-removal","toolName":"bash"},{"type":"tool-removal","toolName":"cordis_inspect_list"},{"type":"tool-removal","toolName":"cordis_inspect_query"},{"type":"tool-removal","toolName":"create_goal"},{"type":"tool-removal","toolName":"edit"},{"type":"tool-removal","toolName":"get_goal"},{"type":"tool-removal","toolName":"glob"},{"type":"tool-removal","toolName":"grep"},{"type":"tool-removal","toolName":"job_kill"},{"type":"tool-removal","toolName":"job_list"},{"type":"tool-removal","toolName":"job_output"},{"type":"tool-removal","toolName":"list_agents"},{"type":"tool-removal","toolName":"read"},{"type":"tool-removal","toolName":"read_image"},{"type":"tool-removal","toolName":"send_message"},{"type":"tool-removal","toolName":"skill"},{"type":"tool-removal","toolName":"subagent"},{"type":"tool-removal","toolName":"subagent_fork"},{"type":"tool-removal","toolName":"todo_write"},{"type":"tool-removal","toolName":"update_goal"},{"type":"tool-removal","toolName":"wait_agent"},{"type":"tool-removal","toolName":"web_fetch"},{"type":"tool-removal","toolName":"web_search"},{"type":"tool-removal","toolName":"workflow"},{"type":"tool-removal","toolName":"write"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"advanced-code","name":"run_code","arguments":"{\"code\":\"const inspected = await tools.cordis_inspect_list({}); return inspected.providers.map(provider => provider.id);\",\"description\":\"Discover runtime APIs through PTC\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"usage":{"inputTokens":3,"outputTokens":3},"stream":[{"type":"chunk","time":1791315715055,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1791315715055,"index":0,"dt":[],"id":"advanced-code","name":"run_code","args":["{\"code\":\"const inspected = await tools.cordis_inspect_list({}); return inspected.providers.map(provider => provider.id);\",\"description\":\"Discover runtime APIs through PTC\"}"]},{"type":"chunk","time":1791315715055,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"advanced-code","name":"run_code","arguments":"{\"code\":\"const inspected = await tools.cordis_inspect_list({}); return inspected.providers.map(provider => provider.id);\",\"description\":\"Discover runtime APIs through PTC\"}"}}},{"type":"chunk","time":1791315715055,"chunk":{"type":"usage","usage":{"inputTokens":3,"outputTokens":3}}},{"type":"chunk","time":1791315715055,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"advanced-code","name":"run_code","arguments":"{\"code\":\"const inspected = await tools.cordis_inspect_list({}); return inspected.providers.map(provider => provider.id);\",\"description\":\"Discover runtime APIs through PTC\"}"}}
{"type":"tool/ptc-dispatch-start","data":{"rootCallId":"advanced-code","parentCallId":"advanced-code","subCallId":"advanced-code:ptc:1","name":"cordis_inspect_list","arguments":{}}}
@@ -28,8 +28,8 @@
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
{"type":"system/message","data":{"turn":1,"step":3,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:10}}"}},"sourceEventSeqs":[18],"surfaceOp":{"op":"replace","startSeq":18,"endSeq":18}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","cordis_inspect_list","cordis_inspect_query","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change","startsSeries":true}}
-{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"apply_patch"},{"type":"tool-addition","toolName":"bash"},{"type":"tool-addition","toolName":"cordis_inspect_list"},{"type":"tool-addition","toolName":"cordis_inspect_query"},{"type":"tool-addition","toolName":"create_goal"},{"type":"tool-addition","toolName":"edit"},{"type":"tool-addition","toolName":"get_goal"},{"type":"tool-addition","toolName":"glob"},{"type":"tool-addition","toolName":"grep"},{"type":"tool-addition","toolName":"job_kill"},{"type":"tool-addition","toolName":"job_list"},{"type":"tool-addition","toolName":"job_output"},{"type":"tool-addition","toolName":"list_agents"},{"type":"tool-addition","toolName":"read"},{"type":"tool-addition","toolName":"read_image"},{"type":"tool-addition","toolName":"send_message"},{"type":"tool-addition","toolName":"skill"},{"type":"tool-addition","toolName":"subagent"},{"type":"tool-addition","toolName":"subagent_fork"},{"type":"tool-addition","toolName":"todo_write"},{"type":"tool-addition","toolName":"update_goal"},{"type":"tool-addition","toolName":"wait_agent"},{"type":"tool-addition","toolName":"web_fetch"},{"type":"tool-addition","toolName":"web_search"},{"type":"tool-addition","toolName":"workflow"},{"type":"tool-addition","toolName":"working_directory"},{"type":"tool-addition","toolName":"write"},{"type":"tool-removal","toolName":"run_code"}],"role":"developer","id":"{{message:11}}"},"headerSeq":29},"surfaceOp":"append"}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","bash","cordis_inspect_list","cordis_inspect_query","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change","startsSeries":true}}
+{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"apply_patch"},{"type":"tool-addition","toolName":"bash"},{"type":"tool-addition","toolName":"cordis_inspect_list"},{"type":"tool-addition","toolName":"cordis_inspect_query"},{"type":"tool-addition","toolName":"create_goal"},{"type":"tool-addition","toolName":"edit"},{"type":"tool-addition","toolName":"get_goal"},{"type":"tool-addition","toolName":"glob"},{"type":"tool-addition","toolName":"grep"},{"type":"tool-addition","toolName":"job_kill"},{"type":"tool-addition","toolName":"job_list"},{"type":"tool-addition","toolName":"job_output"},{"type":"tool-addition","toolName":"list_agents"},{"type":"tool-addition","toolName":"read"},{"type":"tool-addition","toolName":"read_image"},{"type":"tool-addition","toolName":"send_message"},{"type":"tool-addition","toolName":"skill"},{"type":"tool-addition","toolName":"subagent"},{"type":"tool-addition","toolName":"subagent_fork"},{"type":"tool-addition","toolName":"todo_write"},{"type":"tool-addition","toolName":"update_goal"},{"type":"tool-addition","toolName":"wait_agent"},{"type":"tool-addition","toolName":"web_fetch"},{"type":"tool-addition","toolName":"web_search"},{"type":"tool-addition","toolName":"workflow"},{"type":"tool-addition","toolName":"write"},{"type":"tool-removal","toolName":"run_code"}],"role":"developer","id":"{{message:11}}"},"headerSeq":29},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"advanced-direct-child","name":"subagent","arguments":"{\"description\":\"Check direct child\",\"prompt\":\"Reply with exactly DIRECT_CHILD_OK and nothing else.\",\"run_in_background\":false}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":3,"outputTokens":3},"stream":[{"type":"chunk","time":1791315715200,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1791315715200,"index":0,"dt":[],"id":"advanced-direct-child","name":"subagent","args":["{\"description\":\"Check direct child\",\"prompt\":\"Reply with exactly DIRECT_CHILD_OK and nothing else.\",\"run_in_background\":false}"]},{"type":"chunk","time":1791315715200,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"advanced-direct-child","name":"subagent","arguments":"{\"description\":\"Check direct child\",\"prompt\":\"Reply with exactly DIRECT_CHILD_OK and nothing else.\",\"run_in_background\":false}"}}},{"type":"chunk","time":1791315715200,"chunk":{"type":"usage","usage":{"inputTokens":3,"outputTokens":3}}},{"type":"chunk","time":1791315715200,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":3,"callId":"advanced-direct-child","name":"subagent","arguments":"{\"description\":\"Check direct child\",\"prompt\":\"Reply with exactly DIRECT_CHILD_OK and nothing else.\",\"run_in_background\":false}"}}
{"type":"subagent/catalog","data":{"version":3,"childId":"{{session:2}}","childCreatedAt":1791315715221,"mode":"continuable","label":"Check direct child","name":"agent-1"}}
diff --git a/snapshots/session/advanced-toolchain/system-prompt.expected.md b/snapshots/session/advanced-toolchain/system-prompt.expected.md
index 2761bf68ad..489f12c7e6 100644
--- a/snapshots/session/advanced-toolchain/system-prompt.expected.md
+++ b/snapshots/session/advanced-toolchain/system-prompt.expected.md
@@ -218,8 +218,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -229,8 +227,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -307,11 +303,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -590,10 +581,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/advanced-toolchain/tool-schemas.expected.json b/snapshots/session/advanced-toolchain/tool-schemas.expected.json
index 60c0d74948..890b409150 100644
--- a/snapshots/session/advanced-toolchain/tool-schemas.expected.json
+++ b/snapshots/session/advanced-toolchain/tool-schemas.expected.json
@@ -371,10 +371,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -400,10 +396,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -633,19 +625,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1092,10 +1071,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1121,10 +1096,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1354,19 +1325,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/agent-instructions/tool-schemas.expected.json b/snapshots/session/agent-instructions/tool-schemas.expected.json
index 05b7194e33..0d490843e3 100644
--- a/snapshots/session/agent-instructions/tool-schemas.expected.json
+++ b/snapshots/session/agent-instructions/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -971,10 +950,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1000,10 +975,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1233,19 +1204,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/apply-patch-update/tool-schemas.expected.json b/snapshots/session/apply-patch-update/tool-schemas.expected.json
index 827b3a3e9b..4a765b7af4 100644
--- a/snapshots/session/apply-patch-update/tool-schemas.expected.json
+++ b/snapshots/session/apply-patch-update/tool-schemas.expected.json
@@ -234,10 +234,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -263,10 +259,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -451,19 +443,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/both-mode-turn/system-prompt.expected.md b/snapshots/session/both-mode-turn/system-prompt.expected.md
index 3cc2d5e4c5..529b5231b3 100644
--- a/snapshots/session/both-mode-turn/system-prompt.expected.md
+++ b/snapshots/session/both-mode-turn/system-prompt.expected.md
@@ -168,8 +168,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -179,8 +177,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -257,11 +253,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -538,10 +529,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/browser-use-chrome-devtools-mcp/tool-schemas.expected.json b/snapshots/session/browser-use-chrome-devtools-mcp/tool-schemas.expected.json
index 277db426bf..dcbfedfdaa 100644
--- a/snapshots/session/browser-use-chrome-devtools-mcp/tool-schemas.expected.json
+++ b/snapshots/session/browser-use-chrome-devtools-mcp/tool-schemas.expected.json
@@ -437,10 +437,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -466,10 +462,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -699,19 +691,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/browser-use-playwright-mcp/tool-schemas.expected.json b/snapshots/session/browser-use-playwright-mcp/tool-schemas.expected.json
index efa2e54853..606652a446 100644
--- a/snapshots/session/browser-use-playwright-mcp/tool-schemas.expected.json
+++ b/snapshots/session/browser-use-playwright-mcp/tool-schemas.expected.json
@@ -439,10 +439,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -468,10 +464,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -701,19 +693,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/browser-use-stagehand-native/tool-schemas.expected.json b/snapshots/session/browser-use-stagehand-native/tool-schemas.expected.json
index b83b65b7bc..328077e50c 100644
--- a/snapshots/session/browser-use-stagehand-native/tool-schemas.expected.json
+++ b/snapshots/session/browser-use-stagehand-native/tool-schemas.expected.json
@@ -543,10 +543,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -572,10 +568,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -805,19 +797,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/claude-code-mods/demo-mod.ts b/snapshots/session/claude-code-mods/demo-mod.ts
index 114ab65c22..9b82981cff 100644
--- a/snapshots/session/claude-code-mods/demo-mod.ts
+++ b/snapshots/session/claude-code-mods/demo-mod.ts
@@ -1,8 +1,7 @@
import { defineMod } from '@deepseek-ai/dsh-experimental-claude-code-mods'
/**
- * Scenario mod: adds prompt context, reports current-directory operations,
- * and refuses forced Git pushes.
+ * Scenario mod: adds prompt context and refuses forced Git pushes.
*/
export default defineMod({
name: 'snapshot-guard',
@@ -12,23 +11,6 @@ export default defineMod({
const r = await next(e)
return { ...r, context: [...r.context ?? [], 'Context from the snapshot-guard mod: this workspace is a demo checkout.'] }
})
- on('tool.call', { tool: 'working_directory' }, async ($, e, next) => {
- const result = await next(e)
- if (typeof e.cd !== 'string' || result.deny !== undefined || result.isError) return result
- const cwd = await $.session.cwd()
- const root = await $.session.root()
- const read = await $.fs.read('witness.txt')
- const exists = await $.fs.exists('witness.txt')
- const stat = await $.fs.stat('witness.txt')
- const listed = (await $.fs.list('.')).some(entry => entry.name === 'witness.txt')
- const process = await $.process.run(['node', '-e', 'process.stdout.write(String(process.cwd() === process.argv[1]))', cwd])
- const facts = JSON.stringify({
- directory: cwd.split('/').pop(), rootIsCurrent: cwd === root, read, exists, stat: stat.kind, listed,
- processCwdMatches: process.stdout === 'true',
- })
- await $.fs.write('mods-directory.json', facts + '\n')
- return { ...result, result: String(result.result) + '\nMods directory facts: ' + facts }
- })
on('tool.call', { tool: 'Bash' }, (_$, e, next) => {
if (/\bgit\s+push\b[^\n]*\s(--force|-f)\b/u.test(String(e.command ?? ''))) {
return { deny: `snapshot-guard refused this command: ${String(e.command)}` }
diff --git a/snapshots/session/compaction-output-reserve/cordis.snapshot.yml b/snapshots/session/compaction-output-reserve/cordis.snapshot.yml
index 3391735ebd..c3a9a71a49 100644
--- a/snapshots/session/compaction-output-reserve/cordis.snapshot.yml
+++ b/snapshots/session/compaction-output-reserve/cordis.snapshot.yml
@@ -32,7 +32,7 @@
name: DeepSeek
models:
- id: deepseek-v4-flash
- contextWindow: 8980
+ contextWindow: 8792
defaultMaxTokens: 1000
- id: compaction-working-directory
name: '../../../packages/test-support/session-snapshot/tests/fixtures/compaction-working-directory.ts'
diff --git a/snapshots/session/compaction-output-reserve/cordis.yml b/snapshots/session/compaction-output-reserve/cordis.yml
index 2b543a5943..003ccbe0bb 100644
--- a/snapshots/session/compaction-output-reserve/cordis.yml
+++ b/snapshots/session/compaction-output-reserve/cordis.yml
@@ -7,7 +7,7 @@
config:
models:
- id: deepseek-v4-flash
- contextWindow: 8980
+ contextWindow: 8792
maxTokens: 1000
- id: compaction-basic
diff --git a/snapshots/session/compaction-output-reserve/session.v4.jsonl b/snapshots/session/compaction-output-reserve/session.v4.jsonl
index dcdf455001..6769bf3227 100644
--- a/snapshots/session/compaction-output-reserve/session.v4.jsonl
+++ b/snapshots/session/compaction-output-reserve/session.v4.jsonl
@@ -9,9 +9,9 @@
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Establish a durable compaction premise before continuing. Record every part of this historical evidence: the snapshot uses keyless replay; persistence uses JSONL; the assembled headless application loads its real Cordis composition; model-visible inputs remain logged; tool calls and results remain paired and ordered; output reservation reduces the message budget before proactive compaction; compaction opens with compaction/start and closes with compaction/end; a successful auxiliary summary records compaction/summary source metadata; the replacement surface shadows only an older balanced range; the checkpoint remains smaller than the history it replaces; the newest tool result remains verbatim; the next request sees that checkpoint; the final response proves the same turn continued; deterministic snapshot evidence stays separate from the live-provider smoke; and no external API key is needed. Emit one alpha marker through bash, then finish the task after proactive compaction with the exact words PROACTIVE COMPACTION COMPLETE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}
-{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":8980}}
+{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":8792}}
{"type":"session/title","data":{"title":"Establish a durable compaction premise","messageSeqs":[9],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":24,"outputTokens":6},"stream":[{"type":"chunk","time":1791427805327,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1791427805327,"index":0,"dt":[],"id":"call_compaction_marker","name":"bash","args":["{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"]},{"type":"chunk","time":1791427805327,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}}},{"type":"chunk","time":1791427805327,"chunk":{"type":"usage","usage":{"inputTokens":24,"outputTokens":6}}},{"type":"chunk","time":1791427805327,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}}
@@ -20,11 +20,11 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_compaction_marker"},"toolCallId":"call_compaction_marker","content":[{"type":"text","text":"alpha\n"}],"isError":false,"id":"{{message:5}}"},"meta":{"cwd":"/tmp"}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"compaction/start","data":{"compactionId":"{{id:2}}","turn":1}}
-{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":490,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":32,"usage":{"inputTokens":20,"outputTokens":4}}}
+{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":437,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":32,"usage":{"inputTokens":20,"outputTokens":4}}}
{"type":"user/message","data":{"content":[{"type":"text","text":"This is an automatically generated checkpoint condensing an earlier span of the conversation to free up context. Treat the captured context as established background and build on it without restating it. Continue the task directly from the messages that follow, without acknowledging this checkpoint.\n\n"},{"type":"text","text":"The request established a durable compaction premise."},{"type":"text","text":""}],"source":{"kind":"compact-checkpoint","compactionId":"{{id:2}}"},"role":"user","id":"{{message:6}}"},"sourceEventSeqs":[20,21,9,10],"surfaceOp":{"op":"replace","startSeq":9,"endSeq":10}}
{"type":"compaction/end","data":{"compactionId":"{{id:2}}","turn":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"series"}}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"usage":{"inputTokens":20,"outputTokens":4},"stream":[{"type":"chunk","time":1791427805357,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1791427805357,"index":0,"dt":[],"texts":["PROACTIVE COMPACTION COMPLETE"]},{"type":"chunk","time":1791427805357,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}}},{"type":"chunk","time":1791427805357,"chunk":{"type":"usage","usage":{"inputTokens":20,"outputTokens":4}}},{"type":"chunk","time":1791427805357,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
diff --git a/snapshots/session/compaction-recovery/tool-schemas.expected.json b/snapshots/session/compaction-recovery/tool-schemas.expected.json
index ae0b7ce3a7..905866bddc 100644
--- a/snapshots/session/compaction-recovery/tool-schemas.expected.json
+++ b/snapshots/session/compaction-recovery/tool-schemas.expected.json
@@ -302,10 +302,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -331,10 +327,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -564,19 +556,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -915,10 +894,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -944,10 +919,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1177,19 +1148,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/compaction-summary-headroom/cordis.snapshot.yml b/snapshots/session/compaction-summary-headroom/cordis.snapshot.yml
index 536018ed4c..d5af3b27c7 100644
--- a/snapshots/session/compaction-summary-headroom/cordis.snapshot.yml
+++ b/snapshots/session/compaction-summary-headroom/cordis.snapshot.yml
@@ -31,7 +31,7 @@
name: DeepSeek
models:
- id: deepseek-v4-flash
- contextWindow: 8980
+ contextWindow: 8792
defaultMaxTokens: 1000
- id: compaction-working-directory
name: '../../../packages/test-support/session-snapshot/tests/fixtures/compaction-working-directory.ts'
diff --git a/snapshots/session/compaction-summary-headroom/cordis.yml b/snapshots/session/compaction-summary-headroom/cordis.yml
index dfa621b684..9a39e8cb18 100644
--- a/snapshots/session/compaction-summary-headroom/cordis.yml
+++ b/snapshots/session/compaction-summary-headroom/cordis.yml
@@ -7,7 +7,7 @@
config:
models:
- id: deepseek-v4-flash
- contextWindow: 8980
+ contextWindow: 8792
maxTokens: 1000
- id: compaction-basic
diff --git a/snapshots/session/compaction-summary-headroom/session.v4.jsonl b/snapshots/session/compaction-summary-headroom/session.v4.jsonl
index a2a11aaf92..8d1ea87ddb 100644
--- a/snapshots/session/compaction-summary-headroom/session.v4.jsonl
+++ b/snapshots/session/compaction-summary-headroom/session.v4.jsonl
@@ -9,9 +9,9 @@
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Establish a durable compaction premise before continuing. Record every part of this historical evidence: the snapshot uses keyless replay; persistence uses JSONL; the assembled headless application loads its real Cordis composition; model-visible inputs remain logged; tool calls and results remain paired and ordered; output reservation reduces the message budget before proactive compaction; compaction opens with compaction/start and closes with compaction/end; a successful auxiliary summary records compaction/summary source metadata; the replacement surface shadows only an older balanced range; the checkpoint remains smaller than the history it replaces; the newest tool result remains verbatim; the next request sees that checkpoint; the final response proves the same turn continued; deterministic snapshot evidence stays separate from the live-provider smoke; and no external API key is needed. Emit one alpha marker through bash, then finish the task after proactive compaction with the exact words PROACTIVE COMPACTION COMPLETE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}
-{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":8980}}
+{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":8792}}
{"type":"session/title","data":{"title":"Establish a durable compaction premise","messageSeqs":[9],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":24,"outputTokens":6},"stream":[{"type":"chunk","time":1791427807038,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1791427807038,"index":0,"dt":[],"id":"call_compaction_marker","name":"bash","args":["{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"]},{"type":"chunk","time":1791427807038,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}}},{"type":"chunk","time":1791427807038,"chunk":{"type":"usage","usage":{"inputTokens":24,"outputTokens":6}}},{"type":"chunk","time":1791427807038,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"call_compaction_marker","name":"bash","arguments":"{\"command\":\"printf 'alpha\\n'\",\"description\":\"Emit compaction premise marker\"}"}}
@@ -20,11 +20,11 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_compaction_marker"},"toolCallId":"call_compaction_marker","content":[{"type":"text","text":"alpha\n"}],"isError":false,"id":"{{message:5}}"},"meta":{"cwd":"/tmp"}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"compaction/start","data":{"compactionId":"{{id:2}}","turn":1}}
-{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":490,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1800,"usage":{"inputTokens":20,"outputTokens":4}}}
+{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":437,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1800,"usage":{"inputTokens":20,"outputTokens":4}}}
{"type":"user/message","data":{"content":[{"type":"text","text":"This is an automatically generated checkpoint condensing an earlier span of the conversation to free up context. Treat the captured context as established background and build on it without restating it. Continue the task directly from the messages that follow, without acknowledging this checkpoint.\n\n"},{"type":"text","text":"The request established a durable compaction premise."},{"type":"text","text":""}],"source":{"kind":"compact-checkpoint","compactionId":"{{id:2}}"},"role":"user","id":"{{message:6}}"},"sourceEventSeqs":[20,21,9,10],"surfaceOp":{"op":"replace","startSeq":9,"endSeq":10}}
{"type":"compaction/end","data":{"compactionId":"{{id:2}}","turn":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"series"}}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"usage":{"inputTokens":20,"outputTokens":4},"stream":[{"type":"chunk","time":1791427807070,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1791427807070,"index":0,"dt":[],"texts":["PROACTIVE COMPACTION COMPLETE"]},{"type":"chunk","time":1791427807070,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}}},{"type":"chunk","time":1791427807070,"chunk":{"type":"usage","usage":{"inputTokens":20,"outputTokens":4}}},{"type":"chunk","time":1791427807070,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
diff --git a/snapshots/session/computer-use-cua-driver-mcp/tool-schemas.expected.json b/snapshots/session/computer-use-cua-driver-mcp/tool-schemas.expected.json
index 3a3f73ce68..6b6489e41e 100644
--- a/snapshots/session/computer-use-cua-driver-mcp/tool-schemas.expected.json
+++ b/snapshots/session/computer-use-cua-driver-mcp/tool-schemas.expected.json
@@ -416,10 +416,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -445,10 +441,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -678,19 +670,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/computer-use-cua-driver-native/tool-schemas.expected.json b/snapshots/session/computer-use-cua-driver-native/tool-schemas.expected.json
index acf3b16718..a2c0f2fa3b 100644
--- a/snapshots/session/computer-use-cua-driver-native/tool-schemas.expected.json
+++ b/snapshots/session/computer-use-cua-driver-native/tool-schemas.expected.json
@@ -376,10 +376,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -405,10 +401,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -638,19 +630,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/cordis-inspect-jsdoc/tool-schemas.expected.json b/snapshots/session/cordis-inspect-jsdoc/tool-schemas.expected.json
index b1df2e293d..af59f6c94a 100644
--- a/snapshots/session/cordis-inspect-jsdoc/tool-schemas.expected.json
+++ b/snapshots/session/cordis-inspect-jsdoc/tool-schemas.expected.json
@@ -371,10 +371,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -400,10 +396,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -633,19 +625,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/cua-native/tool-schemas.expected.json b/snapshots/session/cua-native/tool-schemas.expected.json
index 68b762fd48..a69c45bcae 100644
--- a/snapshots/session/cua-native/tool-schemas.expected.json
+++ b/snapshots/session/cua-native/tool-schemas.expected.json
@@ -1712,10 +1712,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1741,10 +1737,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1974,19 +1966,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/cua-ptc/system-prompt.expected.md b/snapshots/session/cua-ptc/system-prompt.expected.md
index 14dc7d66b9..053c232ba0 100644
--- a/snapshots/session/cua-ptc/system-prompt.expected.md
+++ b/snapshots/session/cua-ptc/system-prompt.expected.md
@@ -226,8 +226,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -237,8 +235,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -315,11 +311,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -597,10 +588,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/dynamic-tool-prompt-updates/session.v4.jsonl b/snapshots/session/dynamic-tool-prompt-updates/session.v4.jsonl
index b295cf23d8..6838b76e1d 100644
--- a/snapshots/session/dynamic-tool-prompt-updates/session.v4.jsonl
+++ b/snapshots/session/dynamic-tool-prompt-updates/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","systemPromptUpdate":"in-history"}}
{"type":"session/title","data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1790149644504,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790149644504,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":1790149644504,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":1790149644504,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1790149644504,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,14 +18,14 @@
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:6}}"}},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1790149644534,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790149644534,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":1790149644534,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":1790149644535,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_dynamic_ping"},"toolCallId":"call_dynamic_ping","content":[{"type":"text","text":"pong"}],"isError":false,"id":"{{message:9}}"}},"sourceEventSeqs":[22],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:10}}"}},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:11}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1790149644557,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1790149644557,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1790149644557,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1790149644557,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1790149644557,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
diff --git a/snapshots/session/dynamic-tool-updates/session.v4.jsonl b/snapshots/session/dynamic-tool-updates/session.v4.jsonl
index c2e7bc3bad..505020729b 100644
--- a/snapshots/session/dynamic-tool-updates/session.v4.jsonl
+++ b/snapshots/session/dynamic-tool-updates/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1790049391235,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790049391235,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":1790049391235,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":1790049391235,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1790049391235,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -17,14 +17,14 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_task_read"},"toolCallId":"call_task_read","content":[{"type":"text","text":"{{cwd}}/task.txt\nfile\n\n1: Reply with the single word DONE after reading this file.\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:5}}"},"meta":{"path":"{{cwd}}/task.txt","offset":1,"lines":[{"number":1,"text":"Reply with the single word DONE after reading this file."}],"totalLines":1}},"sourceEventSeqs":[14],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:6}}"},"headerSeq":18},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:7}}"},"stream":[{"type":"chunk","time":1790049391255,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790049391255,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":1790049391255,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":1790049391255,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_dynamic_ping"},"toolCallId":"call_dynamic_ping","content":[{"type":"text","text":"pong"}],"isError":false,"id":"{{message:8}}"}},"sourceEventSeqs":[21],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:9}}"}},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1790049391270,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1790049391270,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1790049391270,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1790049391270,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1790049391270,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
diff --git a/snapshots/session/dynamic-tool-updates/tool-schemas.expected.json b/snapshots/session/dynamic-tool-updates/tool-schemas.expected.json
index 082427d65d..5ae4a1f659 100644
--- a/snapshots/session/dynamic-tool-updates/tool-schemas.expected.json
+++ b/snapshots/session/dynamic-tool-updates/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -979,10 +958,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1008,10 +983,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1241,19 +1212,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1619,10 +1577,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1648,10 +1602,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1881,19 +1831,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/fs-glob-sampling/tool-schemas.expected.json b/snapshots/session/fs-glob-sampling/tool-schemas.expected.json
index f3889efab3..acfb2f3716 100644
--- a/snapshots/session/fs-glob-sampling/tool-schemas.expected.json
+++ b/snapshots/session/fs-glob-sampling/tool-schemas.expected.json
@@ -234,10 +234,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -263,10 +259,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -451,19 +443,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/headless.snapshot.ts b/snapshots/session/headless.snapshot.ts
index 96b56d4313..fa1456cf48 100644
--- a/snapshots/session/headless.snapshot.ts
+++ b/snapshots/session/headless.snapshot.ts
@@ -96,14 +96,7 @@ interface SessionLog {
readonly header: JsonObject
}
-/**
- * Scenarios whose compaction prices the runtime-context directory text: the current directory of
- * `compaction-recovery`, and the `Workspace root` line the other three print after `cd /tmp` leaves the
- * root. Their temporary root gets a fixed text length so `shadowedTokenCount` is platform independent.
- */
-const COMPACTION_PRICED_SCENARIOS = new Set(['compaction-recovery', 'compaction-output-reserve', 'compaction-summary-headroom', 'model-switch-compaction'])
-
-/** Keep the directory text priced by compaction independent of the platform's temporary-root length. */
+/** Keep the cwd text priced by compaction independent of the platform's temporary-root length. */
async function compactionWorkspaceOptions(): Promise<{ tempDirParent: string; tempDirPrefix: string }> {
const tempDirParent = await realpath(tmpdir())
const prefix = 'dsh-log-snap-'
@@ -884,34 +877,6 @@ async function verifyBackgroundConfinementFailure(log: string, cwd: string): Pro
expect(JSON.parse(await readFile(join(cwd, 'confinement-audit.json'), 'utf8'))).toEqual({ confineCalls: 1, spawnCalls: 0 })
}
-/** Directory changes remain user context while relative tools follow the committed directory. */
-function verifyWorkingDirectory(log: string, cwd: string): void {
- const events = records(log)
- const directories = events.filter(event => event.type === 'working-directory/change')
- .map(event => (event.data as JsonObject).cwd)
- expect(directories).toEqual([join(cwd, 'selected'), join(cwd, 'second'), cwd])
- expect(events.filter(event => event.type === 'system/message')).toHaveLength(1)
- const users = events.filter(event => event.type === 'user/message').map(event => event.data as JsonObject)
- const contexts = users.flatMap(message => {
- const source = message.source as JsonObject
- if (source.kind !== 'runtime-context') return []
- return (source.sections as JsonObject[]).filter(section => section.name === 'working-directory:current')
- .map(section => section.text)
- })
- // Inside the original project the snapshot names the root only while the cursor is below it.
- expect(contexts).toEqual([cwd, join(cwd, 'selected'), join(cwd, 'second'), cwd]
- .map(directory => directory === cwd
- ? `Current working directory: ${JSON.stringify(directory)}.`
- : `Current working directory: ${JSON.stringify(directory)}.\nWorkspace root: ${JSON.stringify(cwd)}.`))
- const notices = users.filter(message => (message.source as JsonObject).kind === 'working-directory')
- .map(message => (message.content as JsonObject[]).map(block => block.text).join(''))
- expect(notices).toEqual([
- `The working directory changed from ${JSON.stringify(cwd)} to ${JSON.stringify(join(cwd, 'selected'))}.`,
- `The working directory changed from ${JSON.stringify(join(cwd, 'selected'))} to ${JSON.stringify(join(cwd, 'second'))}.`,
- `The working directory ${JSON.stringify(join(cwd, 'second'))} is unavailable. The working directory is now ${JSON.stringify(cwd)}.`,
- ])
-}
-
/** Run fixture Git with deterministic commit identity and no user hooks or configuration. */
function snapshotGit(cwd: string, args: string[]): string {
const result = spawnSync('git', ['-c', 'core.hooksPath=/dev/null', '-c', 'core.autocrlf=false', '-c', 'commit.gpgSign=false', ...args], {
@@ -929,7 +894,7 @@ function snapshotGit(cwd: string, args: string[]): string {
return result.stdout.trim()
}
-/** Verify Git-owned state independently of the Session and exclude only its volatile administration files from the file oracle. */
+/** Verify Git-owned state independently of the Session, and the directory changes and notices of entering, leaving, and losing a worktree. */
async function verifyWorktree(log: string, cwd: string): Promise {
const checkout = join(cwd, '.agents', 'worktrees', 'isolated')
expect(await readFile(join(cwd, '.git', 'config'))).toEqual(await readFile(join(cwd, '.git', 'config.before-worktree')))
@@ -944,10 +909,24 @@ async function verifyWorktree(log: string, cwd: string): Promise {
expect(snapshotGit(checkout, ['rev-parse', 'HEAD'])).toBe(snapshotGit(cwd, ['rev-parse', 'HEAD']))
expect(snapshotGit(cwd, ['worktree', 'list', '--porcelain'])).toContain(`worktree ${checkout}`)
expect(snapshotGit(cwd, ['check-ignore', '.agents/worktrees/isolated/result.txt'])).toBe('.agents/worktrees/isolated/result.txt')
+ // The second worktree is removed while the Session works in it; its branch stays and the Session recovers to the source checkout.
+ const removed = join(cwd, '.agents', 'worktrees', 'doomed')
+ expect(existsSync(removed)).toBe(false)
+ expect(snapshotGit(cwd, ['worktree', 'list', '--porcelain'])).not.toContain(`worktree ${removed}`)
+ expect(snapshotGit(cwd, ['rev-parse', '--verify', 'refs/heads/doomed'])).toBe(snapshotGit(cwd, ['rev-parse', 'HEAD']))
const events = records(log)
- expect(events.filter(event => event.type === 'working-directory/change').map(event => (event.data as JsonObject).cwd))
- .toEqual([checkout, cwd])
+ expect(events.filter(event => event.type === 'working-directory/change').map(event => event.data))
+ .toEqual([checkout, cwd, removed, cwd].map(directory => ({ cwd: directory, workspace: true })))
expect(events.filter(event => event.type === 'system/message')).toHaveLength(1)
+ const notices = events.filter(event => event.type === 'user/message').map(event => event.data as JsonObject)
+ .filter(message => (message.source as JsonObject).kind === 'working-directory')
+ .map(message => (message.content as JsonObject[]).map(block => block.text).join(''))
+ expect(notices).toEqual([
+ `The working directory changed from ${JSON.stringify(cwd)} to ${JSON.stringify(checkout)}.`,
+ `The working directory changed from ${JSON.stringify(checkout)} to ${JSON.stringify(cwd)}.`,
+ `The working directory changed from ${JSON.stringify(cwd)} to ${JSON.stringify(removed)}.`,
+ `The working directory ${JSON.stringify(removed)} is unavailable. The working directory is now ${JSON.stringify(cwd)}.`,
+ ])
}
/** Exercise provider-cwd adoption through the shipped launcher without normalizing away the observation. */
@@ -1414,7 +1393,7 @@ describe('headless recorded-session snapshots', () => {
result = await runLoaderSmoke({
label: `${scenario.name} headless snapshot`,
tempDirPrefix: 'dsh-log-snap-',
- ...(COMPACTION_PRICED_SCENARIOS.has(scenario.name) ? await compactionWorkspaceOptions() : {}),
+ ...(scenario.name === 'compaction-recovery' ? await compactionWorkspaceOptions() : {}),
...(scenario.manifest.workspace?.parent === 'outside-temp' ? { tempDirParent: outsideTempWorkspaceParent() } : {}),
binScript: dshBin,
sourceImport: 'tsx/esm',
@@ -1568,9 +1547,6 @@ describe('headless recorded-session snapshots', () => {
if (scenario.name === 'background-confinement-failure') {
await verifyBackgroundConfinementFailure(actualLogs[0]!.content, cwd)
}
- if (scenario.name === 'working-directory') {
- verifyWorkingDirectory(actualLogs[0]!.content, await realpath(cwd))
- }
if (scenario.name === 'worktree') {
await verifyWorktree(actualLogs[0]!.content, await realpath(cwd))
}
diff --git a/snapshots/session/in-history-series-start/session.v4.jsonl b/snapshots/session/in-history-series-start/session.v4.jsonl
index 3d91c63da2..1d46e7f233 100644
--- a/snapshots/session/in-history-series-start/session.v4.jsonl
+++ b/snapshots/session/in-history-series-start/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","systemPromptUpdate":"in-history"}}
{"type":"session/title","data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1792735518085,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1792735518085,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":1792735518085,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":1792735518085,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1792735518085,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,7 +18,7 @@
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:6}}"}},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1792735518105,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1792735518105,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":1792735518105,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":1792735518105,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}
@@ -26,7 +26,7 @@
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"Snapshot checkpoint replacing the first admitted user message."}],"source":{"kind":"test-compaction"},"role":"user","id":"{{message:10}}"},"sourceEventSeqs":[8],"surfaceOp":{"op":"replace","startSeq":8,"endSeq":8}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change","startsSeries":true}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"high"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change","startsSeries":true}}
{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:11}}"}},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1792735518120,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1792735518120,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1792735518120,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1792735518120,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1792735518120,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
diff --git a/snapshots/session/lsp-definition/tool-schemas.expected.json b/snapshots/session/lsp-definition/tool-schemas.expected.json
index 6f0c4997d9..39b82b33c6 100644
--- a/snapshots/session/lsp-definition/tool-schemas.expected.json
+++ b/snapshots/session/lsp-definition/tool-schemas.expected.json
@@ -367,10 +367,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -396,10 +392,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -629,19 +621,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/mcp-resources-ptc/system-prompt.expected.md b/snapshots/session/mcp-resources-ptc/system-prompt.expected.md
index 4e7f0f4ab6..5978f21e4a 100644
--- a/snapshots/session/mcp-resources-ptc/system-prompt.expected.md
+++ b/snapshots/session/mcp-resources-ptc/system-prompt.expected.md
@@ -197,8 +197,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -208,8 +206,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -286,11 +282,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -570,10 +561,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/mcp-resources/tool-schemas.expected.json b/snapshots/session/mcp-resources/tool-schemas.expected.json
index 49aee6d79b..9f143b0d05 100644
--- a/snapshots/session/mcp-resources/tool-schemas.expected.json
+++ b/snapshots/session/mcp-resources/tool-schemas.expected.json
@@ -391,10 +391,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -420,10 +416,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -653,19 +645,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/mcp-template-error/tool-schemas.expected.json b/snapshots/session/mcp-template-error/tool-schemas.expected.json
index 9adf9d084c..8c8c66e145 100644
--- a/snapshots/session/mcp-template-error/tool-schemas.expected.json
+++ b/snapshots/session/mcp-template-error/tool-schemas.expected.json
@@ -400,10 +400,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -429,10 +425,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -662,19 +654,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/model-switch-compaction/cordis.snapshot.yml b/snapshots/session/model-switch-compaction/cordis.snapshot.yml
index e71bd16513..fa39b14ff3 100644
--- a/snapshots/session/model-switch-compaction/cordis.snapshot.yml
+++ b/snapshots/session/model-switch-compaction/cordis.snapshot.yml
@@ -33,7 +33,7 @@
contextWindow: 100000
defaultMaxTokens: 1000
- id: deepseek-v4-pro
- contextWindow: 8980
+ contextWindow: 8792
defaultMaxTokens: 1000
- id: compaction-working-directory
name: '../../../packages/test-support/session-snapshot/tests/fixtures/compaction-working-directory.ts'
diff --git a/snapshots/session/model-switch-compaction/cordis.yml b/snapshots/session/model-switch-compaction/cordis.yml
index 2733301ecf..d9cb82eb1d 100644
--- a/snapshots/session/model-switch-compaction/cordis.yml
+++ b/snapshots/session/model-switch-compaction/cordis.yml
@@ -10,7 +10,7 @@
contextWindow: 100000
maxTokens: 1000
- id: deepseek-v4-pro
- contextWindow: 8980
+ contextWindow: 8792
maxTokens: 1000
- id: compaction-basic
diff --git a/snapshots/session/model-switch-compaction/session.v4.jsonl b/snapshots/session/model-switch-compaction/session.v4.jsonl
index 88556f42d2..ccdfa160e5 100644
--- a/snapshots/session/model-switch-compaction/session.v4.jsonl
+++ b/snapshots/session/model-switch-compaction/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Establish a durable compaction premise before continuing. Record every part of this historical evidence: the snapshot uses keyless replay; persistence uses JSONL; the assembled headless application loads its real Cordis composition; model-visible inputs remain logged; tool calls and results remain paired and ordered; output reservation reduces the message budget before proactive compaction; compaction opens with compaction/start and closes with compaction/end; a successful auxiliary summary records compaction/summary source metadata; the replacement surface shadows only an older balanced range; the checkpoint remains smaller than the history it replaces; the newest tool result remains verbatim; the next request sees that checkpoint; the final response proves the same turn continued; deterministic snapshot evidence stays separate from the live-provider smoke; and no external API key is needed. Emit one alpha marker through bash, then finish the task after proactive compaction with the exact words PROACTIVE COMPACTION COMPLETE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":100000}}
{"type":"session/title","data":{"title":"Establish a durable compaction premise","messageSeqs":[9],"source":{"kind":"fallback"}}}
@@ -22,14 +22,14 @@
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"compaction/start","data":{"compactionId":"{{id:2}}","turn":1}}
-{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":490,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":32,"usage":{"inputTokens":20,"outputTokens":4}}}
+{"type":"compaction/summary","data":{"compactionId":"{{id:2}}","summary":[{"type":"text","text":"The request established a durable compaction premise."}],"rawOutput":[{"type":"text","text":"The request established a durable compaction premise."}],"llmStreamCall":true,"shadowedRange":{"start":9,"end":10},"shadowedSeqs":[9,10],"shadowedTokenCount":437,"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":32,"usage":{"inputTokens":20,"outputTokens":4}}}
{"type":"user/message","data":{"content":[{"type":"text","text":"This is an automatically generated checkpoint condensing an earlier span of the conversation to free up context. Treat the captured context as established background and build on it without restating it. Continue the task directly from the messages that follow, without acknowledging this checkpoint.\n\n"},{"type":"text","text":"The request established a durable compaction premise."},{"type":"text","text":""}],"source":{"kind":"compact-checkpoint","compactionId":"{{id:2}}"},"role":"user","id":"{{message:6}}"},"sourceEventSeqs":[22,23,9,10],"surfaceOp":{"op":"replace","startSeq":9,"endSeq":10}}
{"type":"compaction/end","data":{"compactionId":"{{id:2}}","turn":1}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:7}}"}},"sourceEventSeqs":[8],"surfaceOp":{"op":"replace","startSeq":8,"endSeq":8}}
{"type":"user/message","data":{"content":[{"type":"text","text":"[model changed: assistant turns above this point were generated by deepseek-v4-flash; the session continues with deepseek-v4-pro]"}],"source":{"kind":"model-selection","form":"notice","summary":"deepseek-v4-flash → deepseek-v4-pro"},"role":"user","id":"{{message:8}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:9}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"/tmp\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"/tmp\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:9}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-pro","maxTokens":1000},"adapterDefaults":{"maxTokens":true},"tools":"{{tools}}"},"reason":"change","startsSeries":true}}
-{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-pro","contextWindow":8980}}
+{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-pro","contextWindow":8792}}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-pro"},"id":"{{message:10}}"},"usage":{"inputTokens":20,"outputTokens":4},"stream":[{"type":"chunk","time":1792380141229,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1792380141229,"index":0,"dt":[],"texts":["PROACTIVE COMPACTION COMPLETE"]},{"type":"chunk","time":1792380141229,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"PROACTIVE COMPACTION COMPLETE"}}},{"type":"chunk","time":1792380141229,"chunk":{"type":"usage","usage":{"inputTokens":20,"outputTokens":4}}},{"type":"chunk","time":1792380141229,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/multimodal-spill-ends/tool-schemas.expected.json b/snapshots/session/multimodal-spill-ends/tool-schemas.expected.json
index 4947b4edeb..826c277b03 100644
--- a/snapshots/session/multimodal-spill-ends/tool-schemas.expected.json
+++ b/snapshots/session/multimodal-spill-ends/tool-schemas.expected.json
@@ -349,10 +349,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -378,10 +374,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -611,19 +603,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/office-authoring-checker/session.v4.jsonl b/snapshots/session/office-authoring-checker/session.v4.jsonl
index 2af2dfe8c8..a991d820e0 100644
--- a/snapshots/session/office-authoring-checker/session.v4.jsonl
+++ b/snapshots/session/office-authoring-checker/session.v4.jsonl
@@ -10,7 +10,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Load the Office Word, PowerPoint, and Excel authoring skills. Read their structural-check instructions and reply DONE. Do not create files."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Load the Office Word, PowerPoint,","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-docx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"stream":[{"type":"chunk","time":1793628043727,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628043727,"index":0,"dt":[],"id":"call_office_skill","name":"skill","args":["{\"name\":\"office-docx\"}"]},{"type":"chunk","time":1793628043727,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-docx\"}"}}},{"type":"chunk","time":1793628043727,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,7 +18,7 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_skill"},"toolCallId":"call_office_skill","content":[{"type":"text","text":"\n\nBase directory for this skill: {{cwd}}/office-skills/office-docx\nResolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed.\n\n\n\n# Word documents\n\nUse `python-docx` for DOCX creation and ordinary edits unless an explicit user or applicable AGENTS.md requirement names another library. Run Python as described in the Python environment section below.\n\nKeep scripts, intermediate files, and final documents in the workspace; runtime and skill resources are read-only. Use the requested language and preserve the document's design unless a redesign is requested.\n\nName Python scripts for their task, such as `edit_docx.py`; avoid module names such as `inspect.py`, `docx.py`, or `zipfile.py` that shadow imported libraries.\n\n## Create and edit\n\nIf `office_render`, `office_convert`, or `office_recalculate` is not in your tools, load `office` with `skill`; they appear next step.\n\npython-docx cannot read legacy `.doc` files. Use `office_convert` with `format: \"docx\"`, copy the result into the workspace, then edit the copy.\n\nFor text edits, locate the target by its text or position and inspect only its runs and formatting. A title can be an ordinary paragraph without a Title style or document-property title. Update the relevant runs; assigning paragraph `.text` destroys run formatting. Save a new file unless an in-place edit is requested. For ordinary text edits, do not unzip the document, enumerate ZIP members, dump raw XML, or inspect core properties, headers, or footers unrelated to the target. Investigate these only for a concrete failure, an ambiguous target, an unsupported feature, or an explicit user requirement. Rebuilding a document can lose unsupported features.\n\nUse paragraph styles for headings and body text. Size tables for the section that contains them, and account for merged cells and nested tables. Chinese, Japanese, and Korean text may need an explicit `w:eastAsia` font assignment in addition to `run.font.name`; font names alone do not establish glyph availability or rendered appearance.\n\nFor a new document, use the selected Python executable:\n\n```python\nfrom docx import Document\n\ndocument = Document()\ndocument.add_heading(\"Project report\", level=0)\ndocument.add_paragraph(\"Summary\", style=\"Heading 1\")\ndocument.add_paragraph(\"The requested findings go here.\")\ndocument.save(\"report.docx\")\n```\n\npython-docx does not paginate or render documents. Do not represent ordinary replacement, colored text, or comments as tracked changes. When real revisions or unsupported OOXML features matter, preserve their package parts and verify the requested operation rather than silently discarding them. When writing package parts directly, create a new ZIP and copy each unchanged member once; appending a replacement member duplicates its name and corrupts the package.\n\n## Check and deliver\n\nReopen the saved document with python-docx and verify the requested content, related formatting, and unchanged content that must be preserved. These checks complete routine validation; deliver the file once they pass. ZIP integrity, package inventories, and metadata matter only for a concrete failure.\n\nCall `office_render` on the changed page when the user asks for images or visual inspection, or when styling, font color, spacing, sizing, or text alignment is the requested edit; a request to skip rendering takes precedence. New documents and content edits, with incidental basic formatting, are checked with python-docx alone. For PDF output, call `office_convert` with `format: \"pdf\"`, then copy the returned temporary file to the destination.\n\nA fully transparent or uniformly blank image of populated content means the renderer failed, which ends visual checks for the task and leaves the source as it is. When content and structure checks pass, state the visual status only as \"Content and structure checks passed; visual inspection was not completed.\" or \"内容与结构检查通过;视觉检查未完成。\".\n\nCall `present({\"files\":[{\"path\":\"report.docx\"}]})` with the actual final DOCX path. It exposes the current file without copying or preserving its bytes; keep it in place and omit temporary QA reports unless requested. If `present` is unavailable, deliver the final workspace path with the session's supported method.\n\n## Python environment\n\nFollow an explicit user or applicable AGENTS.md requirement for a Python environment. Otherwise use the project's or user's existing Python, such as `python3` or `python` on PATH. Before the first script, check that this Python can import the libraries the workflow needs. If Python or a library is missing, tell the user which packages to install; do not install packages into a global environment without the user's agreement.\n\n"}],"isError":false,"id":"{{message:6}}"}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"office_convert"},{"type":"tool-addition","toolName":"office_recalculate"},{"type":"tool-addition","toolName":"office_render"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_2","name":"skill","arguments":"{\"name\":\"office-pptx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1793628043746,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628043746,"index":0,"dt":[],"id":"call_office_2","name":"skill","args":["{\"name\":\"office-pptx\"}"]},{"type":"chunk","time":1793628043746,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_2","name":"skill","arguments":"{\"name\":\"office-pptx\"}"}}},{"type":"chunk","time":1793628043746,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_office_2","name":"skill","arguments":"{\"name\":\"office-pptx\"}"}}
diff --git a/snapshots/session/office-progressive-native/session.v4.jsonl b/snapshots/session/office-progressive-native/session.v4.jsonl
index fe32bf2d08..c011865ca8 100644
--- a/snapshots/session/office-progressive-native/session.v4.jsonl
+++ b/snapshots/session/office-progressive-native/session.v4.jsonl
@@ -10,7 +10,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Load the office router, then the authoring skill for this workflow. Render page 1 of report.docx, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Load the office router, then","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"stream":[{"type":"chunk","time":1793628044587,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628044588,"index":0,"dt":[],"id":"call_office_skill","name":"skill","args":["{\"name\":\"office\"}"]},{"type":"chunk","time":1793628044588,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office\"}"}}},{"type":"chunk","time":1793628044588,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,7 +18,7 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_skill"},"toolCallId":"call_office_skill","content":[{"type":"text","text":"\n\nBase directory for this skill: {{cwd}}/office-skills/office\nResolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed.\n\n\n\n# Office task routing\n\nLoad `office-docx`, `office-pptx`, or `office-xlsx` to create, read, or edit; operations alone need no format skill.\n\nIf `office_render`, `office_convert`, or `office_recalculate` is not in your tools, load `office` with `skill`; they appear next step.\n\n- `office_render`: Office or PDF images, visual checks, and appearance or slide checks required by the format skill; skip it when asked.\n- `office_recalculate`: formulas, with `format: \"xlsx\"` or `\"ods\"`.\n- `office_convert` with `format`; Office inputs only, not PDFs. For PDF export alone, check the copy is nonempty and starts with `%PDF-`, then deliver it without rendering.\n\nCopy temporary outputs to the destination, keeping existing files unless asked to replace them. Reuse loaded skills.\n\n"}],"isError":false,"id":"{{message:6}}"}},"sourceEventSeqs":[15],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"office_convert"},{"type":"tool-addition","toolName":"office_recalculate"},{"type":"tool-addition","toolName":"office_render"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_2","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1793628044612,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628044612,"index":0,"dt":[],"id":"call_office_2","name":"skill","args":["{\"name\":\"office-xlsx\"}"]},{"type":"chunk","time":1793628044612,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_2","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}},{"type":"chunk","time":1793628044612,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_office_2","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}
diff --git a/snapshots/session/office-progressive-native/tool-schemas.expected.json b/snapshots/session/office-progressive-native/tool-schemas.expected.json
index b472568322..83c09c8be6 100644
--- a/snapshots/session/office-progressive-native/tool-schemas.expected.json
+++ b/snapshots/session/office-progressive-native/tool-schemas.expected.json
@@ -285,10 +285,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -314,10 +310,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -547,19 +539,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -977,10 +956,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1006,10 +981,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1239,19 +1210,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/office-progressive-ptc/system-prompt.expected.md b/snapshots/session/office-progressive-ptc/system-prompt.expected.md
index f93624c469..ef5c81e711 100644
--- a/snapshots/session/office-progressive-ptc/system-prompt.expected.md
+++ b/snapshots/session/office-progressive-ptc/system-prompt.expected.md
@@ -149,8 +149,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -160,8 +158,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -238,11 +234,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -495,10 +486,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
@@ -702,8 +689,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -713,8 +698,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -791,11 +774,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -1095,10 +1073,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/office-render-tools/writer.expected.jsonl b/snapshots/session/office-render-tools/writer.expected.jsonl
index b12e3b4f8f..27bed181b6 100644
--- a/snapshots/session/office-render-tools/writer.expected.jsonl
+++ b/snapshots/session/office-render-tools/writer.expected.jsonl
@@ -11,31 +11,31 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\n\nBase directory for this skill: {{cwd}}/office-skills/office-docx\nResolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed.\n\n\n\n# Word documents\n\nUse `python-docx` for DOCX creation and ordinary edits unless an explicit user or applicable AGENTS.md requirement names another library. Run Python as described in the Python environment section below.\n\nKeep scripts, intermediate files, and final documents in the workspace; runtime and skill resources are read-only. Use the requested language and preserve the document's design unless a redesign is requested.\n\nName Python scripts for their task, such as `edit_docx.py`; avoid module names such as `inspect.py`, `docx.py`, or `zipfile.py` that shadow imported libraries.\n\n## Create and edit\n\nIf `office_render`, `office_convert`, or `office_recalculate` is not in your tools, load `office` with `skill`; they appear next step.\n\npython-docx cannot read legacy `.doc` files. Use `office_convert` with `format: \"docx\"`, copy the result into the workspace, then edit the copy.\n\nFor text edits, locate the target by its text or position and inspect only its runs and formatting. A title can be an ordinary paragraph without a Title style or document-property title. Update the relevant runs; assigning paragraph `.text` destroys run formatting. Save a new file unless an in-place edit is requested. For ordinary text edits, do not unzip the document, enumerate ZIP members, dump raw XML, or inspect core properties, headers, or footers unrelated to the target. Investigate these only for a concrete failure, an ambiguous target, an unsupported feature, or an explicit user requirement. Rebuilding a document can lose unsupported features.\n\nUse paragraph styles for headings and body text. Size tables for the section that contains them, and account for merged cells and nested tables. Chinese, Japanese, and Korean text may need an explicit `w:eastAsia` font assignment in addition to `run.font.name`; font names alone do not establish glyph availability or rendered appearance.\n\nFor a new document, use the selected Python executable:\n\n```python\nfrom docx import Document\n\ndocument = Document()\ndocument.add_heading(\"Project report\", level=0)\ndocument.add_paragraph(\"Summary\", style=\"Heading 1\")\ndocument.add_paragraph(\"The requested findings go here.\")\ndocument.save(\"report.docx\")\n```\n\npython-docx does not paginate or render documents. Do not represent ordinary replacement, colored text, or comments as tracked changes. When real revisions or unsupported OOXML features matter, preserve their package parts and verify the requested operation rather than silently discarding them. When writing package parts directly, create a new ZIP and copy each unchanged member once; appending a replacement member duplicates its name and corrupts the package.\n\n## Check and deliver\n\nReopen the saved document with python-docx and verify the requested content, related formatting, and unchanged content that must be preserved. These checks complete routine validation; deliver the file once they pass. ZIP integrity, package inventories, and metadata matter only for a concrete failure.\n\nCall `office_render` on the changed page when the user asks for images or visual inspection, or when styling, font color, spacing, sizing, or text alignment is the requested edit; a request to skip rendering takes precedence. New documents and content edits, with incidental basic formatting, are checked with python-docx alone. For PDF output, call `office_convert` with `format: \"pdf\"`, then copy the returned temporary file to the destination.\n\nA fully transparent or uniformly blank image of populated content means the renderer failed, which ends visual checks for the task and leaves the source as it is. When content and structure checks pass, state the visual status only as \"Content and structure checks passed; visual inspection was not completed.\" or \"内容与结构检查通过;视觉检查未完成。\".\n\nCall `present({\"files\":[{\"path\":\"report.docx\"}]})` with the actual final DOCX path. It exposes the current file without copying or preserving its bytes; keep it in place and omit temporary QA reports unless requested. If `present` is unavailable, deliver the final workspace path with the session's supported method.\n\n## Python environment\n\nFollow an explicit user or applicable AGENTS.md requirement for a Python environment. Otherwise use the project's or user's existing Python, such as `python3` or `python` on PATH. Before the first script, check that this Python can import the libraries the workflow needs. If Python or a library is missing, tell the user which packages to install; do not install packages into a global environment without the user's agreement.\n\n"}],"source":{"kind":"skill-invocation","name":"office-docx","form":"instructions"},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"/office-docx Load the Office rendering","messageSeqs":[8],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"stream":[{"type":"chunk","time":1793793369677,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793793369678,"index":0,"dt":[],"id":"call_office_skill","name":"skill","args":["{\"name\":\"office-xlsx\"}"]},{"type":"chunk","time":1793793369678,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}},{"type":"chunk","time":1793793369678,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"stream":[{"type":"chunk","time":1794394978119,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1794394978119,"index":0,"dt":[],"id":"call_office_skill","name":"skill","args":["{\"name\":\"office-xlsx\"}"]},{"type":"chunk","time":1794394978119,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}},{"type":"chunk","time":1794394978119,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"call_office_skill","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_skill"},"toolCallId":"call_office_skill","content":[{"type":"text","text":"\n\nBase directory for this skill: {{cwd}}/office-skills/office-xlsx\nResolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed.\n\n\n\n# Excel workbooks\n\nUse `openpyxl` and `pandas` unless an explicit user or applicable AGENTS.md requirement names another library. Run Python as described in the Python environment section below.\n\nKeep scripts, working files, and outputs in the task workspace. The runtime and skill directory are shared read-only resources. Save to a new workbook unless the user requests an in-place edit.\n\nName Python scripts for their task, such as `edit_xlsx.py`; avoid module names such as `inspect.py`, `openpyxl.py`, or `pandas.py` that shadow imported libraries.\n\n## Read and modify\n\nIf `office_render`, `office_convert`, or `office_recalculate` is not in your tools, load `office` with `skill`; they appear next step.\n\nopenpyxl cannot read legacy `.xls` files. Use `office_convert` with `format: \"xlsx\"`, copy the result into the workspace, then edit the copy.\n\nUse `openpyxl` for existing XLSX workbooks and targeted cell or style changes. Load with `data_only=False` when formulas must survive. Inspect sheet names, the affected cell types, formulas, styles, merged ranges, and referenced ranges before editing. Check the saved file by reopening it, including unchanged content that the request requires preserving.\n\nUse pandas for data analysis and transformations. A DataFrame is not the workbook: exporting it over an existing file can lose sheets, formulas, charts, and formatting. Write analysis results back to the intended ranges with openpyxl. `XlsxWriter` can create new workbooks, but cannot read or modify existing ones.\n\nFor a new workbook, the selected Python environment can write editable values, styles, and formulas directly:\n\n```python\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font\n\nworkbook = Workbook()\nsheet = workbook.active\nsheet.title = \"Revenue\"\nfor row in [(\"Quarter\", \"Revenue\"), (\"Q1\", 12), (\"Q2\", 18), (\"Total\", \"=SUM(B2:B3)\")]:\n sheet.append(row)\nfor cell in sheet[1]:\n cell.font = Font(bold=True)\nsheet.column_dimensions[\"A\"].width = 18\nsheet.column_dimensions[\"B\"].width = 18\nworkbook.save(\"report.xlsx\")\n```\n\nPreserve numbers, dates, booleans, and identifiers as the intended cell types; formatting is not a type conversion. For modifications, load the existing file with `openpyxl.load_workbook(\"input.xlsx\", data_only=False)`, change the requested ranges, and save a separate result. Avoid a DataFrame round trip when workbook features must survive.\n\nWriting a formula does not calculate its result. openpyxl and XlsxWriter do not evaluate formulas; `data_only=True` returns cached values that may be absent or stale. When calculated results must be refreshed, call `office_recalculate` with `format: \"xlsx\"`, and copy the returned temporary workbook to a new file in the workspace. Open the copy with openpyxl using both `data_only=False` and `data_only=True` to check that formulas survive and cached values match the expected results. If recalculation fails, preserve the original workbook and report that calculated values were not refreshed. Do not replace requested formulas with constants or report stale or absent cached values as newly calculated results.\n\nDo not rename `.xls`, `.xlsb`, encrypted files, or macro-enabled files to `.xlsx`. They need an appropriate supported operation. `keep_vba=True` can preserve VBA package content in an XLSM workflow, but does not execute or edit macros. Preserve the original and verify each workbook feature the task depends on.\n\n## Check and deliver\n\nReopen the saved workbook with openpyxl and verify the requested sheet names, values, types, formulas, styles, and totals against the source data, including unchanged content that must be preserved. These checks do not calculate formulas or judge workbook appearance.\n\nCall `office_render` when the user asks for images or visual inspection, or when the task targets appearance, such as cell fill colors, text alignment, spacing, or sizing; a request to skip rendering takes precedence. Do not render new workbooks or data or formula edits merely to verify accompanying bold headers or number formats; check these with openpyxl alone.\n\nRender worksheets by `sheet` and the affected `range`; worksheet numbers are not PDF page numbers. Earlier images of an unchanged source remain current. A fully transparent or uniformly blank image of populated content means the renderer failed, which ends visual checks for the task and leaves the source as it is. When content and structure checks pass, state the visual status only as \"Content and structure checks passed; visual inspection was not completed.\" or \"内容与结构检查通过;视觉检查未完成。\".\n\nRecalculate when refreshed calculated values are needed. For PDF output, call `office_convert` with `format: \"pdf\"`, then copy the returned temporary file to the destination. Deliver after the requested data checks pass and the required operations finish.\n\nCall `present({\"files\":[{\"path\":\"report.xlsx\"}]})` with the actual final workbook path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and omit intermediate scripts and reports unless requested. If `present` is unavailable, use the session's supported file delivery method.\n\n## Python environment\n\nFollow an explicit user or applicable AGENTS.md requirement for a Python environment. Otherwise use the project's or user's existing Python, such as `python3` or `python` on PATH. Before the first script, check that this Python can import the libraries the workflow needs. If Python or a library is missing, tell the user which packages to install; do not install packages into a global environment without the user's agreement.\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"office_convert"},{"type":"tool-addition","toolName":"office_recalculate"},{"type":"tool-addition","toolName":"office_render"}],"role":"developer","id":"{{message:8}}"},"headerSeq":20},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_2","name":"office_tools","arguments":"{\"action\":\"load\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"stream":[{"type":"chunk","time":1793793369702,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793793369702,"index":0,"dt":[],"id":"call_office_2","name":"office_tools","args":["{\"action\":\"load\"}"]},{"type":"chunk","time":1793793369702,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_2","name":"office_tools","arguments":"{\"action\":\"load\"}"}}},{"type":"chunk","time":1793793369702,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_2","name":"office_tools","arguments":"{\"action\":\"load\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"stream":[{"type":"chunk","time":1794394978142,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1794394978142,"index":0,"dt":[],"id":"call_office_2","name":"office_tools","args":["{\"action\":\"load\"}"]},{"type":"chunk","time":1794394978142,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_2","name":"office_tools","arguments":"{\"action\":\"load\"}"}}},{"type":"chunk","time":1794394978142,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_office_2","name":"office_tools","arguments":"{\"action\":\"load\"}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_2"},"toolCallId":"call_office_2","content":[{"type":"text","text":"Error: unknown tool \"office_tools\""}],"isError":true,"id":"{{message:10}}"},"error":{"name":"ToolNotFoundError","code":"UNKNOWN_TOOL"}},"sourceEventSeqs":[23],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_3","name":"render_document","arguments":"{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:11}}"},"stream":[{"type":"chunk","time":1793793369718,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793793369718,"index":0,"dt":[],"id":"call_office_3","name":"render_document","args":["{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"]},{"type":"chunk","time":1793793369718,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_3","name":"render_document","arguments":"{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"}}},{"type":"chunk","time":1793793369718,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_3","name":"render_document","arguments":"{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:11}}"},"stream":[{"type":"chunk","time":1794394978158,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1794394978158,"index":0,"dt":[],"id":"call_office_3","name":"render_document","args":["{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"]},{"type":"chunk","time":1794394978159,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_3","name":"render_document","arguments":"{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"}}},{"type":"chunk","time":1794394978159,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":3,"callId":"call_office_3","name":"render_document","arguments":"{\"input\":\"report.docx\",\"outputDirectory\":\"preview\",\"pages\":[1]}"}}
{"type":"tool/result","data":{"turn":1,"step":3,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_3"},"toolCallId":"call_office_3","content":[{"type":"text","text":"Error: unknown tool \"render_document\""}],"isError":true,"id":"{{message:12}}"},"error":{"name":"ToolNotFoundError","code":"UNKNOWN_TOOL"}},"sourceEventSeqs":[28],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
{"type":"step/start","data":{"turn":1,"step":4}}
-{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_4","name":"office_tools","arguments":"{\"action\":\"remove\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:13}}"},"stream":[{"type":"chunk","time":1793793369733,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793793369733,"index":0,"dt":[],"id":"call_office_4","name":"office_tools","args":["{\"action\":\"remove\"}"]},{"type":"chunk","time":1793793369733,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_4","name":"office_tools","arguments":"{\"action\":\"remove\"}"}}},{"type":"chunk","time":1793793369733,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_office_4","name":"office_tools","arguments":"{\"action\":\"remove\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:13}}"},"stream":[{"type":"chunk","time":1794394978173,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1794394978173,"index":0,"dt":[],"id":"call_office_4","name":"office_tools","args":["{\"action\":\"remove\"}"]},{"type":"chunk","time":1794394978173,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_office_4","name":"office_tools","arguments":"{\"action\":\"remove\"}"}}},{"type":"chunk","time":1794394978174,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":4,"callId":"call_office_4","name":"office_tools","arguments":"{\"action\":\"remove\"}"}}
{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"call_office_4"},"toolCallId":"call_office_4","content":[{"type":"text","text":"Error: unknown tool \"office_tools\""}],"isError":true,"id":"{{message:14}}"},"error":{"name":"ToolNotFoundError","code":"UNKNOWN_TOOL"}},"sourceEventSeqs":[33],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":4}}
{"type":"step/start","data":{"turn":1,"step":5}}
-{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:15}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1793793369748,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1793793369748,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1793793369748,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1793793369748,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1793793369748,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:15}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1794394978189,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1794394978189,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1794394978189,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1794394978189,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1794394978189,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":5}}
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/office-skills/session.v4.jsonl b/snapshots/session/office-skills/session.v4.jsonl
index c02ddac911..9e80ac4a1c 100644
--- a/snapshots/session/office-skills/session.v4.jsonl
+++ b/snapshots/session/office-skills/session.v4.jsonl
@@ -10,7 +10,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"Load the office-pptx and office-xlsx skills with the skill tool, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","load_workspace_dependencies","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","load_workspace_dependencies","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
{"type":"session/title","data":{"title":"Load the office-pptx and office-xlsx","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"reasoning","text":"Load the requested skill."},{"type":"tool-call","id":"call_skill_load","name":"skill","arguments":"{\"name\":\"office-pptx\"}"},{"type":"tool-call","id":"call_skill_xlsx","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":100,"outputTokens":20,"cacheReadTokens":0,"reasoningTokens":5},"stream":[{"type":"chunk","time":1793628049543,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}},{"type":"reasoning-chunks","time0":1793628049543,"index":0,"dt":[],"texts":["Load the requested skill."]},{"type":"chunk","time":1793628049543,"chunk":{"type":"block-start","index":1,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628049543,"index":1,"dt":[],"id":"call_skill_load","name":"skill","args":["{\"name\":\"office-pptx\"}"]},{"type":"chunk","time":1793628049543,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"Load the requested skill."}}},{"type":"chunk","time":1793628049543,"chunk":{"type":"block-end","index":1,"block":{"type":"tool-call","id":"call_skill_load","name":"skill","arguments":"{\"name\":\"office-pptx\"}"}}},{"type":"chunk","time":1793628049543,"chunk":{"type":"block-start","index":2,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1793628049543,"index":2,"dt":[],"id":"call_skill_xlsx","name":"skill","args":["{\"name\":\"office-xlsx\"}"]},{"type":"chunk","time":1793628049543,"chunk":{"type":"block-end","index":2,"block":{"type":"tool-call","id":"call_skill_xlsx","name":"skill","arguments":"{\"name\":\"office-xlsx\"}"}}},{"type":"chunk","time":1793628049543,"chunk":{"type":"usage","usage":{"inputTokens":100,"outputTokens":20,"cacheReadTokens":0,"reasoningTokens":5}}},{"type":"chunk","time":1793628049543,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -20,7 +20,7 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_skill_xlsx"},"toolCallId":"call_skill_xlsx","content":[{"type":"text","text":"\n\nBase directory for this skill: {{cwd}}/office-skills/office-xlsx\nResolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed.\n\n\n\n# Excel workbooks\n\nUse `openpyxl` and `pandas` unless an explicit user or applicable AGENTS.md requirement names another library. Run Python as described in the Python environment section below.\n\nKeep scripts, working files, and outputs in the task workspace. The runtime and skill directory are shared read-only resources. Save to a new workbook unless the user requests an in-place edit.\n\nName Python scripts for their task, such as `edit_xlsx.py`; avoid module names such as `inspect.py`, `openpyxl.py`, or `pandas.py` that shadow imported libraries.\n\n## Read and modify\n\nIf `office_render`, `office_convert`, or `office_recalculate` is not in your tools, load `office` with `skill`; they appear next step.\n\nopenpyxl cannot read legacy `.xls` files. Use `office_convert` with `format: \"xlsx\"`, copy the result into the workspace, then edit the copy.\n\nUse `openpyxl` for existing XLSX workbooks and targeted cell or style changes. Load with `data_only=False` when formulas must survive. Inspect sheet names, the affected cell types, formulas, styles, merged ranges, and referenced ranges before editing. Check the saved file by reopening it, including unchanged content that the request requires preserving.\n\nUse pandas for data analysis and transformations. A DataFrame is not the workbook: exporting it over an existing file can lose sheets, formulas, charts, and formatting. Write analysis results back to the intended ranges with openpyxl. `XlsxWriter` can create new workbooks, but cannot read or modify existing ones.\n\nFor a new workbook, the selected Python environment can write editable values, styles, and formulas directly:\n\n```python\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font\n\nworkbook = Workbook()\nsheet = workbook.active\nsheet.title = \"Revenue\"\nfor row in [(\"Quarter\", \"Revenue\"), (\"Q1\", 12), (\"Q2\", 18), (\"Total\", \"=SUM(B2:B3)\")]:\n sheet.append(row)\nfor cell in sheet[1]:\n cell.font = Font(bold=True)\nsheet.column_dimensions[\"A\"].width = 18\nsheet.column_dimensions[\"B\"].width = 18\nworkbook.save(\"report.xlsx\")\n```\n\nPreserve numbers, dates, booleans, and identifiers as the intended cell types; formatting is not a type conversion. For modifications, load the existing file with `openpyxl.load_workbook(\"input.xlsx\", data_only=False)`, change the requested ranges, and save a separate result. Avoid a DataFrame round trip when workbook features must survive.\n\nWriting a formula does not calculate its result. openpyxl and XlsxWriter do not evaluate formulas; `data_only=True` returns cached values that may be absent or stale. When calculated results must be refreshed, call `office_recalculate` with `format: \"xlsx\"`, and copy the returned temporary workbook to a new file in the workspace. Open the copy with openpyxl using both `data_only=False` and `data_only=True` to check that formulas survive and cached values match the expected results. If recalculation fails, preserve the original workbook and report that calculated values were not refreshed. Do not replace requested formulas with constants or report stale or absent cached values as newly calculated results.\n\nDo not rename `.xls`, `.xlsb`, encrypted files, or macro-enabled files to `.xlsx`. They need an appropriate supported operation. `keep_vba=True` can preserve VBA package content in an XLSM workflow, but does not execute or edit macros. Preserve the original and verify each workbook feature the task depends on.\n\n## Check and deliver\n\nReopen the saved workbook with openpyxl and verify the requested sheet names, values, types, formulas, styles, and totals against the source data, including unchanged content that must be preserved. These checks do not calculate formulas or judge workbook appearance.\n\nCall `office_render` when the user asks for images or visual inspection, or when the task targets appearance, such as cell fill colors, text alignment, spacing, or sizing; a request to skip rendering takes precedence. Do not render new workbooks or data or formula edits merely to verify accompanying bold headers or number formats; check these with openpyxl alone.\n\nRender worksheets by `sheet` and the affected `range`; worksheet numbers are not PDF page numbers. Earlier images of an unchanged source remain current. A fully transparent or uniformly blank image of populated content means the renderer failed, which ends visual checks for the task and leaves the source as it is. When content and structure checks pass, state the visual status only as \"Content and structure checks passed; visual inspection was not completed.\" or \"内容与结构检查通过;视觉检查未完成。\".\n\nRecalculate when refreshed calculated values are needed. For PDF output, call `office_convert` with `format: \"pdf\"`, then copy the returned temporary file to the destination. Deliver after the requested data checks pass and the required operations finish.\n\nCall `present({\"files\":[{\"path\":\"report.xlsx\"}]})` with the actual final workbook path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and omit intermediate scripts and reports unless requested. If `present` is unavailable, use the session's supported file delivery method.\n\n## Python environment\n\nFollow an explicit user or applicable AGENTS.md requirement for a Python environment. Otherwise call `load_workspace_dependencies` and run scripts with its Python executable and bundled libraries. Do not install packages or search for a system Python for the default workflow. If the tool is unavailable, use an already configured environment and report a missing dependency only when it prevents the requested operation.\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[17],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","load_workspace_dependencies","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","load_workspace_dependencies","office_convert","office_recalculate","office_render","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"office_convert"},{"type":"tool-addition","toolName":"office_recalculate"},{"type":"tool-addition","toolName":"office_render"}],"role":"developer","id":"{{message:8}}"},"headerSeq":21},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The skill is loaded."},{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"usage":{"inputTokens":180,"outputTokens":10,"cacheReadTokens":0,"reasoningTokens":4},"stream":[{"type":"chunk","time":1793628049569,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}},{"type":"reasoning-chunks","time0":1793628049569,"index":0,"dt":[],"texts":["The skill is loaded."]},{"type":"chunk","time":1793628049569,"chunk":{"type":"block-start","index":1,"blockType":"text"}},{"type":"text-chunks","time0":1793628049570,"index":1,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1793628049570,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The skill is loaded."}}},{"type":"chunk","time":1793628049570,"chunk":{"type":"block-end","index":1,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1793628049570,"chunk":{"type":"usage","usage":{"inputTokens":180,"outputTokens":10,"cacheReadTokens":0,"reasoningTokens":4}}},{"type":"chunk","time":1793628049570,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
diff --git a/snapshots/session/office-skills/tool-schemas.expected.json b/snapshots/session/office-skills/tool-schemas.expected.json
index a142aaf1b4..8be5ba8c47 100644
--- a/snapshots/session/office-skills/tool-schemas.expected.json
+++ b/snapshots/session/office-skills/tool-schemas.expected.json
@@ -293,10 +293,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -322,10 +318,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -555,19 +547,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -993,10 +972,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1022,10 +997,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1255,19 +1226,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/persistent-pwsh-tool-turn/tool-schemas.expected.json b/snapshots/session/persistent-pwsh-tool-turn/tool-schemas.expected.json
index b48f632b42..e1df9273e7 100644
--- a/snapshots/session/persistent-pwsh-tool-turn/tool-schemas.expected.json
+++ b/snapshots/session/persistent-pwsh-tool-turn/tool-schemas.expected.json
@@ -205,10 +205,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -234,10 +230,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -422,19 +414,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/pi-ai-conversation-updates/session.v4.jsonl b/snapshots/session/pi-ai-conversation-updates/session.v4.jsonl
index ae4e3e85ba..9595b4d117 100644
--- a/snapshots/session/pi-ai-conversation-updates/session.v4.jsonl
+++ b/snapshots/session/pi-ai-conversation-updates/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Read task.txt, call the newly available snapshot_ping tool once, then reply DONE."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"moonshotai","model":"kimi-k3","contextWindow":1048576,"systemPromptUpdate":"in-history"}}
{"type":"session/title","data":{"title":"Read task.txt, call the newly","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}],"source":{"kind":"model","provider":"moonshotai","model":"kimi-k3"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1790149644504,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790149644504,"index":0,"dt":[],"id":"call_task_read","name":"read","args":["{\"file_path\":\"task.txt\"}"]},{"type":"chunk","time":1790149644504,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_task_read","name":"read","arguments":"{\"file_path\":\"task.txt\"}"}}},{"type":"chunk","time":1790149644504,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1790149644504,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -18,14 +18,14 @@
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:6}}"}},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","snapshot_ping","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}],"source":{"kind":"model","provider":"moonshotai","model":"kimi-k3"},"id":"{{message:8}}"},"stream":[{"type":"chunk","time":1790149644534,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1790149644534,"index":0,"dt":[],"id":"call_dynamic_ping","name":"snapshot_ping","args":["{}"]},{"type":"chunk","time":1790149644534,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}},{"type":"chunk","time":1790149644535,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_dynamic_ping","name":"snapshot_ping","arguments":"{}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"call_dynamic_ping"},"toolCallId":"call_dynamic_ping","content":[{"type":"text","text":"pong"}],"isError":false,"id":"{{message:9}}"}},"sourceEventSeqs":[22],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"moonshotai","model":"kimi-k3"},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":3,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-removal","toolName":"snapshot_ping"}],"role":"developer","id":"{{message:10}}"}},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"text","text":"DONE"}],"source":{"kind":"model","provider":"moonshotai","model":"kimi-k3"},"id":"{{message:11}}"},"usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10},"stream":[{"type":"chunk","time":1790149644557,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"text-chunks","time0":1790149644557,"index":0,"dt":[],"texts":["DONE"]},{"type":"chunk","time":1790149644557,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"DONE"}}},{"type":"chunk","time":1790149644557,"chunk":{"type":"usage","usage":{"inputTokens":12,"outputTokens":2,"cacheReadTokens":10}}},{"type":"chunk","time":1790149644557,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
diff --git a/snapshots/session/plugin-manager-mcp/session.v4.jsonl b/snapshots/session/plugin-manager-mcp/session.v4.jsonl
index 934d6d0411..04f385f533 100644
--- a/snapshots/session/plugin-manager-mcp/session.v4.jsonl
+++ b/snapshots/session/plugin-manager-mcp/session.v4.jsonl
@@ -9,7 +9,7 @@
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Use plugin_manager with action set_plugin, target include:demo, enabled true to activate the configured MCP entry. Then call its newly discovered mcp__demo__ping tool and report the result. Do not use other tools."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","plugin_manager","read","read_image","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Use plugin_manager with action set_plugi","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The user wants me to activate a plugin via plugin_manager, then call an MCP tool. Let me do the plugin_manager call first.\n\nNote: they say \"Do not use other tools\" other than plugin_manager and the mcp tool. But I need to first enable it. Let's call plugin_manager set_plugin.\n\nLet me also list plugins first? The instruction says use plugin_manager with action set_plugin, target include:demo, enabled true. Let's just do that."},{"type":"tool-call","id":"call_00_xLhr9wia3A5m7wuSRWwD0436","name":"plugin_manager","arguments":"{\"action\": \"set_plugin\", \"target\": \"include:demo\", \"enabled\": true}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"reasoning","signature":"75d99e21-1d47-4a33-bb88-340a1e84b749"},{"type":"tool-call"}]}},"id":"{{message:4}}"},"usage":{"inputTokens":7220,"outputTokens":174,"cacheReadTokens":0,"cacheWriteTokens":0,"totalTokens":7394},"stream":[{"type":"chunk","time":1789984418848,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}},{"type":"reasoning-chunks","time0":1789984418848,"index":0,"dt":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"texts":["The"," user"," wants"," me"," to"," activate"," a"," plugin"," via"," plugin","_manager",","," then"," call"," an"," M","CP"," tool","."," Let"," me"," do"," the"," plugin","_manager"," call"," first",".\n\n","Note",":"," they"," say"," \"","Do"," not"," use"," other"," tools","\""," other"," than"," plugin","_manager"," and"," the"," m","cp"," tool","."," But"," I"," need"," to"," first"," enable"," it","."," Let","'s"," call"," plugin","_manager"," set","_","plugin",".\n\n","Let"," me"," also"," list"," plugins"," first","?"," The"," instruction"," says"," use"," plugin","_manager"," with"," action"," set","_","plugin",","," target"," include",":","demo",","," enabled"," true","."," Let","'s"," just"," do"," that","."]},{"type":"chunk","time":1789984418849,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The user wants me to activate a plugin via plugin_manager, then call an MCP tool. Let me do the plugin_manager call first.\n\nNote: they say \"Do not use other tools\" other than plugin_manager and the mcp tool. But I need to first enable it. Let's call plugin_manager set_plugin.\n\nLet me also list plugins first? The instruction says use plugin_manager with action set_plugin, target include:demo, enabled true. Let's just do that."}}},{"type":"chunk","time":1789984418849,"chunk":{"type":"block-start","index":1,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1789984418849,"index":1,"dt":[],"id":"call_00_xLhr9wia3A5m7wuSRWwD0436","name":"plugin_manager","args":[""]},{"type":"tool-call-chunks","time0":1789984418849,"index":1,"dt":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"id":"call_00_xLhr9wia3A5m7wuSRWwD0436","args":["{","\"","action","\"",": ","\"","set","_","plugin","\"",", ","\"","target","\"",": ","\"","include",":","demo","\"",", ","\"","en","abled","\"",": ","true","}"]},{"type":"chunk","time":1789984418849,"chunk":{"type":"block-end","index":1,"block":{"type":"tool-call","id":"call_00_xLhr9wia3A5m7wuSRWwD0436","name":"plugin_manager","arguments":"{\"action\": \"set_plugin\", \"target\": \"include:demo\", \"enabled\": true}"}}},{"type":"chunk","time":1789984418849,"chunk":{"type":"usage","usage":{"inputTokens":7220,"outputTokens":174,"cacheReadTokens":0,"cacheWriteTokens":0,"totalTokens":7394}}},{"type":"chunk","time":1789984418849,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"reasoning","signature":"75d99e21-1d47-4a33-bb88-340a1e84b749"},{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
@@ -18,7 +18,7 @@
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"system/message","data":{"turn":1,"step":2,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:6}}"}},"sourceEventSeqs":[7],"surfaceOp":{"op":"replace","startSeq":7,"endSeq":7}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_mcp_resource_templates","list_mcp_resources","mcp__demo__ping","plugin_manager","read","read_image","read_mcp_resource","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change","startsSeries":true}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":["apply_patch","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_mcp_resource_templates","list_mcp_resources","mcp__demo__ping","plugin_manager","read","read_image","read_mcp_resource","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change","startsSeries":true}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"list_mcp_resource_templates"},{"type":"tool-addition","toolName":"list_mcp_resources"},{"type":"tool-addition","toolName":"mcp__demo__ping"},{"type":"tool-addition","toolName":"read_mcp_resource"}],"role":"developer","id":"{{message:7}}"},"headerSeq":19},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The plugin was enabled. Now call mcp__demo__ping.\n\nWait — the tool was already listed in my tools before enabling. Let's call it anyway."},{"type":"tool-call","id":"call_00_miuKfLCTz5Cb38gdp8kK5186","name":"mcp__demo__ping","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash","replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"reasoning","signature":"b1ec1efe-4be6-4836-a10c-e5d6bfdce520"},{"type":"tool-call"}]}},"id":"{{message:8}}"},"usage":{"inputTokens":7035,"outputTokens":59,"cacheReadTokens":768,"cacheWriteTokens":0,"totalTokens":7862},"stream":[{"type":"chunk","time":1789984418998,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}},{"type":"reasoning-chunks","time0":1789984418998,"index":0,"dt":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"texts":["The"," plugin"," was"," enabled","."," Now"," call"," m","cp","__","demo","__","ping",".\n\n","Wait"," —"," the"," tool"," was"," already"," listed"," in"," my"," tools"," before"," enabling","."," Let","'s"," call"," it"," anyway","."]},{"type":"chunk","time":1789984418998,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The plugin was enabled. Now call mcp__demo__ping.\n\nWait — the tool was already listed in my tools before enabling. Let's call it anyway."}}},{"type":"chunk","time":1789984418998,"chunk":{"type":"block-start","index":1,"blockType":"tool-call"}},{"type":"tool-call-chunks","time0":1789984418998,"index":1,"dt":[],"id":"call_00_miuKfLCTz5Cb38gdp8kK5186","name":"mcp__demo__ping","args":[""]},{"type":"tool-call-chunks","time0":1789984418998,"index":1,"dt":[],"id":"call_00_miuKfLCTz5Cb38gdp8kK5186","args":["{}"]},{"type":"chunk","time":1789984418998,"chunk":{"type":"block-end","index":1,"block":{"type":"tool-call","id":"call_00_miuKfLCTz5Cb38gdp8kK5186","name":"mcp__demo__ping","arguments":"{}"}}},{"type":"chunk","time":1789984418998,"chunk":{"type":"usage","usage":{"inputTokens":7035,"outputTokens":59,"cacheReadTokens":768,"cacheWriteTokens":0,"totalTokens":7862}}},{"type":"chunk","time":1789984418998,"chunk":{"type":"finish","reason":{"kind":"tool-calls"},"replayState":{"response":{"kind":"deepseek-messages","version":1,"model":"deepseek-v4-flash"},"blocks":[{"type":"reasoning","signature":"b1ec1efe-4be6-4836-a10c-e5d6bfdce520"},{"type":"tool-call"}]}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_00_miuKfLCTz5Cb38gdp8kK5186","name":"mcp__demo__ping","arguments":"{}"}}
diff --git a/snapshots/session/plugin-manager-mcp/tool-schemas.expected.json b/snapshots/session/plugin-manager-mcp/tool-schemas.expected.json
index 67353604d2..8e1054dc1a 100644
--- a/snapshots/session/plugin-manager-mcp/tool-schemas.expected.json
+++ b/snapshots/session/plugin-manager-mcp/tool-schemas.expected.json
@@ -391,10 +391,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -420,10 +416,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -653,19 +645,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1163,10 +1142,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1192,10 +1167,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1425,19 +1396,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/plugin-manager/tool-schemas.expected.json b/snapshots/session/plugin-manager/tool-schemas.expected.json
index cb0de5ebb9..6b9118d022 100644
--- a/snapshots/session/plugin-manager/tool-schemas.expected.json
+++ b/snapshots/session/plugin-manager/tool-schemas.expected.json
@@ -391,10 +391,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -420,10 +416,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -653,19 +645,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/product-subagent-both/tool-schemas.expected.json b/snapshots/session/product-subagent-both/tool-schemas.expected.json
index 999751c5b9..f35bad83dd 100644
--- a/snapshots/session/product-subagent-both/tool-schemas.expected.json
+++ b/snapshots/session/product-subagent-both/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -417,10 +405,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -446,10 +430,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -475,10 +455,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -708,19 +684,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/product-subagent-codex/tool-schemas.expected.json b/snapshots/session/product-subagent-codex/tool-schemas.expected.json
index 23570e15e5..5763dd2581 100644
--- a/snapshots/session/product-subagent-codex/tool-schemas.expected.json
+++ b/snapshots/session/product-subagent-codex/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -417,10 +405,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -650,19 +634,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/product-subagent-oar/tool-schemas.expected.json b/snapshots/session/product-subagent-oar/tool-schemas.expected.json
index c42658816f..52a8caaf5d 100644
--- a/snapshots/session/product-subagent-oar/tool-schemas.expected.json
+++ b/snapshots/session/product-subagent-oar/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -407,10 +399,6 @@
"prompt": {
"type": "string",
"description": "The complete, self-contained task. Include all context the external agent needs."
- },
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omission inherits it."
}
},
"required": [
@@ -630,19 +618,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/product-subagent-result-diagnostic/tool-schemas.expected.json b/snapshots/session/product-subagent-result-diagnostic/tool-schemas.expected.json
index 3c64ee2747..f888cdf3cd 100644
--- a/snapshots/session/product-subagent-result-diagnostic/tool-schemas.expected.json
+++ b/snapshots/session/product-subagent-result-diagnostic/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -621,19 +609,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/ptc-persistent/system-prompt.expected.md b/snapshots/session/ptc-persistent/system-prompt.expected.md
index 89e23ec4fa..28d762a49d 100644
--- a/snapshots/session/ptc-persistent/system-prompt.expected.md
+++ b/snapshots/session/ptc-persistent/system-prompt.expected.md
@@ -168,8 +168,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -179,8 +177,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -261,11 +257,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -543,10 +534,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/ptc-policy-change/system-prompt.expected.md b/snapshots/session/ptc-policy-change/system-prompt.expected.md
index ca761dccb8..8b82fe80c2 100644
--- a/snapshots/session/ptc-policy-change/system-prompt.expected.md
+++ b/snapshots/session/ptc-policy-change/system-prompt.expected.md
@@ -168,8 +168,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -179,8 +177,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -259,11 +255,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -541,10 +532,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/ptc-python-turn/system-prompt.expected.md b/snapshots/session/ptc-python-turn/system-prompt.expected.md
index 0873748931..0d668a1cb5 100644
--- a/snapshots/session/ptc-python-turn/system-prompt.expected.md
+++ b/snapshots/session/ptc-python-turn/system-prompt.expected.md
@@ -369,8 +369,6 @@ class SkillOutput(TypedDict):
content: str
class SubagentArgs(TypedDict):
- # Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent.
- cwd: NotRequired[str]
# A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request.
description: str
# Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on.
@@ -384,8 +382,6 @@ class SubagentOutput(TypedDict):
name: str
class SubagentForkArgs(TypedDict):
- # Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent.
- cwd: NotRequired[str]
# A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request.
description: str
# Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on.
@@ -501,15 +497,6 @@ class WebSearchOutput(TypedDict):
sources: list[WebSearchOutputSources]
truncated: bool
-class WorkingDirectoryArgs(TypedDict):
- # Existing directory to enter. Omit to read the current directory.
- cd: NotRequired[str]
- # Additional keys beyond those declared are allowed.
-
-class WorkingDirectoryOutput(TypedDict):
- # Current absolute working directory.
- cwd: str
-
class WriteArgs(TypedDict):
# Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments.
file_path: str
@@ -573,8 +560,6 @@ class Tools(Protocol):
"""Fetch the content of a specific HTTP(S) URL and return it decoded to text."""
async def web_search(self, args: WebSearchArgs) -> WebSearchOutput:
"""Search the web for current information. Returns an optional summary answer and a list of source URLs."""
- async def working_directory(self, args: WorkingDirectoryArgs) -> WorkingDirectoryOutput:
- """Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories."""
async def write(self, args: WriteArgs) -> WriteOutput:
"""Create or fully replace a UTF-8 text file."""
diff --git a/snapshots/session/ptc-read-image/system-prompt.expected.md b/snapshots/session/ptc-read-image/system-prompt.expected.md
index 08651e72a0..0b687af94d 100644
--- a/snapshots/session/ptc-read-image/system-prompt.expected.md
+++ b/snapshots/session/ptc-read-image/system-prompt.expected.md
@@ -168,8 +168,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -179,8 +177,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -257,11 +253,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -538,10 +529,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/ptc-script-retained/system-prompt.expected.md b/snapshots/session/ptc-script-retained/system-prompt.expected.md
index ec29f2aadd..9ce1049294 100644
--- a/snapshots/session/ptc-script-retained/system-prompt.expected.md
+++ b/snapshots/session/ptc-script-retained/system-prompt.expected.md
@@ -231,8 +231,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -242,8 +240,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -324,11 +320,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -607,10 +598,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/ptc-turn/system-prompt.expected.md b/snapshots/session/ptc-turn/system-prompt.expected.md
index 55ff52414b..44ac519691 100644
--- a/snapshots/session/ptc-turn/system-prompt.expected.md
+++ b/snapshots/session/ptc-turn/system-prompt.expected.md
@@ -168,8 +168,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -179,8 +177,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -261,11 +257,6 @@ interface ToolArgsMap {
/** Run as a background job: return a job id immediately instead of waiting; the return value arrives with the completion notice. */
run_in_background?: boolean;
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -543,10 +534,6 @@ interface ToolOutputMap {
agentsStarted: number;
result: JsonValue;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/session/pty-tools-sandbox-backend/tool-schemas.expected.json b/snapshots/session/pty-tools-sandbox-backend/tool-schemas.expected.json
index 1343ed9d8e..6a8ca43f3d 100644
--- a/snapshots/session/pty-tools-sandbox-backend/tool-schemas.expected.json
+++ b/snapshots/session/pty-tools-sandbox-backend/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -721,19 +713,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/pwsh-tool-turn/tool-schemas.expected.json b/snapshots/session/pwsh-tool-turn/tool-schemas.expected.json
index cd4dea7393..233a8ee76f 100644
--- a/snapshots/session/pwsh-tool-turn/tool-schemas.expected.json
+++ b/snapshots/session/pwsh-tool-turn/tool-schemas.expected.json
@@ -286,10 +286,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -315,10 +311,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -503,19 +495,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/ralph-loop/tool-schemas.1.expected.json b/snapshots/session/ralph-loop/tool-schemas.1.expected.json
index a1cbe4db85..5f61876ead 100644
--- a/snapshots/session/ralph-loop/tool-schemas.1.expected.json
+++ b/snapshots/session/ralph-loop/tool-schemas.1.expected.json
@@ -393,10 +393,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -422,10 +418,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -655,19 +647,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/ralph-loop/tool-schemas.2.expected.json b/snapshots/session/ralph-loop/tool-schemas.2.expected.json
index a1cbe4db85..5f61876ead 100644
--- a/snapshots/session/ralph-loop/tool-schemas.2.expected.json
+++ b/snapshots/session/ralph-loop/tool-schemas.2.expected.json
@@ -393,10 +393,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -422,10 +418,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -655,19 +647,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/ralph-loop/tool-schemas.expected.json b/snapshots/session/ralph-loop/tool-schemas.expected.json
index d9c16c2fee..83934e92cf 100644
--- a/snapshots/session/ralph-loop/tool-schemas.expected.json
+++ b/snapshots/session/ralph-loop/tool-schemas.expected.json
@@ -350,10 +350,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -379,10 +375,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -612,19 +604,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/session-query-spill/tool-schemas.expected.json b/snapshots/session/session-query-spill/tool-schemas.expected.json
index 1f68092d11..c2e7c8c664 100644
--- a/snapshots/session/session-query-spill/tool-schemas.expected.json
+++ b/snapshots/session/session-query-spill/tool-schemas.expected.json
@@ -534,10 +534,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -563,10 +559,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -796,19 +788,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-acp-diagnostic/tool-schemas.expected.json b/snapshots/session/subagent-acp-diagnostic/tool-schemas.expected.json
index e106eb2948..f1b2a2c37e 100644
--- a/snapshots/session/subagent-acp-diagnostic/tool-schemas.expected.json
+++ b/snapshots/session/subagent-acp-diagnostic/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -388,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -621,19 +609,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-agent-preset/tool-schemas.1.expected.json b/snapshots/session/subagent-agent-preset/tool-schemas.1.expected.json
index f44253beb1..7234d881c7 100644
--- a/snapshots/session/subagent-agent-preset/tool-schemas.1.expected.json
+++ b/snapshots/session/subagent-agent-preset/tool-schemas.1.expected.json
@@ -293,10 +293,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -366,10 +362,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -402,10 +394,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -635,19 +623,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-agent-preset/tool-schemas.expected.json b/snapshots/session/subagent-agent-preset/tool-schemas.expected.json
index bc17f7317b..6b140ba3c9 100644
--- a/snapshots/session/subagent-agent-preset/tool-schemas.expected.json
+++ b/snapshots/session/subagent-agent-preset/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -366,10 +362,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -599,19 +591,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-child-question-rejection/tool-schemas.expected.json b/snapshots/session/subagent-child-question-rejection/tool-schemas.expected.json
index a68e1bba9c..2f5fbcad9b 100644
--- a/snapshots/session/subagent-child-question-rejection/tool-schemas.expected.json
+++ b/snapshots/session/subagent-child-question-rejection/tool-schemas.expected.json
@@ -393,10 +393,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -422,10 +418,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -655,19 +647,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-no-message-tool/tool-schemas.1.expected.json b/snapshots/session/subagent-no-message-tool/tool-schemas.1.expected.json
index ca3bacc071..6e996ab6a6 100644
--- a/snapshots/session/subagent-no-message-tool/tool-schemas.1.expected.json
+++ b/snapshots/session/subagent-no-message-tool/tool-schemas.1.expected.json
@@ -147,10 +147,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -176,10 +172,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -360,19 +352,6 @@
"meta"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": []
diff --git a/snapshots/session/subagent-structured-parent/tool-schemas.1.expected.json b/snapshots/session/subagent-structured-parent/tool-schemas.1.expected.json
index b29f82af9b..315cb5c728 100644
--- a/snapshots/session/subagent-structured-parent/tool-schemas.1.expected.json
+++ b/snapshots/session/subagent-structured-parent/tool-schemas.1.expected.json
@@ -345,10 +345,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -374,10 +370,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -615,19 +607,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-structured-parent/tool-schemas.expected.json b/snapshots/session/subagent-structured-parent/tool-schemas.expected.json
index c73811859c..67346c807b 100644
--- a/snapshots/session/subagent-structured-parent/tool-schemas.expected.json
+++ b/snapshots/session/subagent-structured-parent/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -600,19 +592,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/subagent-tool-filter/tool-schemas.1.expected.json b/snapshots/session/subagent-tool-filter/tool-schemas.1.expected.json
index 4f86239c75..a1e109f898 100644
--- a/snapshots/session/subagent-tool-filter/tool-schemas.1.expected.json
+++ b/snapshots/session/subagent-tool-filter/tool-schemas.1.expected.json
@@ -176,10 +176,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -205,10 +201,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -402,19 +394,6 @@
"meta"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": []
diff --git a/snapshots/session/team-targets/tool-schemas.expected.json b/snapshots/session/team-targets/tool-schemas.expected.json
index 5e976f50f6..f8c6e792c2 100644
--- a/snapshots/session/team-targets/tool-schemas.expected.json
+++ b/snapshots/session/team-targets/tool-schemas.expected.json
@@ -346,10 +346,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -375,10 +371,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -759,19 +751,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/terminal-panel-tools/tool-schemas.expected.json b/snapshots/session/terminal-panel-tools/tool-schemas.expected.json
index 0a1bbcadda..9584439d5c 100644
--- a/snapshots/session/terminal-panel-tools/tool-schemas.expected.json
+++ b/snapshots/session/terminal-panel-tools/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -749,19 +741,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/text-turn/tool-schemas.expected.json b/snapshots/session/text-turn/tool-schemas.expected.json
index 08fc35470a..c9572289d9 100644
--- a/snapshots/session/text-turn/tool-schemas.expected.json
+++ b/snapshots/session/text-turn/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -592,19 +584,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/web-fetch/tool-schemas.expected.json b/snapshots/session/web-fetch/tool-schemas.expected.json
index 1f122af658..71a444e217 100644
--- a/snapshots/session/web-fetch/tool-schemas.expected.json
+++ b/snapshots/session/web-fetch/tool-schemas.expected.json
@@ -330,10 +330,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -359,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -573,19 +565,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/working-directory-admission/session.v4.jsonl b/snapshots/session/working-directory-admission/session.v4.jsonl
index d8d3c82eb2..59321c1592 100644
--- a/snapshots/session/working-directory-admission/session.v4.jsonl
+++ b/snapshots/session/working-directory-admission/session.v4.jsonl
@@ -2,25 +2,27 @@
{"type":"permission/preset","data":{"preset":"danger-full-access"}}
{"type":"sandbox/mode","data":{"mode":"danger-full-access"}}
{"type":"approval/policy","data":{"policy":"never"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Read the current directory with working_directory, then reply with exactly WORKING_DIRECTORY_ADMISSION_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
+{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Print the current directory with pwd, then reply with exactly WORKING_DIRECTORY_ADMISSION_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/selected"}}
+{"type":"working-directory/change","data":{"cwd":"{{cwd}}/selected","workspace":true}}
{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:2}}"}]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:3}}"}},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"Read the current directory with working_directory, then reply with exactly WORKING_DIRECTORY_ADMISSION_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"Print the current directory with pwd, then reply with exactly WORKING_DIRECTORY_ADMISSION_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}/selected\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/selected\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
-{"type":"session/title","data":{"title":"Read the current directory with","messageSeqs":[10],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791190471189,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791190471189,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791190471189,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791190471189,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":1,"callId":"directory-1","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-1"},"toolCallId":"directory-1","content":[{"type":"text","text":"{{cwd}}/selected"}],"isError":false,"id":"{{message:6}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"}
+{"type":"session/title","data":{"title":"Print the current directory with","messageSeqs":[10],"source":{"kind":"fallback"}}}
+{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-1","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794391077881,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794391077881,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-1","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}}},{"type":"chunk","time":1794391077881,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794391077881,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":1,"callId":"directory-1","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}}
+{"type":"job/registered","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"pwd","startedAt":1794391077891,"toolCall":{"callId":"directory-1","rootCallId":"directory-1"}}}
+{"type":"job/settled","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"pwd","startedAt":1794391077891,"toolCall":{"callId":"directory-1","rootCallId":"directory-1"},"finishedAt":1794391077968,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
+{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-1"},"toolCallId":"directory-1","content":[{"type":"text","text":"{{cwd}}/selected\n"}],"isError":false,"id":"{{message:6}}"},"meta":{"cwd":"{{cwd}}/selected"}},"sourceEventSeqs":[16],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":2}}
{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:2}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"WORKING_DIRECTORY_ADMISSION_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:7}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791190471212,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1791190471212,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKING_DIRECTORY_ADMISSION_OK"}}},{"type":"chunk","time":1791190471212,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791190471212,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"text","text":"WORKING_DIRECTORY_ADMISSION_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:7}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794391077984,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1794391077984,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKING_DIRECTORY_ADMISSION_OK"}}},{"type":"chunk","time":1794391077984,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794391077984,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/working-directory-consumers/session.v4.jsonl b/snapshots/session/working-directory-consumers/session.v4.jsonl
deleted file mode 100644
index 3fc11b7950..0000000000
--- a/snapshots/session/working-directory-consumers/session.v4.jsonl
+++ /dev/null
@@ -1,70 +0,0 @@
-{"type":"session","version":4,"id":"{{session:1}}","createdAt":0,"cwd":"{{cwd}}","isSeeded":false,"delegationDepth":0}
-{"type":"permission/preset","data":{"preset":"danger-full-access"}}
-{"type":"sandbox/mode","data":{"mode":"danger-full-access"}}
-{"type":"approval/policy","data":{"policy":"never"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
-{"type":"turn/start","data":{"turn":1}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":1}}
-{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."},{"type":"text","text":"Context from the snapshot-guard mod: this workspace is a demo checkout."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}
-{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}}
-{"type":"session/title","data":{"title":"Read the current directory with","messageSeqs":[8],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907814,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907814,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791427907814,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907814,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":1,"callId":"directory-1","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-1"},"toolCallId":"directory-1","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:5}}"}},"sourceEventSeqs":[14],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":1}}
-{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907831,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907831,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}}},{"type":"chunk","time":1791427907831,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907831,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":2,"callId":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/selected"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"}]}}
-{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-2"},"toolCallId":"directory-2","content":[{"type":"text","text":"{{cwd}}/selected\nMods directory facts: {\"directory\":\"selected\",\"rootIsCurrent\":false,\"read\":\"selected witness\\n\",\"exists\":true,\"stat\":\"file\",\"listed\":true,\"processCwdMatches\":true}"}],"isError":false,"id":"{{message:8}}"}},"sourceEventSeqs":[19],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":2}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:9}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907883,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907883,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}}},{"type":"chunk","time":1791427907883,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907883,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":3,"callId":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}}
-{"type":"tool/result","data":{"turn":1,"step":3,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-3"},"toolCallId":"directory-3","content":[{"type":"text","text":"{{cwd}}/selected/result.txt\nfile\n\nCreated file\n"}],"isError":false,"id":"{{message:11}}"},"meta":{"operation":"create","path":"{{cwd}}/selected/result.txt","diffs":[]}},"sourceEventSeqs":[29],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":3}}
-{"type":"step/start","data":{"turn":1,"step":4}}
-{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907905,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907905,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}}},{"type":"chunk","time":1791427907905,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907905,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":4,"callId":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/second"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"}]}}
-{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-4"},"toolCallId":"directory-4","content":[{"type":"text","text":"{{cwd}}/second\nMods directory facts: {\"directory\":\"second\",\"rootIsCurrent\":false,\"read\":\"second directory\\n\",\"exists\":true,\"stat\":\"file\",\"listed\":true,\"processCwdMatches\":true}"}],"isError":false,"id":"{{message:14}}"}},"sourceEventSeqs":[34],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":4}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":5}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/second\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/second\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:15}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:16}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907955,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907955,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}}},{"type":"chunk","time":1791427907955,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907955,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":5,"callId":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}}
-{"type":"tool/result","data":{"turn":1,"step":5,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-5"},"toolCallId":"directory-5","content":[{"type":"text","text":"{{cwd}}/second/witness.txt\nfile\n\n1: second directory\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:17}}"},"meta":{"path":"{{cwd}}/second/witness.txt","offset":1,"lines":[{"number":1,"text":"second directory"}],"totalLines":1}},"sourceEventSeqs":[44],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":5}}
-{"type":"step/start","data":{"turn":1,"step":6}}
-{"type":"assistant/message","data":{"turn":1,"step":6,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:18}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907972,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907972,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}}},{"type":"chunk","time":1791427907972,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907972,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":6,"callId":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}}
-{"type":"job/registered","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"cd .. && rm -rf second","startedAt":1791427907979,"toolCall":{"callId":"directory-6","rootCallId":"directory-6"}}}
-{"type":"job/settled","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"cd .. && rm -rf second","startedAt":1791427907979,"toolCall":{"callId":"directory-6","rootCallId":"directory-6"},"finishedAt":1791427907984,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
-{"type":"tool/result","data":{"turn":1,"step":6,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-6"},"toolCallId":"directory-6","content":[{"type":"text","text":"(no output)"}],"isError":false,"id":"{{message:19}}"},"meta":{"cwd":"{{cwd}}/second"}},"sourceEventSeqs":[49],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":6}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"}]}}
-{"type":"step/start","data":{"turn":1,"step":7}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:21}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":7,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:22}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427907996,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427907996,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791427907996,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427907996,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":7,"callId":"directory-7","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":7,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-7"},"toolCallId":"directory-7","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:23}}"}},"sourceEventSeqs":[59],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":7}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":8}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":8,"message":{"role":"assistant","content":[{"type":"text","text":"WORKING_DIRECTORY_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:24}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427908011,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1791427908011,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKING_DIRECTORY_OK"}}},{"type":"chunk","time":1791427908011,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427908011,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":8}}
-{"type":"workspace/changes","data":{"turn":1}}
-{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/working-directory-consumers/snapshot.yml b/snapshots/session/working-directory-consumers/snapshot.yml
deleted file mode 100644
index 9958f8c29a..0000000000
--- a/snapshots/session/working-directory-consumers/snapshot.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-version: 1
-scenario: working-directory-consumers
-profile: headless
-composition: claude-code-mods
-recording: authored
-header:
- class: claude-code-mods
-platform: posix
-workspace:
- final: true
diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt
deleted file mode 100644
index a1c2155342..0000000000
--- a/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt
+++ /dev/null
@@ -1 +0,0 @@
-keep this file
diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json b/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json
deleted file mode 100644
index c2c27a8bbe..0000000000
--- a/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json
+++ /dev/null
@@ -1 +0,0 @@
-{"directory":"selected","rootIsCurrent":false,"read":"selected witness\n","exists":true,"stat":"file","listed":true,"processCwdMatches":true}
diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt
deleted file mode 100644
index 1dc18d3122..0000000000
--- a/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt
+++ /dev/null
@@ -1 +0,0 @@
-created inside selected
diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt
deleted file mode 100644
index eb04b8e4e0..0000000000
--- a/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt
+++ /dev/null
@@ -1 +0,0 @@
-selected witness
diff --git a/snapshots/session/working-directory-consumers/workspace/second/witness.txt b/snapshots/session/working-directory-consumers/workspace/second/witness.txt
deleted file mode 100644
index 595987b80f..0000000000
--- a/snapshots/session/working-directory-consumers/workspace/second/witness.txt
+++ /dev/null
@@ -1 +0,0 @@
-second directory
diff --git a/snapshots/session/working-directory-consumers/workspace/selected/input.txt b/snapshots/session/working-directory-consumers/workspace/selected/input.txt
deleted file mode 100644
index a1c2155342..0000000000
--- a/snapshots/session/working-directory-consumers/workspace/selected/input.txt
+++ /dev/null
@@ -1 +0,0 @@
-keep this file
diff --git a/snapshots/session/working-directory-consumers/workspace/selected/witness.txt b/snapshots/session/working-directory-consumers/workspace/selected/witness.txt
deleted file mode 100644
index eb04b8e4e0..0000000000
--- a/snapshots/session/working-directory-consumers/workspace/selected/witness.txt
+++ /dev/null
@@ -1 +0,0 @@
-selected witness
diff --git a/snapshots/session/working-directory/session.v4.jsonl b/snapshots/session/working-directory/session.v4.jsonl
deleted file mode 100644
index 7afe8eaac6..0000000000
--- a/snapshots/session/working-directory/session.v4.jsonl
+++ /dev/null
@@ -1,69 +0,0 @@
-{"type":"session","version":4,"id":"{{session:1}}","createdAt":0,"cwd":"{{cwd}}","isSeeded":false,"delegationDepth":0}
-{"type":"permission/preset","data":{"preset":"danger-full-access"}}
-{"type":"sandbox/mode","data":{"mode":"danger-full-access"}}
-{"type":"approval/policy","data":{"policy":"never"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
-{"type":"turn/start","data":{"turn":1}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":1}}
-{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}}
-{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash"}}
-{"type":"session/title","data":{"title":"Read the current directory with","messageSeqs":[8],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906114,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906114,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791427906114,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906114,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":1,"callId":"directory-1","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-1"},"toolCallId":"directory-1","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:5}}"}},"sourceEventSeqs":[14],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":1}}
-{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906132,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906132,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}}},{"type":"chunk","time":1791427906132,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906132,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":2,"callId":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/selected"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"}]}}
-{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-2"},"toolCallId":"directory-2","content":[{"type":"text","text":"{{cwd}}/selected"}],"isError":false,"id":"{{message:8}}"}},"sourceEventSeqs":[19],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":2}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/selected\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:9}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906150,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906150,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}}},{"type":"chunk","time":1791427906150,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906150,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":3,"callId":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}}
-{"type":"tool/result","data":{"turn":1,"step":3,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-3"},"toolCallId":"directory-3","content":[{"type":"text","text":"{{cwd}}/selected/result.txt\nfile\n\nCreated file\n"}],"isError":false,"id":"{{message:11}}"},"meta":{"operation":"create","path":"{{cwd}}/selected/result.txt","diffs":[]}},"sourceEventSeqs":[29],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":3}}
-{"type":"step/start","data":{"turn":1,"step":4}}
-{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906171,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906171,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}}},{"type":"chunk","time":1791427906171,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906171,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":4,"callId":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/second"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"}]}}
-{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-4"},"toolCallId":"directory-4","content":[{"type":"text","text":"{{cwd}}/second"}],"isError":false,"id":"{{message:14}}"}},"sourceEventSeqs":[34],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":4}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":5}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/second\".\nWorkspace root: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/second\".\nWorkspace root: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:15}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:16}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906188,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906188,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}}},{"type":"chunk","time":1791427906188,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906188,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":5,"callId":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}}
-{"type":"tool/result","data":{"turn":1,"step":5,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-5"},"toolCallId":"directory-5","content":[{"type":"text","text":"{{cwd}}/second/witness.txt\nfile\n\n1: second directory\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:17}}"},"meta":{"path":"{{cwd}}/second/witness.txt","offset":1,"lines":[{"number":1,"text":"second directory"}],"totalLines":1}},"sourceEventSeqs":[44],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":5}}
-{"type":"step/start","data":{"turn":1,"step":6}}
-{"type":"assistant/message","data":{"turn":1,"step":6,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:18}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906205,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906205,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}}},{"type":"chunk","time":1791427906205,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906205,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":6,"callId":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}}
-{"type":"job/registered","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"cd .. && rm -rf second","startedAt":1791427906213,"toolCall":{"callId":"directory-6","rootCallId":"directory-6"}}}
-{"type":"job/settled","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"cd .. && rm -rf second","startedAt":1791427906213,"toolCall":{"callId":"directory-6","rootCallId":"directory-6"},"finishedAt":1791427906218,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
-{"type":"tool/result","data":{"turn":1,"step":6,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-6"},"toolCallId":"directory-6","content":[{"type":"text","text":"(no output)"}],"isError":false,"id":"{{message:19}}"},"meta":{"cwd":"{{cwd}}/second"}},"sourceEventSeqs":[49],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":6}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"}]}}
-{"type":"step/start","data":{"turn":1,"step":7}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:21}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":7,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:22}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906231,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791427906231,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791427906231,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906231,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":7,"callId":"directory-7","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":7,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-7"},"toolCallId":"directory-7","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:23}}"}},"sourceEventSeqs":[59],"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":7}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
-{"type":"step/start","data":{"turn":1,"step":8}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":8,"message":{"role":"assistant","content":[{"type":"text","text":"WORKING_DIRECTORY_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:24}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791427906248,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1791427906248,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKING_DIRECTORY_OK"}}},{"type":"chunk","time":1791427906248,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791427906248,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
-{"type":"step/end","data":{"turn":1,"step":8}}
-{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/working-directory/snapshot.yml b/snapshots/session/working-directory/snapshot.yml
deleted file mode 100644
index e8899e5daf..0000000000
--- a/snapshots/session/working-directory/snapshot.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-version: 1
-scenario: working-directory
-profile: headless
-composition: default
-recording: authored
-header:
- class: default
-platform: posix
-workspace:
- final: true
diff --git a/snapshots/session/working-directory/workspace.expected/selected/input.txt b/snapshots/session/working-directory/workspace.expected/selected/input.txt
deleted file mode 100644
index a1c2155342..0000000000
--- a/snapshots/session/working-directory/workspace.expected/selected/input.txt
+++ /dev/null
@@ -1 +0,0 @@
-keep this file
diff --git a/snapshots/session/working-directory/workspace.expected/selected/result.txt b/snapshots/session/working-directory/workspace.expected/selected/result.txt
deleted file mode 100644
index 1dc18d3122..0000000000
--- a/snapshots/session/working-directory/workspace.expected/selected/result.txt
+++ /dev/null
@@ -1 +0,0 @@
-created inside selected
diff --git a/snapshots/session/working-directory/workspace/second/witness.txt b/snapshots/session/working-directory/workspace/second/witness.txt
deleted file mode 100644
index 595987b80f..0000000000
--- a/snapshots/session/working-directory/workspace/second/witness.txt
+++ /dev/null
@@ -1 +0,0 @@
-second directory
diff --git a/snapshots/session/working-directory/workspace/selected/input.txt b/snapshots/session/working-directory/workspace/selected/input.txt
deleted file mode 100644
index a1c2155342..0000000000
--- a/snapshots/session/working-directory/workspace/selected/input.txt
+++ /dev/null
@@ -1 +0,0 @@
-keep this file
diff --git a/snapshots/session/workspace-dependencies/tool-schemas.expected.json b/snapshots/session/workspace-dependencies/tool-schemas.expected.json
index 85be772822..15d920031a 100644
--- a/snapshots/session/workspace-dependencies/tool-schemas.expected.json
+++ b/snapshots/session/workspace-dependencies/tool-schemas.expected.json
@@ -293,10 +293,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -322,10 +318,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -555,19 +547,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/session/worktree/session.v4.jsonl b/snapshots/session/worktree/session.v4.jsonl
index 1eee80365e..b6019d14c9 100644
--- a/snapshots/session/worktree/session.v4.jsonl
+++ b/snapshots/session/worktree/session.v4.jsonl
@@ -2,64 +2,94 @@
{"type":"permission/preset","data":{"preset":"danger-full-access"}}
{"type":"sandbox/mode","data":{"mode":"danger-full-access"}}
{"type":"approval/policy","data":{"policy":"never"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Create a worktree named isolated from HEAD, read tracked.txt, write result.txt containing exactly \"WORKTREE RESULT\\n\", return to the original directory with working_directory cd ../../.., read tracked.txt, run git status --porcelain=v1, and read the current directory. Reply exactly WORKTREE_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
+{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Create a worktree named isolated from HEAD, read tracked.txt, write result.txt containing exactly \"WORKTREE RESULT\\n\", leave it with exit_worktree, read tracked.txt, run git status --porcelain=v1, and print the current directory with pwd. Then create a worktree named doomed, remove it from the source checkout with git worktree remove --force, and read tracked.txt again. Reply exactly WORKTREE_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}}
{"type":"turn/start","data":{"turn":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":1}}
{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"}
-{"type":"user/message","data":{"content":[{"type":"text","text":"Create a worktree named isolated from HEAD, read tracked.txt, write result.txt containing exactly \"WORKTREE RESULT\\n\", return to the original directory with working_directory cd ../../.., read tracked.txt, run git status --porcelain=v1, and read the current directory. Reply exactly WORKTREE_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"Create a worktree named isolated from HEAD, read tracked.txt, write result.txt containing exactly \"WORKTREE RESULT\\n\", leave it with exit_worktree, read tracked.txt, run git status --porcelain=v1, and print the current directory with pwd. Then create a worktree named doomed, remove it from the source checkout with git worktree remove --force, and read tracked.txt again. Reply exactly WORKTREE_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}}
{"type":"session/title","data":{"title":"Create a worktree named isolated","messageSeqs":[8],"source":{"kind":"fallback"}}}
-{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-1","name":"create_worktree","arguments":"{\"name\":\"isolated\",\"from\":\"HEAD\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853747977,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853747977,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-1","name":"create_worktree","arguments":"{\"name\":\"isolated\",\"from\":\"HEAD\"}"}}},{"type":"chunk","time":1793853747977,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853747977,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-1","name":"create_worktree","arguments":"{\"name\":\"isolated\",\"from\":\"HEAD\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455414,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455414,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-1","name":"create_worktree","arguments":"{\"name\":\"isolated\",\"from\":\"HEAD\"}"}}},{"type":"chunk","time":1794389455414,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455414,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"worktree-1","name":"create_worktree","arguments":"{\"name\":\"isolated\",\"from\":\"HEAD\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}/.agents/worktrees/isolated","anchor":"{{cwd}}/.agents/worktrees/isolated"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/isolated\". \"{{cwd}}/.agents/worktrees/isolated\" is now the workspace root."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:5}}"}]}}
+{"type":"working-directory/change","data":{"cwd":"{{cwd}}/.agents/worktrees/isolated","workspace":true}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/isolated\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:5}}"}]}}
{"type":"plugin:worktree/created","data":{"path":"{{cwd}}/.agents/worktrees/isolated","branch":"isolated","baseCommit":"86e2ed339bd583c54e29aaf0698fb8fb176ddcbb","repositoryRoot":"{{cwd}}"},"ignorable":true}
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-1"},"toolCallId":"worktree-1","content":[{"type":"text","text":"{\"path\":\"{{cwd}}/.agents/worktrees/isolated\",\"branch\":\"isolated\",\"baseCommit\":\"86e2ed339bd583c54e29aaf0698fb8fb176ddcbb\",\"repositoryRoot\":\"{{cwd}}\"}"}],"isError":false,"id":"{{message:6}}"}},"sourceEventSeqs":[14],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/isolated\". \"{{cwd}}/.agents/worktrees/isolated\" is now the workspace root."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/isolated\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/.agents/worktrees/isolated\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/.agents/worktrees/isolated\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-2","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748095,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748095,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-2","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}},{"type":"chunk","time":1793853748095,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748095,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-2","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:8}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455590,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455590,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-2","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}},{"type":"chunk","time":1794389455590,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455590,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"worktree-2","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}
{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-2"},"toolCallId":"worktree-2","content":[{"type":"text","text":"{{cwd}}/.agents/worktrees/isolated/tracked.txt\nfile\n\n1: COMMITTED CONTENT\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:9}}"},"meta":{"path":"{{cwd}}/.agents/worktrees/isolated/tracked.txt","offset":1,"lines":[{"number":1,"text":"COMMITTED CONTENT"}],"totalLines":1}},"sourceEventSeqs":[25],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":2}}
{"type":"step/start","data":{"turn":1,"step":3}}
-{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"WORKTREE RESULT\\n\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748112,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748112,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"WORKTREE RESULT\\n\"}"}}},{"type":"chunk","time":1793853748112,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748112,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"WORKTREE RESULT\\n\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455611,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455611,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"WORKTREE RESULT\\n\"}"}}},{"type":"chunk","time":1794389455611,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455611,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":3,"callId":"worktree-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"WORKTREE RESULT\\n\"}"}}
{"type":"tool/result","data":{"turn":1,"step":3,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-3"},"toolCallId":"worktree-3","content":[{"type":"text","text":"{{cwd}}/.agents/worktrees/isolated/result.txt\nfile\n\nCreated file\n"}],"isError":false,"id":"{{message:11}}"},"meta":{"operation":"create","path":"{{cwd}}/.agents/worktrees/isolated/result.txt","diffs":[]}},"sourceEventSeqs":[30],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":3}}
{"type":"step/start","data":{"turn":1,"step":4}}
-{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-4","name":"working_directory","arguments":"{\"cd\":\"../../..\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748132,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748132,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-4","name":"working_directory","arguments":"{\"cd\":\"../../..\"}"}}},{"type":"chunk","time":1793853748132,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748132,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":4,"callId":"worktree-4","name":"working_directory","arguments":"{\"cd\":\"../../..\"}"}}
-{"type":"working-directory/change","data":{"cwd":"{{cwd}}"}}
-{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/.agents/worktrees/isolated\" to \"{{cwd}}\". \"{{cwd}}\" is now the workspace root."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"}]}}
-{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-4"},"toolCallId":"worktree-4","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:14}}"}},"sourceEventSeqs":[35],"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-4","name":"exit_worktree","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455634,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455634,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-4","name":"exit_worktree","arguments":"{}"}}},{"type":"chunk","time":1794389455634,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455634,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":4,"callId":"worktree-4","name":"exit_worktree","arguments":"{}"}}
+{"type":"working-directory/change","data":{"cwd":"{{cwd}}","workspace":true}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/.agents/worktrees/isolated\" to \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"}]}}
+{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-4"},"toolCallId":"worktree-4","content":[{"type":"text","text":"{\"path\":\"{{cwd}}/.agents/worktrees/isolated\",\"branch\":\"isolated\",\"baseCommit\":\"86e2ed339bd583c54e29aaf0698fb8fb176ddcbb\",\"repositoryRoot\":\"{{cwd}}\"}"}],"isError":false,"id":"{{message:14}}"}},"sourceEventSeqs":[35],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":4}}
{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
{"type":"step/start","data":{"turn":1,"step":5}}
-{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/.agents/worktrees/isolated\" to \"{{cwd}}\". \"{{cwd}}\" is now the workspace root."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/.agents/worktrees/isolated\" to \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:15}}"},"surfaceOp":"append"}
-{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-5","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:16}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748149,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748149,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-5","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}},{"type":"chunk","time":1793853748149,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748149,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-5","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:16}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455654,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455654,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-5","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}},{"type":"chunk","time":1794389455654,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455654,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":5,"callId":"worktree-5","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}
{"type":"tool/result","data":{"turn":1,"step":5,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-5"},"toolCallId":"worktree-5","content":[{"type":"text","text":"{{cwd}}/tracked.txt\nfile\n\n1: DIRTY SOURCE\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:17}}"},"meta":{"path":"{{cwd}}/tracked.txt","offset":1,"lines":[{"number":1,"text":"DIRTY SOURCE"}],"totalLines":1}},"sourceEventSeqs":[45],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":5}}
{"type":"step/start","data":{"turn":1,"step":6}}
-{"type":"assistant/message","data":{"turn":1,"step":6,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-6","name":"bash","arguments":"{\"command\":\"git status --porcelain=v1\",\"description\":\"Inspect the original checkout\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:18}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748165,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748165,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-6","name":"bash","arguments":"{\"command\":\"git status --porcelain=v1\",\"description\":\"Inspect the original checkout\"}"}}},{"type":"chunk","time":1793853748165,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748165,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":6,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-6","name":"bash","arguments":"{\"command\":\"git status --porcelain=v1\",\"description\":\"Inspect the original checkout\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:18}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455672,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455672,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-6","name":"bash","arguments":"{\"command\":\"git status --porcelain=v1\",\"description\":\"Inspect the original checkout\"}"}}},{"type":"chunk","time":1794389455672,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455672,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":6,"callId":"worktree-6","name":"bash","arguments":"{\"command\":\"git status --porcelain=v1\",\"description\":\"Inspect the original checkout\"}"}}
-{"type":"job/registered","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"git status --porcelain=v1","startedAt":1793853748172,"toolCall":{"callId":"worktree-6","rootCallId":"worktree-6"}}}
-{"type":"job/settled","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"git status --porcelain=v1","startedAt":1793853748172,"toolCall":{"callId":"worktree-6","rootCallId":"worktree-6"},"finishedAt":1793853748274,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
+{"type":"job/registered","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"git status --porcelain=v1","startedAt":1794389455681,"toolCall":{"callId":"worktree-6","rootCallId":"worktree-6"}}}
+{"type":"job/settled","data":{"jobId":"{{id:1}}","owner":"{{session:1}}","kind":"bash","label":"git status --porcelain=v1","startedAt":1794389455681,"toolCall":{"callId":"worktree-6","rootCallId":"worktree-6"},"finishedAt":1794389455768,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
{"type":"tool/result","data":{"turn":1,"step":6,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-6"},"toolCallId":"worktree-6","content":[{"type":"text","text":" M tracked.txt\n?? local.txt\n"}],"isError":false,"id":"{{message:19}}"},"meta":{"cwd":"{{cwd}}"}},"sourceEventSeqs":[50],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":6}}
{"type":"step/start","data":{"turn":1,"step":7}}
-{"type":"assistant/message","data":{"turn":1,"step":7,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-7","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:20}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748286,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1793853748286,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-7","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1793853748286,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748286,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
-{"type":"tool/call","data":{"turn":1,"step":7,"callId":"worktree-7","name":"working_directory","arguments":"{}"}}
-{"type":"tool/result","data":{"turn":1,"step":7,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-7"},"toolCallId":"worktree-7","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:21}}"}},"sourceEventSeqs":[57],"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":7,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-7","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:20}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455783,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455783,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-7","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}}},{"type":"chunk","time":1794389455783,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455783,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":7,"callId":"worktree-7","name":"bash","arguments":"{\"command\":\"pwd\",\"description\":\"Print the current directory\"}"}}
+{"type":"job/registered","data":{"jobId":"{{id:2}}","owner":"{{session:1}}","kind":"bash","label":"pwd","startedAt":1794389455790,"toolCall":{"callId":"worktree-7","rootCallId":"worktree-7"}}}
+{"type":"job/settled","data":{"jobId":"{{id:2}}","owner":"{{session:1}}","kind":"bash","label":"pwd","startedAt":1794389455790,"toolCall":{"callId":"worktree-7","rootCallId":"worktree-7"},"finishedAt":1794389455860,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
+{"type":"tool/result","data":{"turn":1,"step":7,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-7"},"toolCallId":"worktree-7","content":[{"type":"text","text":"{{cwd}}\n"}],"isError":false,"id":"{{message:21}}"},"meta":{"cwd":"{{cwd}}"}},"sourceEventSeqs":[57],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":7}}
{"type":"step/start","data":{"turn":1,"step":8}}
-{"type":"assistant/message","data":{"turn":1,"step":8,"message":{"role":"assistant","content":[{"type":"text","text":"WORKTREE_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:22}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1793853748302,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1793853748302,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKTREE_OK"}}},{"type":"chunk","time":1793853748302,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1793853748302,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":8,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-8","name":"create_worktree","arguments":"{\"name\":\"doomed\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:22}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389455873,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389455873,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-8","name":"create_worktree","arguments":"{\"name\":\"doomed\"}"}}},{"type":"chunk","time":1794389455873,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389455873,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":8,"callId":"worktree-8","name":"create_worktree","arguments":"{\"name\":\"doomed\"}"}}
+{"type":"working-directory/change","data":{"cwd":"{{cwd}}/.agents/worktrees/doomed","workspace":true}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/doomed\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:23}}"}]}}
+{"type":"plugin:worktree/created","data":{"path":"{{cwd}}/.agents/worktrees/doomed","branch":"doomed","baseCommit":"86e2ed339bd583c54e29aaf0698fb8fb176ddcbb","repositoryRoot":"{{cwd}}"},"ignorable":true}
+{"type":"tool/result","data":{"turn":1,"step":8,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-8"},"toolCallId":"worktree-8","content":[{"type":"text","text":"{\"path\":\"{{cwd}}/.agents/worktrees/doomed\",\"branch\":\"doomed\",\"baseCommit\":\"86e2ed339bd583c54e29aaf0698fb8fb176ddcbb\",\"repositoryRoot\":\"{{cwd}}\"}"}],"isError":false,"id":"{{message:24}}"}},"sourceEventSeqs":[64],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":8}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
+{"type":"step/start","data":{"turn":1,"step":9}}
+{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/.agents/worktrees/doomed\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:23}}"},"surfaceOp":"append"}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}/.agents/worktrees/doomed\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/.agents/worktrees/doomed\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:25}}"},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":9,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-9","name":"bash","arguments":"{\"command\":\"cd ../../.. && git worktree remove --force .agents/worktrees/doomed\",\"description\":\"Remove the worktree this session works in\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:26}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389456056,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389456056,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-9","name":"bash","arguments":"{\"command\":\"cd ../../.. && git worktree remove --force .agents/worktrees/doomed\",\"description\":\"Remove the worktree this session works in\"}"}}},{"type":"chunk","time":1794389456056,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389456056,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":9,"callId":"worktree-9","name":"bash","arguments":"{\"command\":\"cd ../../.. && git worktree remove --force .agents/worktrees/doomed\",\"description\":\"Remove the worktree this session works in\"}"}}
+{"type":"job/registered","data":{"jobId":"{{id:3}}","owner":"{{session:1}}","kind":"bash","label":"cd ../../.. && git worktree remove --force .agents/worktrees/doomed","startedAt":1794389456063,"toolCall":{"callId":"worktree-9","rootCallId":"worktree-9"}}}
+{"type":"job/settled","data":{"jobId":"{{id:3}}","owner":"{{session:1}}","kind":"bash","label":"cd ../../.. && git worktree remove --force .agents/worktrees/doomed","startedAt":1794389456063,"toolCall":{"callId":"worktree-9","rootCallId":"worktree-9"},"finishedAt":1794389456240,"status":"completed","cause":"producer","producerReported":true,"detail":"exit code: 0"}}
+{"type":"tool/result","data":{"turn":1,"step":9,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-9"},"toolCallId":"worktree-9","content":[{"type":"text","text":"(no output)"}],"isError":false,"id":"{{message:27}}"},"meta":{"cwd":"{{cwd}}/.agents/worktrees/doomed"}},"sourceEventSeqs":[75],"surfaceOp":"append"}
+{"type":"step/end","data":{"turn":1,"step":9}}
+{"type":"working-directory/change","data":{"cwd":"{{cwd}}","workspace":true}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory \"{{cwd}}/.agents/worktrees/doomed\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:28}}"}]}}
+{"type":"step/start","data":{"turn":1,"step":10}}
+{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session. It replaces earlier versions of this context, including any retained in conversation summaries.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`).\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."}]},"role":"user","id":"{{message:29}}"},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":10,"message":{"role":"assistant","content":[{"type":"tool-call","id":"worktree-10","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:30}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389456254,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1794389456255,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"worktree-10","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}},{"type":"chunk","time":1794389456255,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389456255,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
+{"type":"tool/call","data":{"turn":1,"step":10,"callId":"worktree-10","name":"read","arguments":"{\"file_path\":\"tracked.txt\"}"}}
+{"type":"tool/result","data":{"turn":1,"step":10,"message":{"role":"tool","source":{"kind":"tool","callId":"worktree-10"},"toolCallId":"worktree-10","content":[{"type":"text","text":"{{cwd}}/tracked.txt\nfile\n\n1: DIRTY SOURCE\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:31}}"},"meta":{"path":"{{cwd}}/tracked.txt","offset":1,"lines":[{"number":1,"text":"DIRTY SOURCE"}],"totalLines":1}},"sourceEventSeqs":[85],"surfaceOp":"append"}
+{"type":"step/end","data":{"turn":1,"step":10}}
+{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}}
+{"type":"step/start","data":{"turn":1,"step":11}}
+{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory \"{{cwd}}/.agents/worktrees/doomed\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:28}}"},"surfaceOp":"append"}
+{"type":"assistant/message","data":{"turn":1,"step":11,"message":{"role":"assistant","content":[{"type":"text","text":"WORKTREE_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:32}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1794389456273,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1794389456273,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKTREE_OK"}}},{"type":"chunk","time":1794389456273,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1794389456273,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"}
+{"type":"step/end","data":{"turn":1,"step":11}}
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
diff --git a/snapshots/session/worktree/tool-schemas.expected.json b/snapshots/session/worktree/tool-schemas.expected.json
index 273604b19b..99113e0bbe 100644
--- a/snapshots/session/worktree/tool-schemas.expected.json
+++ b/snapshots/session/worktree/tool-schemas.expected.json
@@ -95,7 +95,7 @@
},
{
"name": "create_worktree",
- "description": "Create a new Git branch and worktree from a local commit, branch, or tag, then change this session's working directory to it. Uncommitted files stay in the source checkout. Existing names fail. Use working_directory with cd to leave; the checkout and branch remain.",
+ "description": "Create a new Git branch and worktree from a local commit, branch, or tag, then change this session's working directory to it. Uncommitted files stay in the source checkout. Existing names fail. exit_worktree returns to the source checkout.",
"parameters": {
"type": "object",
"properties": {
@@ -152,6 +152,14 @@
]
}
},
+ {
+ "name": "exit_worktree",
+ "description": "Change this session's working directory from the worktree it is in back to the checkout that worktree was created from, and report the worktree left. The worktree and its branch remain.",
+ "parameters": {
+ "type": "object",
+ "properties": {}
+ }
+ },
{
"name": "get_goal",
"description": "Read the current session goal, including the id and revision that update_goal requires.",
@@ -347,10 +355,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -376,10 +380,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -609,19 +609,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/web/creation-recommendations/session.v4.jsonl b/snapshots/web/creation-recommendations/session.v4.jsonl
index e616ebffff..411f2132eb 100644
--- a/snapshots/web/creation-recommendations/session.v4.jsonl
+++ b/snapshots/web/creation-recommendations/session.v4.jsonl
@@ -11,7 +11,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n\nCurrent DeepSeek Harness implementation checkout: \"{{sourceRoot}}\".\n\nCurrent DeepSeek Harness Web GUI URL: \"{{webUrl}}\".\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"harness:source","text":"Current DeepSeek Harness implementation checkout: \"{{sourceRoot}}\"."},{"name":"app:web-surface","text":"Current DeepSeek Harness Web GUI URL: \"{{webUrl}}\"."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `dsh-doc`: Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skill; and when upgrading a plugin or profile to a newer DSH release. Loading it grants no permission to change files or the profile.\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n- `official-plugins`: Check DSH’s optional plugins when the user asks how to do or use something in this app, whether it can, or says a capability is missing or should change: tools, input, thinking or title display, session search, terminals, worktrees, agent teams, desktop control, automation, access, approvals, badges or signatures, plugins or plugin sources. Not a request to develop DSH, even in its own repository: load before reading files or source. Not for ordinary tasks, quoted wishes or declined offers.\n- `personalized-pages`: Plan an optional page or small tool when the user asks for a page, tab, panel, tool or interface in this app (even for one-off use), wants something to keep, revisit or update later, will keep changing data in your answer, or wants a live view of this app’s own data (Sessions, tasks, logs, workspace). Load this before reading any files or source; it says how to submit the proposal. Not for requested files or code, ordinary answers, existing-feature questions, quoted wishes or declined offers.\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"dsh-doc","description":"Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skill; and when upgrading a plugin or profile to a newer DSH release. Loading it grants no permission to change files or the profile."},{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."},{"name":"official-plugins","description":"Check DSH’s optional plugins when the user asks how to do or use something in this app, whether it can, or says a capability is missing or should change: tools, input, thinking or title display, session search, terminals, worktrees, agent teams, desktop control, automation, access, approvals, badges or signatures, plugins or plugin sources. Not a request to develop DSH, even in its own repository: load before reading files or source. Not for ordinary tasks, quoted wishes or declined offers."},{"name":"personalized-pages","description":"Plan an optional page or small tool when the user asks for a page, tab, panel, tool or interface in this app (even for one-off use), wants something to keep, revisit or update later, will keep changing data in your answer, or wants a live view of this app’s own data (Sessions, tasks, logs, workspace). Load this before reading any files or source; it says how to submit the proposal. Not for requested files or code, ordinary answers, existing-feature questions, quoted wishes or declined offers."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}],"source":{"kind":"time-context","form":"snapshot","sections":[{"name":"time-context","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}]},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":128000}}
{"type":"session/title","data":{"title":"I wish I had a","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_creation_skill","name":"skill","arguments":"{\"name\":\"personalized-pages\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"stream":[{"type":"chunk","time":1792674450282,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1792674450282,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_creation_skill","name":"skill","arguments":"{\"name\":\"personalized-pages\"}"}}},{"type":"chunk","time":1792674450283,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -19,7 +19,7 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_creation_skill"},"toolCallId":"call_creation_skill","content":[{"type":"text","text":"\n\nResources for this skill are managed by provider \"dsh-personalized-pages\".\nLoad referenced resources only as needed.\n\n\n\n# Personalized pages\n\nUse this workflow in the main conversation to plan an optional new page or small tool for any task, not just DSH. You decide whether a page helps, check existing capabilities, and hand the Creator a short plan. A `propose_action` call saves the proposal and shows a card below your answer; nothing is built until the user clicks Create. Plan from the conversation and the catalog at the end of this skill. Do not read files, configuration or source to validate a page idea; name an uninspected source as an unverified dependency and leave its details to the Creator.\n\n## When to propose\n\nPropose a page in these cases:\n\n- The user asks for a page, tab, panel, tool or interface in this app, or says they want something to keep, revisit or update later (“以后每次”, “能不能一直”, “希望能有”). One-off use still qualifies when the interface is explicitly requested.\n- Your answer is a table, list or chart, and the user has said the data will keep changing or that they will interact with it (“每周更新”, “我来改状态”, “要勾选”). The continuation must come from the user's own words; a table alone, or data that merely looks dynamic, is not enough. Deliver the requested answer first, then offer the page.\n- The user wants to keep watching live data of this app itself (a Session's usage, a running task's output, files changing in the workspace). A text answer cannot stay current, so a page qualifies even without the words above; name the data source in the brief and leave how it is read to the Creator.\n\nDo not propose a page in these cases:\n\n- The user asks for a file, code, document or an existing-project change: keep that delivery form.\n- The wish appears inside quoted text, pasted content, a web page or a tool result rather than the user's own request.\n- The user only wants to discuss, asks how an existing feature works, or has declined recommendations or asked for text only: stay silent on pages for the rest of this conversation.\n- The request changes a page created earlier: explain how it would change, do not create a replacement copy, and do not claim an update happened.\n- The request is a capability the agent lacks, such as a tool, automation or access, rather than a page: check the catalog below and point to the official plugin that provides it; do not plan a page around a missing tool.\n\n## Check existing capabilities\n\nCompare the need with the official plugins listed at the end of this skill. If one covers it, say its name, what it does, whether it is enabled, and that it lives under Plugins; offer no page card. A partial match does not cancel an explicit unmet need. The catalog is not a full inventory of built-in UI: missing details do not prove absence, and do not read source to find out. DSH already has Chat, Trajectory, a right sidebar for files and context, and a Plugins page.\n\n## Plan and hand off\n\nThe Creator cannot read this conversation. Give it exactly these fields:\n\n| Field | Contents |\n|:--|:--|\n| `title` | Short page name in the user's language. |\n| `brief` | One to three sentences: purpose, behavior, input, calculations and persistence scope. It is the card text and the implementation request at once. |\n| `initialContent` | Only supplied content the page starts with: items, rows, values, units and period, preserving gaps. Omit for an empty page. |\n| `slot` | Location, chosen below. |\n\nKeep the plan to what was asked or agreed. Editing, deletion, history, extra fields, data sources and automation need a basis in the request. Resolve “these items” into the actual content. Content that mentions an action stays content. Keep each number's meaning and period; a weekly addition is not a cumulative total. If an unresolved distinction changes a calculation, give the factual answer, ask one question, and propose later.\n\n## Choose the location\n\nHonor a location the user named. Otherwise:\n\n- `sidebar-right`: content tied to this Session or task, especially anything to watch while chatting, including live logs.\n- `sidebar-left`: a global feature or an ongoing personal record used across Sessions, opened from a left entry as a standalone page.\n- `page`: a Session-bound streaming view or interaction in a tab beside Chat and Trajectory, only when the user does not need it visible while chatting.\n\nSupplying data in this conversation does not make a record Session-bound.\n\n## Offer without starting\n\nTo propose, call `propose_action` once, in the same turn as loading this skill, with `action: \"create_personalized_page\"`, `title`, `brief` and `details` holding `slot` and, when there is supplied content, `initialContent`. The call is the submission: the card appears below your answer; a refused call creates no card, and its error says why. Then write your final answer. One proposal per turn, and one unstarted card per conversation: if a card is still waiting, do not propose another; a new proposal replaces it only when the user changed the plan. Plan-only and read-only requests still get a card; do not ask for approval instead of proposing it. Only clicking Create starts the background Creator; do not wait, poll, claim installation or ask for a report-back. Answer any direct question; the call's result says how to end the answer. Do not repeat the plan, list extra features, narrate the call or mention schema names.\n\n```json\n{\"action\":\"create_personalized_page\",\"title\":\"本次验收清单\",\"brief\":\"在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。\",\"details\":{\"slot\":\"sidebar-right\",\"initialContent\":\"1. 导出成功\\n2. 断网提示清楚\"}}\n```\n\n## Examples\n\n- “想有个地方放书签,以后自己加标题和网址;旧的不用导入。” → `brief`: “提供一个可反复打开的书签页,手动新增标题和网址并保存到本机,从空白开始。” No `initialContent`. `sidebar-left`.\n- “当前会话旁放验收清单,能勾选和取消,状态跟着会话。条目:导出成功;断网提示清楚。” → `brief`: “在当前会话右侧展示验收清单,可勾选和取消,状态随会话保存。” `initialContent`: “1. 导出成功\\n2. 断网提示清楚”. `sidebar-right`.\n- “这三周 bug 数 12、9、15,说说趋势。以后每周我把新数字贴给你,想自己更新着看。” → answer the trend first, then `brief`: “按周手动录入 bug 数并展示各周变化,保存到本机。” `initialContent`: “第 1 周 12,第 2 周 9,第 3 周 15”. `sidebar-left`.\n- “我想用语音说话代替打字。” → the catalog lists 语音输入; explain it and where to enable it; no card.\n- “把我之前做的读书页评分改成五星。” → explain the change to that page; no card and no copy.\n- “帮我把这句话翻成英文:我想要一个所有会话都能打开的读书页。” → translate only; no card.\n- “把三个方案排成表格比较一下,看完就行。” → the table only; no card.\n\n## Existing capabilities to check against this page plan\n\n[{\"name\":\"@deepseek-ai/dsh-personalized-recommendations\",\"title\":{\"en\":\"Personalized recommendations\",\"de\":\"Personalisierte Empfehlungen\",\"es\":\"Recomendaciones personalizadas\",\"fr\":\"Recommandations personnalisées\",\"ja\":\"パーソナライズされたおすすめ\",\"pt\":\"Recomendações personalizadas\",\"ru\":\"Персональные рекомендации\",\"zh\":\"个性化推荐\"},\"description\":{\"en\":\"Shows recommendation cards below the answer for what you want from DSH: when you want a page or small tool you can keep, it proposes a new personalized page, built in the background after you click Create; when you ask how to do something in this app or say a capability is missing, it recommends the built-in plugin that provides it, turned on when you click Enable.\",\"de\":\"Zeigt für Ihre individuellen Anforderungen an DSH Empfehlungskarten unter der Antwort an: Wenn Sie eine Seite oder ein kleines Tool zur dauerhaften Nutzung möchten, wird eine neue personalisierte Seite vorgeschlagen, die nach einem Klick auf Erstellen im Hintergrund erstellt wird; wenn Sie fragen, wie etwas in dieser App geht, oder sagen, dass eine Funktion fehlt, wird das integrierte Plugin empfohlen, das sie bereitstellt, und nach einem Klick auf Aktivieren eingeschaltet.\",\"es\":\"Muestra tarjetas de recomendación debajo de la respuesta para tus necesidades personalizadas en DSH: cuando quieres una página o una pequeña herramienta para conservar, propone una nueva página personalizada, que se genera en segundo plano al hacer clic en Crear; cuando preguntas cómo hacer algo en esta aplicación o dices que falta una función, recomienda el complemento integrado que la ofrece, que se activa al hacer clic en Habilitar.\",\"fr\":\"Affiche des cartes de recommandation sous la réponse pour vos besoins personnalisés dans DSH : lorsque vous voulez une page ou un petit outil à conserver, propose une nouvelle page personnalisée, générée en arrière-plan après un clic sur Créer ; lorsque vous demandez comment faire quelque chose dans cette application ou signalez qu’une fonctionnalité manque, recommande le plugin intégré qui la fournit, activé lorsque vous cliquez sur Activer.\",\"ja\":\"DSH に対するあなた個人のニーズに合わせて、回答の下におすすめカードを表示します。長く使えるページや小さなツールが欲しいときは新しいパーソナルページを提案し、「作成」をクリックするとバックグラウンドで生成します。このアプリで何かをする方法を尋ねたときや機能が足りないと言ったときは、それを提供する内蔵プラグインを推薦し、「有効にする」をクリックすると有効になります。\",\"pt\":\"Mostra cartões de recomendação abaixo da resposta para suas necessidades personalizadas no DSH: quando você quer uma página ou uma pequena ferramenta para manter, propõe uma nova página personalizada, gerada em segundo plano depois que você clica em Criar; quando você pergunta como fazer algo neste aplicativo ou diz que falta um recurso, recomenda o plug-in integrado que o oferece, ativado quando você clica em Ativar.\",\"ru\":\"Показывает карточки рекомендаций под ответом с учетом ваших индивидуальных потребностей в DSH: когда вам нужна страница или небольшой инструмент для постоянного использования, предлагает новую персональную страницу, которая создается в фоне после нажатия «Создать»; когда вы спрашиваете, как что-то сделать в этом приложении, или говорите, что не хватает какой-то возможности, рекомендует встроенный плагин, который ее предоставляет, и включает его после нажатия «Включить».\",\"zh\":\"针对你对 DSH 的个性化需求,在回答下方展示推荐卡片:想要能长期使用的页面或小工具时,提议新增个性化页面,点击创建后在后台生成;问到本应用怎么做某件事或缺少某项能力时,推荐对应的内置插件,点击启用后开启。\"},\"enabled\":true},{\"name\":\"@deepseek-ai/dsh-experimental-inspector-profile\",\"title\":{\"en\":\"Developer tools\",\"de\":\"Entwicklertools\",\"es\":\"Herramientas de desarrollador\",\"fr\":\"Outils de développement\",\"ja\":\"開発者ツール\",\"pt\":\"Ferramentas de desenvolvedor\",\"ru\":\"Инструменты разработчика\",\"zh\":\"开发者工具\"},\"description\":{\"en\":\"For troubleshooting: view what DSH recorded for a session in Session log, inspect per-turn and per-step statistics in the Statistics tab, and debug the DSH backend in Chrome DevTools.\",\"de\":\"Zur Fehlersuche: Sehen Sie in „Sitzungsprotokoll“, was DSH für eine Sitzung aufgezeichnet hat, prüfen Sie im Tab „Statistik“ Kontext, Dauer, Cache und Werkzeugkosten pro Runde und Schritt und debuggen Sie das DSH-Backend in Chrome DevTools.\",\"es\":\"Para solucionar problemas: vea en «Registro de sesión» lo que DSH registró de una sesión, consulte el contexto, los tiempos, la caché y el coste de herramientas por turno y paso en la pestaña «Estadísticas», y depure el backend de DSH en Chrome DevTools.\",\"fr\":\"Pour le dépannage : consultez dans « Journal de session » ce que DSH a enregistré pour une session, examinez le contexte, les durées, le cache et le coût des outils par tour et étape dans l’onglet « Statistiques », et déboguez le backend de DSH dans Chrome DevTools.\",\"ja\":\"トラブルシューティング用です。「セッションログ」で DSH がセッションについて記録した内容を確認し、「統計」タブでターン/ステップごとのコンテキスト、時間、キャッシュ、ツールコストを確認し、Chrome DevTools で DSH バックエンドをデバッグできます。\",\"pt\":\"Para solução de problemas: veja em «Registro da sessão» o que o DSH registrou de uma sessão, consulte contexto, tempos, cache e custo de ferramentas por turno e etapa na aba «Estatísticas» e depure o backend do DSH no Chrome DevTools.\",\"ru\":\"Для диагностики: просматривайте в «Журнале сеанса», что DSH записал для сеанса, смотрите контекст, время, кэш и стоимость инструментов по ходам и шагам на вкладке «Статистика» и отлаживайте бэкенд DSH в Chrome DevTools.\",\"zh\":\"用于排查问题:在「会话数据诊断」中查看 DSH 为会话记录的内容,在「统计」页签查看每轮/每步的上下文、耗时、缓存和工具成本,并在 Chrome DevTools 中调试 DSH 后端。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\",\"title\":{\"en\":\"Voice input\",\"de\":\"Spracheingabe\",\"es\":\"Entrada de voz\",\"fr\":\"Saisie vocale\",\"ja\":\"音声入力\",\"pt\":\"Entrada de voz\",\"ru\":\"Голосовой ввод\",\"zh\":\"语音输入\"},\"description\":{\"en\":\"Transcribe recordings locally with SenseVoice; first use requires installing dependencies.\",\"de\":\"Transkribieren Sie Aufnahmen lokal mit SenseVoice; Für die erste Verwendung müssen Abhängigkeiten installiert werden.\",\"es\":\"Transcribe grabaciones localmente con SenseVoice; El primer uso requiere instalar dependencias.\",\"fr\":\"Transcrivez les enregistrements localement avec SenseVoice ; la première utilisation nécessite l'installation de dépendances.\",\"ja\":\"ローカルの SenseVoice で録音を文字に起こします。初回利用時には依存関係のインストールが必要です。\",\"pt\":\"Transcreva gravações localmente com SenseVoice; o primeiro uso requer a instalação de dependências.\",\"ru\":\"Транскрибируйте записи локально с помощью SenseVoice; при первом использовании требуется установка зависимостей.\",\"zh\":\"在本机使用 SenseVoice 转写录音,首次使用需安装依赖。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-auto-review\",\"title\":{\"en\":\"Auto authorization review\",\"de\":\"Automatische Autorisierungsüberprüfung\",\"es\":\"Revisión de autorización automática\",\"fr\":\"Examen des autorisations automatiques\",\"ja\":\"自動認可レビュー\",\"pt\":\"Revisão de autorização automática\",\"ru\":\"Проверка автоматической авторизации\",\"zh\":\"自动授权审查\"},\"description\":{\"en\":\"Adds an Auto review access mode: before each tool call, a model checks it against what you asked for, runs allowed calls at once, and holds denied calls for your approval.\",\"de\":\"Fügt den Zugriffsmodus „Auto review“ hinzu: Vor jedem Tool-Aufruf prüft ein Modell den Aufruf anhand Ihrer Anforderung; zugelassene Aufrufe laufen sofort, abgelehnte Aufrufe warten auf Ihre Genehmigung.\",\"es\":\"Añade el modo de acceso “Auto review”: antes de cada llamada a una herramienta, un modelo comprueba la llamada frente a lo que usted pidió; las llamadas permitidas se ejecutan de inmediato y las denegadas esperan su aprobación.\",\"fr\":\"Ajoute le mode d'accès « Auto review » : avant chaque appel d'outil, un modèle vérifie l'appel par rapport à ce que vous avez demandé ; les appels autorisés s'exécutent immédiatement et les appels refusés attendent votre approbation.\",\"ja\":\"「自動認可レビュー」アクセスモードを追加します。各ツール呼び出しの前に、モデルがその呼び出しをあなたの依頼内容と照らし合わせて確認し、許可された呼び出しは即座に実行され、拒否された呼び出しはあなたの承認を待ちます。\",\"pt\":\"Adiciona o modo de acesso “Auto review”: antes de cada chamada de ferramenta, um modelo verifica a chamada em relação ao que você pediu; as chamadas permitidas são executadas imediatamente e as negadas aguardam sua aprovação.\",\"ru\":\"Добавляет режим доступа «Auto review»: перед каждым вызовом инструмента модель сверяет вызов с вашей просьбой; разрешённые вызовы выполняются сразу, а отклонённые ждут вашего одобрения.\",\"zh\":\"提供“自动审查”访问模式:每次工具调用前,由模型对照你的要求检查,获准的调用立即运行,被拒绝的调用等你审批。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-cot-translation-bundle\",\"title\":{\"en\":\"Machine translation of reasoning\",\"de\":\"Maschinelle Übersetzung der Argumentation\",\"es\":\"Traducción automática de razonamiento\",\"fr\":\"Traduction automatique du raisonnement\",\"ja\":\"思考内容の機械翻訳\",\"pt\":\"Tradução automática de raciocínio\",\"ru\":\"Машинный перевод рассуждений\",\"zh\":\"思考过程机器翻译\"},\"description\":{\"en\":\"Translates expanded Think rows into your chosen language as the agent writes them, and View original switches back.\",\"de\":\"Übersetzt aufgeklappte „Denken Sie nach“-Zeilen, während der Agent sie schreibt, in die von Ihnen gewählte Sprache, und „Original ansehen“ wechselt zurück.\",\"es\":\"Traduce las filas “pensar” expandidas al idioma que elija mientras el agente las escribe, y “Ver original” vuelve al texto original.\",\"fr\":\"Traduit les lignes « Pensez » développées dans la langue de votre choix pendant que l'agent les écrit, et « Voir l'original » permet de revenir au texte d'origine.\",\"ja\":\"エージェントが書き出すのと同時に、展開された「思考」行を選択した言語に翻訳します。「原文を表示」で原文に戻せます。\",\"pt\":\"Traduz as linhas “Pense” expandidas para o idioma que você escolher enquanto o agente as escreve, e “Ver original” volta ao texto original.\",\"ru\":\"Переводит развёрнутые строки «Подумайте» на выбранный вами язык по мере того, как агент их пишет, а «Посмотреть оригинал» возвращает исходный текст.\",\"zh\":\"智能体输出时,把展开的“思考”行翻译成你选择的语言,点击“查看原文”可切换回原文。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-badge-skill-bundle\",\"title\":{\"en\":\"DSH badge skill\",\"de\":\"DSH-Abzeichen-Fertigkeit\",\"es\":\"Habilidad de insignia DSH\",\"fr\":\"Compétence du badge DSH\",\"ja\":\"DSH バッジスキル\",\"pt\":\"DSH habilidade de distintivo\",\"ru\":\"DSH значок навыка\",\"zh\":\"DSH 徽章技能\"},\"description\":{\"en\":\"Let agents add a “powered by dsh” badge to documents, pull requests, and other outputs.\",\"de\":\"Lassen Sie Agenten Dokumente, Pull-Requests und andere Ausgaben mit einem „powered by dsh“-Badge versehen.\",\"es\":\"Permita que los agentes agreguen una insignia \\\"con tecnología de dsh\\\" a documentos, solicitudes de extracción y otros resultados.\",\"fr\":\"Laissez les agents ajouter un badge « propulsé par dsh » aux documents, demandes d'extraction et autres sorties.\",\"ja\":\"エージェントが文書や PR などの成果物に「powered by dsh」バッジを追加できます。\",\"pt\":\"Permita que os agentes adicionem um selo “powered by dsh” a documentos, pull requests e outros resultados.\",\"ru\":\"Позвольте агентам добавлять значок «Powered by dsh» к документам, запросам на включение и другим результатам.\",\"zh\":\"让 Agent 为文档、PR 等产出添加「powered by dsh」徽章。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-ralph-bundle\",\"title\":{\"en\":\"Ralph loops\",\"de\":\"Ralph-Loops\",\"es\":\"Bucles de Ralph\",\"fr\":\"Boucles Ralph\",\"ja\":\"Ralph ループ\",\"pt\":\"Loops de Ralph\",\"ru\":\"Ральф петли\",\"zh\":\"Ralph 循环\"},\"description\":{\"en\":\"Ask for a Ralph loop with a goal, and the agent starts a fresh agent on it round after round until the goal is met, a blocker is reported, or the round limit is reached.\",\"de\":\"Bitten Sie um eine Ralph-Schleife mit einem Ziel, und der Agent startet Runde um Runde einen neuen Agenten darauf, bis das Ziel erreicht ist, ein Hindernis gemeldet wird oder das Rundenlimit erreicht ist.\",\"es\":\"Pida un bucle Ralph con un objetivo, y el agente inicia un agente nuevo sobre él ronda tras ronda hasta que se cumpla el objetivo, se informe de un bloqueo o se alcance el límite de rondas.\",\"fr\":\"Demandez une boucle Ralph avec un objectif, et l'agent lance un nouvel agent dessus, tour après tour, jusqu'à ce que l'objectif soit atteint, qu'un blocage soit signalé ou que la limite de tours soit atteinte.\",\"ja\":\"目標を指定して Ralph ループを依頼すると、エージェントは、目標が達成されるか、阻害要因が報告されるか、ラウンド数の上限に達するまで、ラウンドごとに新しいエージェントを起動してその目標に取り組ませます。\",\"pt\":\"Peça um loop Ralph com um objetivo, e o agente inicia um novo agente nele rodada após rodada até que o objetivo seja atingido, um bloqueio seja informado ou o limite de rodadas seja alcançado.\",\"ru\":\"Попросите запустить цикл Ralph с целью, и агент будет раунд за раундом запускать для неё нового агента, пока цель не будет достигнута, не будет сообщено о препятствии или не будет достигнут лимит раундов.\",\"zh\":\"要求用 Ralph 循环完成一个目标后,智能体会一轮接一轮地启动新的智能体处理它,直到目标达成、报告受阻或达到轮次上限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-titles-bundle\",\"title\":{\"en\":\"Conversation-following titles\",\"de\":\"Konversationsfolgende Titel\",\"es\":\"Títulos que siguen la conversación\",\"fr\":\"Titres de suivi de conversation\",\"ja\":\"会話に追従するタイトル\",\"pt\":\"Títulos que acompanham conversas\",\"ru\":\"Заголовки, следующие за разговором\",\"zh\":\"随对话更新的标题\"},\"description\":{\"en\":\"Writes a session's title from all of your messages and updates it when the main task changes, instead of only from the first message.\",\"de\":\"Erstellt den Titel einer Sitzung aus all Ihren Nachrichten und aktualisiert ihn, wenn sich die Hauptaufgabe ändert, statt ihn nur aus der ersten Nachricht zu bilden.\",\"es\":\"Escribe el título de una sesión a partir de todos sus mensajes y lo actualiza cuando cambia la tarea principal, en lugar de basarse solo en el primer mensaje.\",\"fr\":\"Rédige le titre d'une session à partir de tous vos messages et le met à jour lorsque la tâche principale change, au lieu de se baser uniquement sur le premier message.\",\"ja\":\"最初のメッセージだけでなく、あなたのすべてのメッセージからセッションのタイトルを作成し、主なタスクが変わったときに更新します。\",\"pt\":\"Escreve o título de uma sessão a partir de todas as suas mensagens e o atualiza quando a tarefa principal muda, em vez de usar apenas a primeira mensagem.\",\"ru\":\"Составляет заголовок сеанса по всем вашим сообщениям и обновляет его при смене основной задачи, а не только по первому сообщению.\",\"zh\":\"根据你的所有消息生成会话标题,并在主要任务变化时更新,而不是只根据第一条消息生成。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-terminal-bundle\",\"title\":{\"en\":\"Persistent terminals\",\"de\":\"Persistente Terminals\",\"es\":\"Terminales persistentes\",\"fr\":\"Terminaux persistants\",\"ja\":\"永続ターミナル\",\"pt\":\"Terminais persistentes\",\"ru\":\"Постоянные терминалы\",\"zh\":\"持久终端\"},\"description\":{\"en\":\"Gives the agent terminals that open as sidebar tabs you can watch and take over by typing in them. Processes keep running between tool calls, so it can start a dev server or REPL and come back later to read output; it can also read terminals you open yourself.\",\"de\":\"Stellt dem Agenten Terminals bereit, die als Seitenleisten-Tabs geöffnet werden; Sie können zusehen und durch Tippen die Kontrolle übernehmen. Prozesse laufen zwischen Tool-Aufrufen weiter, sodass er einen Entwicklungsserver oder eine REPL starten und später die Ausgabe lesen kann; er kann auch Terminals lesen, die Sie selbst öffnen.\",\"es\":\"Proporciona al agente terminales que se abren como pestañas de la barra lateral, que puede observar y controlar escribiendo en ellas. Los procesos siguen ejecutándose entre llamadas a herramientas, de modo que puede iniciar un servidor de desarrollo o un REPL y volver más tarde para leer la salida; también puede leer los terminales que usted abra.\",\"fr\":\"Fournit à l'agent des terminaux qui s'ouvrent comme onglets de la barre latérale ; vous pouvez les observer et en prendre le contrôle en y tapant. Les processus continuent de s'exécuter d'un appel d'outil à l'autre, afin qu'il puisse lancer un serveur de développement ou un REPL et revenir plus tard lire la sortie ; il peut aussi lire les terminaux que vous ouvrez vous-même.\",\"ja\":\"エージェントに、サイドバーのタブとして開くターミナルを提供します。様子を見守ることができ、入力すれば操作を引き継げます。プロセスはツール呼び出し間も実行され続けるため、開発サーバーや REPL を起動して後から出力を読めます。あなたが自分で開いたターミナルも読み取れます。\",\"pt\":\"Fornece ao agente terminais que abrem como abas da barra lateral, que você pode acompanhar e assumir digitando neles. Os processos continuam em execução entre chamadas de ferramentas, para que ele possa iniciar um servidor de desenvolvimento ou um REPL e voltar depois para ler a saída; ele também pode ler os terminais que você mesmo abrir.\",\"ru\":\"Предоставляет агенту терминалы, которые открываются вкладками боковой панели; вы можете наблюдать за ними и взять управление, начав вводить текст. Процессы продолжают работать между вызовами инструментов, поэтому агент может запустить сервер разработки или REPL и позже прочитать вывод; он также может читать терминалы, которые вы открыли сами.\",\"zh\":\"为智能体提供以侧栏标签页打开的终端,你可以旁观,也可以直接在其中键入来接管。进程在多次工具调用之间持续运行,因此它可以启动开发服务器或 REPL,稍后再读取输出;它也能读取你自己打开的终端。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-liveshare\",\"title\":{\"en\":\"LiveShare Session Sharing\",\"de\":\"LiveShare-Sitzungsfreigabe\",\"es\":\"Compartir sesión de LiveShare\",\"fr\":\"Partage de session LiveShare\",\"ja\":\"LiveShare セッション共有\",\"pt\":\"Compartilhamento de sessão do LiveShare\",\"ru\":\"Совместный доступ к сеансу LiveShare\",\"zh\":\"LiveShare 会话分享\"},\"description\":{\"en\":\"Share the current Session with a colleague, who can drive it in a browser, edit files inside the granted workspace when the share allows writes, or branch their own Session from the completed history.\",\"de\":\"Teilt die aktuelle Sitzung mit einer Kollegin oder einem Kollegen, die oder der sie im Browser bedienen, bei erlaubten Schreibzugriffen Dateien im freigegebenen Arbeitsbereich bearbeiten oder aus der abgeschlossenen Historie eine eigene Sitzung abzweigen kann.\",\"es\":\"Comparte la sesión actual con un compañero, que puede dirigirla en un navegador, editar archivos dentro del espacio de trabajo concedido cuando el recurso compartido permite escritura, o crear su propia sesión a partir del historial completado.\",\"fr\":\"Partagez la session en cours avec un collègue, qui peut la piloter dans un navigateur, modifier des fichiers dans l'espace de travail accordé lorsque le partage autorise l'écriture, ou créer sa propre session à partir de l'historique terminé.\",\"ja\":\"現在のセッションを同僚と共有し、ブラウザから操作してもらう、共有が書き込みを許可する場合は付与されたワークスペース内のファイルを編集してもらう、または完了した履歴から自分のセッションを分岐してもらえます。\",\"pt\":\"Compartilhe a sessão atual com um colega, que pode conduzi-la no navegador, editar arquivos dentro do espaço de trabalho concedido quando o compartilhamento permite escrita, ou ramificar a própria sessão a partir do histórico concluído.\",\"ru\":\"Поделитесь текущим сеансом с коллегой: он сможет управлять им в браузере, редактировать файлы в предоставленном рабочем пространстве, если общий доступ разрешает запись, или ответвить собственный сеанс из завершённой истории.\",\"zh\":\"把当前会话分享给同事,对方可在浏览器中驱动该会话、在分享允许写入时修改授权工作区内的文件,或从已完成历史分支出自己的会话。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-session-search\",\"title\":{\"en\":\"Session search\",\"de\":\"Sitzungssuche\",\"es\":\"búsqueda de sesión\",\"fr\":\"Recherche de sessions\",\"ja\":\"セッション検索\",\"pt\":\"Pesquisa de sessão\",\"ru\":\"Поиск сеанса\",\"zh\":\"会话搜索\"},\"description\":{\"en\":\"Ask about earlier work, such as “How did we fix the pool leak last week?”, and the agent searches your earlier sessions in the same workspace to answer.\",\"de\":\"Fragen Sie nach früherer Arbeit, etwa „Wie haben wir letzte Woche das Pool-Leck behoben?“, und der Agent durchsucht Ihre früheren Sitzungen aus demselben Arbeitsverzeichnis, um zu antworten.\",\"es\":\"Pregunte por trabajo anterior, como “¿Cómo arreglamos la fuga del pool la semana pasada?”, y el agente busca en sus sesiones anteriores del mismo directorio de trabajo para responder.\",\"fr\":\"Posez une question sur un travail antérieur, par exemple « Comment avons-nous corrigé la fuite du pool la semaine dernière ? », et l'agent recherche dans vos sessions antérieures du même répertoire de travail pour répondre.\",\"ja\":\"「先週プールのリークをどう直した?」のように以前の作業について尋ねると、エージェントは同じ作業ディレクトリの過去のセッションを検索して回答します。\",\"pt\":\"Pergunte sobre trabalhos anteriores, como “Como corrigimos o vazamento do pool na semana passada?”, e o agente pesquisa suas sessões anteriores do mesmo diretório de trabalho para responder.\",\"ru\":\"Спросите о прошлой работе, например «Как мы исправили утечку в пуле на прошлой неделе?», и агент выполнит поиск по вашим прошлым сеансам из того же рабочего каталога, чтобы ответить.\",\"zh\":\"询问以往的工作,例如“上周我们是怎么修好连接池泄漏的?”,智能体会搜索同一工作区的历史会话来回答。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-tool-worktree\",\"title\":{\"en\":\"Git worktrees\",\"de\":\"Git-Arbeitsbäume\",\"es\":\"árboles de trabajo de git\",\"fr\":\"Arbres de travail Git\",\"ja\":\"Git ワークツリー\",\"pt\":\"Árvores de trabalho Git\",\"ru\":\"Рабочие деревья Git\",\"zh\":\"Git 工作树\"},\"description\":{\"en\":\"Ask for work on a new branch, and the agent creates a separate Git worktree and continues there, leaving your current checkout as it is.\",\"de\":\"Bitten Sie um Arbeit auf einem neuen Branch, und der Agent erstellt einen separaten Git-Worktree und arbeitet dort weiter, während Ihr aktueller Checkout unverändert bleibt.\",\"es\":\"Pida trabajar en una rama nueva, y el agente crea un worktree de Git independiente y continúa allí, dejando su checkout actual tal como está.\",\"fr\":\"Demandez à travailler sur une nouvelle branche, et l'agent crée un worktree Git distinct et y poursuit le travail, en laissant votre copie de travail actuelle telle quelle.\",\"ja\":\"新しいブランチでの作業を依頼すると、エージェントは別の Git ワークツリーを作成してそこで作業を続け、現在のチェックアウトはそのまま残します。\",\"pt\":\"Peça para trabalhar em um novo branch, e o agente cria um worktree do Git separado e continua lá, deixando seu checkout atual como está.\",\"ru\":\"Попросите поработать в новой ветке, и агент создаст отдельное рабочее дерево Git и продолжит работу там, оставив вашу текущую рабочую копию как есть.\",\"zh\":\"要求在新分支上工作时,智能体会创建单独的 Git 工作树并在其中继续,你当前的工作树保持原样。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-cua-bundle\",\"title\":{\"en\":\"Computer use\",\"de\":\"Computernutzung\",\"es\":\"Uso de la computadora\",\"fr\":\"Utilisation de l'ordinateur\",\"ja\":\"Computer Use\",\"pt\":\"Uso do computador\",\"ru\":\"Использование компьютера\",\"zh\":\"Computer Use\"},\"description\":{\"en\":\"Currently supports macOS; Windows support is in development. Loads computer use for existing and new PTC sessions. Switch to PTC mode and grant Accessibility and Screen Recording permissions to use it.\",\"de\":\"Unterstützt derzeit macOS; Die Windows-Unterstützung befindet sich in der Entwicklung. Lädt die Computernutzung für bestehende und neue PTC-Sitzungen. Wechseln Sie in den PTC-Modus und erteilen Sie die Berechtigungen für Barrierefreiheit und Bildschirmaufzeichnung, um ihn zu verwenden.\",\"es\":\"Actualmente es compatible con macOS; El soporte para Windows está en desarrollo. Carga el uso de la computadora para sesiones PTC nuevas y existentes. Cambie al modo PTC y otorgue permisos de Accesibilidad y Grabación de pantalla para usarlo.\",\"fr\":\"Prend actuellement en charge macOS ; La prise en charge de Windows est en cours de développement. Charge l'utilisation de l'ordinateur pour les sessions PTC existantes et nouvelles. Passez en mode PTC et accordez les autorisations d’accessibilité et d’enregistrement d’écran pour l’utiliser.\",\"ja\":\"現在は macOS のみ対応し、Windows 対応は開発中です。既存および新規の PTC セッションに Computer Use を読み込みます。PTC モードに切り替え、アクセシビリティと画面収録の権限を許可して使用してください。\",\"pt\":\"Atualmente suporta macOS; O suporte Windows está em desenvolvimento. Carrega o uso do computador para sessões PTC novas e existentes. Mude para o modo PTC e conceda permissões de acessibilidade e gravação de tela para usá-lo.\",\"ru\":\"В настоящее время поддерживается macOS; Поддержка Windows находится в разработке. Загружает использование компьютера для существующих и новых сеансов PTC. Переключитесь в режим PTC и предоставьте разрешения на доступность и запись экрана для его использования.\",\"zh\":\"目前仅支持 macOS,Windows 支持正在开发中。为已有及新建 PTC 会话加载 Computer Use。请切换到 PTC 模式来使用,并授予辅助功能和屏幕录制权限。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-plugin-market-bundle\",\"title\":{\"en\":\"Custom plugin indexes\",\"de\":\"Benutzerdefinierte Plugin-Indizes\",\"es\":\"Índices de complementos personalizados\",\"fr\":\"Index de plugins personnalisés\",\"ja\":\"カスタムプラグインインデックス\",\"pt\":\"Índices de plug-ins personalizados\",\"ru\":\"Пользовательские индексы плагинов\",\"zh\":\"自定义插件索引\"},\"description\":{\"en\":\"Adds a Discover tab to Plugins, where you browse and install plugins from plugin indexes you add.\",\"de\":\"Fügt unter „Plugins“ den Tab „Entdecken“ hinzu, in dem Sie Plugins aus von Ihnen hinzugefügten Plugin-Indizes durchsuchen und installieren.\",\"es\":\"Añade la pestaña “Descubrir” a “Complementos”, donde puede explorar e instalar complementos de los índices de complementos que agregue.\",\"fr\":\"Ajoute à « Plugins » un onglet « Découvrez » où vous parcourez et installez des plugins provenant des index de plugins que vous ajoutez.\",\"ja\":\"「プラグイン」に「見つける」タブを追加し、追加したプラグインインデックスからプラグインを閲覧・インストールできるようにします。\",\"pt\":\"Adiciona a guia “Descubra” a “Plug-ins”, onde você navega e instala plug-ins dos índices de plug-ins que adiciona.\",\"ru\":\"Добавляет в «Плагины» вкладку «Откройте для себя», где можно просматривать и устанавливать плагины из добавленных вами индексов плагинов.\",\"zh\":\"在插件页添加“发现”标签页,从你添加的插件索引中浏览和安装插件。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-experimental-forge-bundle\",\"title\":{\"en\":\"Change requests & worktrees\",\"de\":\"Änderungsanfragen und Arbeitsbäume\",\"es\":\"Solicitudes de cambio y árboles de trabajo\",\"fr\":\"Demandes de modification et arbres de travail\",\"ja\":\"変更リクエストとワークツリー\",\"pt\":\"Solicitações de alteração e árvores de trabalho\",\"ru\":\"Запросы на изменение и рабочие деревья\",\"zh\":\"变更请求与工作树\"},\"description\":{\"en\":\"Keep linked GitHub pull requests beside your conversation: follow checks and reviews, inspect diffs, and send feedback to the agent. Review local changes and use a separate worktree to isolate each task. GitHub features require the gh CLI installed and signed in on the host.\",\"de\":\"Verknüpfte GitHub-Pull-Requests neben der Unterhaltung verfolgen: Prüfungen und Reviews ansehen, Code vergleichen und Feedback an den Agenten senden. Lokale Änderungen prüfen und Aufgaben mit separaten Arbeitsbäumen isolieren. GitHub-Funktionen erfordern eine installierte gh-CLI und eine Anmeldung auf dem Host.\",\"es\":\"Sigue los pull requests de GitHub vinculados a la conversación: consulta comprobaciones y revisiones, compara código y envía comentarios al agente. Revisa cambios locales y aísla cada tarea en un árbol de trabajo separado. Las funciones de GitHub requieren instalar la CLI gh e iniciar sesión en el equipo anfitrión.\",\"fr\":\"Suivez les pull requests GitHub liées à votre conversation : consultez les vérifications et les revues, comparez le code et transmettez vos remarques à l’agent. Examinez les modifications locales et isolez chaque tâche dans un arbre de travail séparé. Les fonctions GitHub nécessitent la CLI gh installée et une connexion sur l’hôte.\",\"ja\":\"会話のサイドバーで関連付けられた GitHub PR をまとめて確認できます。チェックやレビューの状況、コードの差分を確認し、修正案をエージェントに渡せます。ローカルの変更確認や、独立したワークツリーによるタスクの分離にも対応します。GitHub 機能にはホストでの gh CLI のインストールとログインが必要です。\",\"pt\":\"Acompanhe os pull requests do GitHub vinculados à conversa: consulte verificações e revisões, compare código e envie comentários ao agente. Revise alterações locais e isole cada tarefa em uma árvore de trabalho separada. Os recursos do GitHub exigem a CLI gh instalada e uma sessão iniciada no host.\",\"ru\":\"Следите за связанными с беседой pull request GitHub: проверками, рецензиями и различиями в коде, а затем передавайте замечания агенту. Просматривайте локальные изменения и изолируйте задачи в отдельных рабочих деревьях. Для функций GitHub требуется установить CLI gh и войти в аккаунт на хосте.\",\"zh\":\"在会话侧栏集中跟踪关联的 GitHub PR:查看检查状态、评审意见与代码差异,并把修改建议交给智能体继续处理。也可查看本地改动,用独立工作树隔离任务。GitHub 功能需要本机安装 gh 并登录。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-claude-code\",\"title\":{\"de\":\"Claude Code-Subagent\",\"en\":\"Claude Code subagent\",\"es\":\"Subagente Claude Code\",\"fr\":\"Sous-agent Claude Code\",\"ja\":\"Claude Code サブエージェント\",\"pt\":\"Claude Code subagente\",\"ru\":\"Субагент Claude Code\",\"zh\":\"Claude Code 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Claude Code, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Claude Code using its native authentication and settings.\",\"es\":\"Delegue una tarea a Claude Code utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Claude Code à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Claude Code のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Claude Code usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Claude Code, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Claude Code 原生认证和设置委派单个任务。\"},\"enabled\":false},{\"name\":\"@deepseek-ai/dsh-subagent-codex\",\"title\":{\"de\":\"Codex-Subagent\",\"en\":\"Codex subagent\",\"es\":\"Subagente Codex\",\"fr\":\"Sous-agent Codex\",\"ja\":\"Codex サブエージェント\",\"pt\":\"Codex subagente\",\"ru\":\"Субагент Codex\",\"zh\":\"Codex 子智能体\"},\"description\":{\"de\":\"Delegieren Sie eine Aufgabe an Codex, indem Sie dessen native Authentifizierung und Einstellungen verwenden.\",\"en\":\"Delegate one task to Codex using its native authentication and settings.\",\"es\":\"Delegue una tarea a Codex utilizando su autenticación y configuración nativas.\",\"fr\":\"Déléguez une tâche à Codex à l’aide de son authentification et de ses paramètres natifs.\",\"ja\":\"Codex のネイティブの認証と設定を使用して、単独のタスクを委派します。\",\"pt\":\"Delegue uma tarefa a Codex usando sua autenticação e configurações nativas.\",\"ru\":\"Делегируйте одну задачу Codex, используя его встроенную аутентификацию и настройки.\",\"zh\":\"使用 Codex 原生认证和设置委派单个任务。\"},\"enabled\":false}]\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","propose_action","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","propose_action","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"propose_action"}],"role":"developer","id":"{{message:8}}"},"headerSeq":20},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_creation_card","name":"propose_action","arguments":"{\"action\":\"create_personalized_page\",\"title\":\"Counter\",\"brief\":\"Need: Keep a small counter visible across conversations.\\nLocation: A card titled Today’s achievements in the right sidebar.\\nControls: Increment and reset buttons beside the current value.\\nStorage: Save changes in browser storage across navigation and refresh.\\nAppearance: Follow the existing sidebar theme in light and dark mode.\\nCompletion: Both controls work and reopening restores the saved value.\",\"details\":{\"slot\":\"sidebar-right\"}}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"stream":[{"type":"chunk","time":1792674450652,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1792674450652,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_creation_card","name":"propose_action","arguments":"{\"action\":\"create_personalized_page\",\"title\":\"Counter\",\"brief\":\"Need: Keep a small counter visible across conversations.\\nLocation: A card titled Today’s achievements in the right sidebar.\\nControls: Increment and reset buttons beside the current value.\\nStorage: Save changes in browser storage across navigation and refresh.\\nAppearance: Follow the existing sidebar theme in light and dark mode.\\nCompletion: Both controls work and reopening restores the saved value.\",\"details\":{\"slot\":\"sidebar-right\"}}"}}},{"type":"chunk","time":1792674450652,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_creation_card","name":"propose_action","arguments":"{\"action\":\"create_personalized_page\",\"title\":\"Counter\",\"brief\":\"Need: Keep a small counter visible across conversations.\\nLocation: A card titled Today’s achievements in the right sidebar.\\nControls: Increment and reset buttons beside the current value.\\nStorage: Save changes in browser storage across navigation and refresh.\\nAppearance: Follow the existing sidebar theme in light and dark mode.\\nCompletion: Both controls work and reopening restores the saved value.\",\"details\":{\"slot\":\"sidebar-right\"}}"}}
diff --git a/snapshots/web/creation-recommendations/tool-schemas.expected.json b/snapshots/web/creation-recommendations/tool-schemas.expected.json
index 3c82da7581..de71851b48 100644
--- a/snapshots/web/creation-recommendations/tool-schemas.expected.json
+++ b/snapshots/web/creation-recommendations/tool-schemas.expected.json
@@ -631,10 +631,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -672,10 +668,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -905,19 +897,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1617,10 +1596,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1658,10 +1633,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1891,19 +1862,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/web/creator-persona/tool-schemas.expected.json b/snapshots/web/creator-persona/tool-schemas.expected.json
index 09c4043629..a88c2dd640 100644
--- a/snapshots/web/creator-persona/tool-schemas.expected.json
+++ b/snapshots/web/creator-persona/tool-schemas.expected.json
@@ -644,10 +644,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -685,10 +681,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -918,19 +910,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/web/fresh-round-trip/tool-schemas.expected.json b/snapshots/web/fresh-round-trip/tool-schemas.expected.json
index eee574186f..2f3fe9c680 100644
--- a/snapshots/web/fresh-round-trip/tool-schemas.expected.json
+++ b/snapshots/web/fresh-round-trip/tool-schemas.expected.json
@@ -631,10 +631,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -672,10 +668,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -905,19 +897,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/web/minimal-compact/tool-schemas.expected.json b/snapshots/web/minimal-compact/tool-schemas.expected.json
index 5ed83c5ec3..c4885b999c 100644
--- a/snapshots/web/minimal-compact/tool-schemas.expected.json
+++ b/snapshots/web/minimal-compact/tool-schemas.expected.json
@@ -31,19 +31,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": [
@@ -79,19 +66,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
]
]
diff --git a/snapshots/web/minimal-preset/tool-schemas.expected.json b/snapshots/web/minimal-preset/tool-schemas.expected.json
index 8fcc102cb9..94aba3b1f2 100644
--- a/snapshots/web/minimal-preset/tool-schemas.expected.json
+++ b/snapshots/web/minimal-preset/tool-schemas.expected.json
@@ -31,19 +31,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": []
diff --git a/snapshots/web/minimal-read-image/tool-schemas.expected.json b/snapshots/web/minimal-read-image/tool-schemas.expected.json
index 8fcc102cb9..94aba3b1f2 100644
--- a/snapshots/web/minimal-read-image/tool-schemas.expected.json
+++ b/snapshots/web/minimal-read-image/tool-schemas.expected.json
@@ -31,19 +31,6 @@
"file_path"
]
}
- },
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
}
],
"changes": []
diff --git a/snapshots/web/official-subagent-bundle/system-prompt.expected.md b/snapshots/web/official-subagent-bundle/system-prompt.expected.md
index c50bd1640e..1375a9d409 100644
--- a/snapshots/web/official-subagent-bundle/system-prompt.expected.md
+++ b/snapshots/web/official-subagent-bundle/system-prompt.expected.md
@@ -238,8 +238,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -255,8 +253,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. This backend does not accept follow-up messages. */
subagent_claude_code: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -266,8 +262,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -315,11 +309,6 @@ interface ToolArgsMap {
/** 1–10 search queries; their results are merged. */
queries: string[];
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -1526,10 +1515,6 @@ interface ToolOutputMap {
}[];
truncated: boolean;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/web/optional-string-editor/system-prompt.expected.md b/snapshots/web/optional-string-editor/system-prompt.expected.md
index fe757ece2c..fc09c9da79 100644
--- a/snapshots/web/optional-string-editor/system-prompt.expected.md
+++ b/snapshots/web/optional-string-editor/system-prompt.expected.md
@@ -255,8 +255,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -272,8 +270,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -321,11 +317,6 @@ interface ToolArgsMap {
/** 1–10 search queries; their results are merged. */
queries: string[];
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -1529,10 +1520,6 @@ interface ToolOutputMap {
}[];
truncated: boolean;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/snapshots/web/plugin-recommendations/session.v4.jsonl b/snapshots/web/plugin-recommendations/session.v4.jsonl
index 0fb5b5e921..7ed8c84414 100644
--- a/snapshots/web/plugin-recommendations/session.v4.jsonl
+++ b/snapshots/web/plugin-recommendations/session.v4.jsonl
@@ -11,7 +11,7 @@
{"type":"user/message","data":{"content":[{"type":"text","text":"\nThe following information describes your current session:\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable.\n\nApproval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed.\n\nYou are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names.\n\nCurrent DeepSeek Harness implementation checkout: \"{{sourceRoot}}\".\n\nCurrent DeepSeek Harness Web GUI URL: \"{{webUrl}}\".\n"}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: workspace-write. Any available operation enforced by the DSH file sandbox may modify files under the session workspace: \"{{cwd}}\". Some platform temporary areas may also be writable."},{"name":"approval:policy","text":"Approval prompts are enabled in this session: operations that require approval may ask through the configured answerers; without an available answerer, the request fails closed."},{"name":"subagent:identity","text":"You are the root agent. Your name is \"lead\".\n\nTo message other agents, use send_message({ agent: \"\", message: \"...\" }).\nUse list_agents({}) to find your collaborator agents and their names."},{"name":"harness:source","text":"Current DeepSeek Harness implementation checkout: \"{{sourceRoot}}\"."},{"name":"app:web-surface","text":"Current DeepSeek Harness Web GUI URL: \"{{webUrl}}\"."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"\nA skill is a reusable set of task-specific instructions. The following skills are available in this session:\n\n\n- `dsh-doc`: Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skill; and when upgrading a plugin or profile to a newer DSH release. Loading it grants no permission to change files or the profile.\n- `office`: Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step.\n- `office-docx`: Create, read, edit, and validate Word documents (.docx).\n- `office-pptx`: Create, read, edit, and validate PowerPoint presentations (.pptx).\n- `office-xlsx`: Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx).\n- `official-plugins`: Check DSH’s optional plugins when the user asks how to do or use something in this app, whether it can, or says a capability is missing or should change: tools, input, thinking or title display, session search, terminals, worktrees, agent teams, desktop control, automation, access, approvals, badges or signatures, plugins or plugin sources. Not a request to develop DSH, even in its own repository: load before reading files or source. Not for ordinary tasks, quoted wishes or declined offers.\n- `personalized-pages`: Plan an optional page or small tool when the user asks for a page, tab, panel, tool or interface in this app (even for one-off use), wants something to keep, revisit or update later, will keep changing data in your answer, or wants a live view of this app’s own data (Sessions, tasks, logs, workspace). Load this before reading any files or source; it says how to submit the proposal. Not for requested files or code, ordinary answers, existing-feature questions, quoted wishes or declined offers.\n\n\nIf the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.\nA user may also invoke a skill directly; its block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.\n"}],"source":{"kind":"skill-catalog","form":"catalog","entries":[{"name":"dsh-doc","description":"Use when a task needs facts about DeepSeek Harness (DSH) itself, such as how a feature, setting, plugin, agent preset, tool, or Cordis API of the running installation works; when the user asks to design, review, build, install, enable, or debug a DSH plugin, bundle, MCP connection, agent preset, plugin icon or detail page, or a DSH tool definition or skill; and when upgrading a plugin or profile to a newer DSH release. Loading it grants no permission to change files or the profile."},{"name":"office","description":"Create or edit Office files; inspect Office files and PDFs. Load before rendering, conversion, or recalculation to enable office_render, office_convert, and office_recalculate next step."},{"name":"office-docx","description":"Create, read, edit, and validate Word documents (.docx)."},{"name":"office-pptx","description":"Create, read, edit, and validate PowerPoint presentations (.pptx)."},{"name":"office-xlsx","description":"Read, create, edit, and validate Excel workbooks, data, and formulas (.xlsx)."},{"name":"official-plugins","description":"Check DSH’s optional plugins when the user asks how to do or use something in this app, whether it can, or says a capability is missing or should change: tools, input, thinking or title display, session search, terminals, worktrees, agent teams, desktop control, automation, access, approvals, badges or signatures, plugins or plugin sources. Not a request to develop DSH, even in its own repository: load before reading files or source. Not for ordinary tasks, quoted wishes or declined offers."},{"name":"personalized-pages","description":"Plan an optional page or small tool when the user asks for a page, tab, panel, tool or interface in this app (even for one-off use), wants something to keep, revisit or update later, will keep changing data in your answer, or wants a live view of this app’s own data (Sessions, tasks, logs, workspace). Load this before reading any files or source; it says how to submit the proposal. Not for requested files or code, ordinary answers, existing-feature questions, quoted wishes or declined offers."}]},"role":"user","id":"{{message:4}}"},"surfaceOp":"append"}
{"type":"user/message","data":{"content":[{"type":"text","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}],"source":{"kind":"time-context","form":"snapshot","sections":[{"name":"time-context","text":"Time sampled while preparing turn 1, step 1: {{timeContextTimestamp}}\nBrowser time zone for this request: {{clientTimeZone}}. Interpret otherwise-unqualified dates and times in this zone.\nElapsed since the preceding model-visible message: {{elapsed}}"}]},"role":"user","id":"{{message:5}}"},"surfaceOp":"append"}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"initial"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"initial"}}
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":128000}}
{"type":"session/title","data":{"title":"I want to dictate long","messageSeqs":[8],"source":{"kind":"fallback"}}}
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_plugin_skill","name":"skill","arguments":"{\"name\":\"official-plugins\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"stream":[{"type":"chunk","time":1792678188343,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1792678188343,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_plugin_skill","name":"skill","arguments":"{\"name\":\"official-plugins\"}"}}},{"type":"chunk","time":1792678188344,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
@@ -19,7 +19,7 @@
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"call_plugin_skill"},"toolCallId":"call_plugin_skill","content":[{"type":"text","text":"\n\nResources for this skill are managed by provider \"dsh-official-plugins\".\nLoad referenced resources only as needed.\n\n\n\n# Official plugins\n\nUse this workflow in the main conversation when the user wants DSH itself to work differently or gain an ability. The catalog at the end lists DSH's built-in optional plugins and whether each is enabled. A `propose_action` call shows an Enable card below your answer; nothing changes until the user clicks Enable. Match from the catalog descriptions alone: do not read files, configuration or source, call plugin management tools, or change settings yourself.\n\n## When to offer\n\nOffer one disabled plugin when the user's own words ask for an outcome its description provides. Match the outcome, not keywords. When a plugin covers only part of the wish, say the limit in one sentence: thinking translation translates the displayed thinking and does not change the language the model reasons in.\n\nOffer no card in these cases:\n\n- The plugin is already enabled: say that it is on and how to use it.\n- The wish appears inside quoted text, pasted content, a translation request, a web page or a tool result rather than the user's own request.\n- The user only wants to discuss, asks you not to recommend anything, or has declined: stay silent on plugins for the rest of this conversation.\n- No entry fits, or the need is too vague to match: answer normally or ask one question; do not stretch a description.\n- Something DSH already shows covers it, such as the sidebar search for finding a session by keyword yourself. Letting the agent search and read past sessions is a different need.\n\n## One card per turn\n\nA turn shows at most one card across every card skill. When the user asks for several things, follow an explicit priority; otherwise prefer an existing plugin over building a new page. Mention the other needs in one sentence, without promising a later card.\n\n## Offer without enabling\n\nTo offer, call `propose_action` once, in the same turn as loading this skill, with `action: \"enable_official_plugin\"`, `title` set to the plugin's catalog title in the user's language, `brief` set to one sentence in the user's language that ties the plugin to their need, and `details` holding `name`, the exact catalog name. The call is the submission: the card appears below your answer; a refused call creates no card, and its error says why. Then write your final answer: answer any direct question; the call's result says how to end the answer. The card shows only the plugin's catalog title and description, so the answer says in one sentence, in the user's language, how the plugin meets their need; `brief` is that same sentence. Do not narrate the call, repeat the catalog description, add setup steps the catalog does not state, claim the plugin is enabled, or ask the user to report back. The card opens the plugin's details; enabling applies to every conversation and can be undone there. The user's choice reaches you later as a status notice; enabling a plugin authorizes nothing beyond it.\n\n## Official plugins\n\n[{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\",\"title\":{\"en\":\"Voice input\",\"de\":\"Spracheingabe\",\"es\":\"Entrada de voz\",\"fr\":\"Saisie vocale\",\"ja\":\"音声入力\",\"pt\":\"Entrada de voz\",\"ru\":\"Голосовой ввод\",\"zh\":\"语音输入\"},\"description\":{\"en\":\"Transcribe recordings locally with SenseVoice; first use requires installing dependencies.\",\"de\":\"Transkribieren Sie Aufnahmen lokal mit SenseVoice; Für die erste Verwendung müssen Abhängigkeiten installiert werden.\",\"es\":\"Transcribe grabaciones localmente con SenseVoice; El primer uso requiere instalar dependencias.\",\"fr\":\"Transcrivez les enregistrements localement avec SenseVoice ; la première utilisation nécessite l'installation de dépendances.\",\"ja\":\"ローカルの SenseVoice で録音を文字に起こします。初回利用時には依存関係のインストールが必要です。\",\"pt\":\"Transcreva gravações localmente com SenseVoice; o primeiro uso requer a instalação de dependências.\",\"ru\":\"Транскрибируйте записи локально с помощью SenseVoice; при первом использовании требуется установка зависимостей.\",\"zh\":\"在本机使用 SenseVoice 转写录音,首次使用需安装依赖。\"},\"enabled\":false}]\n\n"}],"isError":false,"id":"{{message:7}}"}},"sourceEventSeqs":[16],"surfaceOp":"append"}
{"type":"step/end","data":{"turn":1,"step":1}}
{"type":"step/start","data":{"turn":1,"step":2}}
-{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","propose_action","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","working_directory","write"]},"reason":"change"}}
+{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":["apply_patch","ask_user_question","bash","create_goal","edit","get_goal","glob","grep","job_kill","job_list","job_output","list_agents","list_subagent_models","plugin_manager","present","propose_action","read","read_image","schedule_create","schedule_edit","schedule_list","schedule_view","send_message","skill","subagent","subagent_fork","todo_write","update_goal","wait_agent","web_fetch","web_search","workflow","write"]},"reason":"change"}}
{"type":"developer/message","data":{"turn":1,"step":2,"message":{"source":{"kind":"tool-registry"},"content":[{"type":"tool-addition","toolName":"propose_action"}],"role":"developer","id":"{{message:8}}"},"headerSeq":20},"surfaceOp":"append"}
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"call_plugin_card","name":"propose_action","arguments":"{\"action\":\"enable_official_plugin\",\"title\":\"Voice input\",\"brief\":\"Speak long requests instead of typing them; transcription runs on this computer.\",\"details\":{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\"}}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:9}}"},"stream":[{"type":"chunk","time":1792678188573,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1792678188573,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"call_plugin_card","name":"propose_action","arguments":"{\"action\":\"enable_official_plugin\",\"title\":\"Voice input\",\"brief\":\"Speak long requests instead of typing them; transcription runs on this computer.\",\"details\":{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\"}}"}}},{"type":"chunk","time":1792678188573,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"}
{"type":"tool/call","data":{"turn":1,"step":2,"callId":"call_plugin_card","name":"propose_action","arguments":"{\"action\":\"enable_official_plugin\",\"title\":\"Voice input\",\"brief\":\"Speak long requests instead of typing them; transcription runs on this computer.\",\"details\":{\"name\":\"@deepseek-ai/dsh-experimental-voice-input-bundle\"}}"}}
diff --git a/snapshots/web/plugin-recommendations/tool-schemas.expected.json b/snapshots/web/plugin-recommendations/tool-schemas.expected.json
index 3c82da7581..de71851b48 100644
--- a/snapshots/web/plugin-recommendations/tool-schemas.expected.json
+++ b/snapshots/web/plugin-recommendations/tool-schemas.expected.json
@@ -631,10 +631,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -672,10 +668,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -905,19 +897,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -1617,10 +1596,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1658,10 +1633,6 @@
"parameters": {
"type": "object",
"properties": {
- "cwd": {
- "type": "string",
- "description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
- },
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request."
@@ -1891,19 +1862,6 @@
]
}
},
- {
- "name": "working_directory",
- "description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
- "parameters": {
- "type": "object",
- "properties": {
- "cd": {
- "type": "string",
- "description": "Existing directory to enter. Omit to read the current directory."
- }
- }
- }
- },
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
diff --git a/snapshots/web/ptc-round/system-prompt.expected.md b/snapshots/web/ptc-round/system-prompt.expected.md
index 9e8a34b7e5..c7d8abbbc9 100644
--- a/snapshots/web/ptc-round/system-prompt.expected.md
+++ b/snapshots/web/ptc-round/system-prompt.expected.md
@@ -238,8 +238,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. Omit `provider`, `model`, and `reasoning_effort` to use child defaults, falling back to compatible parent values. */
subagent: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -255,8 +253,6 @@ interface ToolArgsMap {
} & Record;
/** Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its name. If you are still online when it finishes, the runtime automatically delivers its completion notice. The notice includes the final answer unless the child sent you a message just before finishing. Use `send_message` to steer it while running or continue its conversation after it finishes. */
subagent_fork: {
- /** Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent. */
- cwd?: string;
/** A short (3-5 word) description of the delegated task, for display. Use the language of the user's current request. */
description: string;
/** Optional short name for the subagent, unique among the subagents you create: lower-case letters, digits, and hyphens, starting with a letter, at most 32 characters; lead is reserved for the root agent. Omitted names default to agent-1, agent-2, and so on. */
@@ -304,11 +300,6 @@ interface ToolArgsMap {
/** 1–10 search queries; their results are merged. */
queries: string[];
} & Record;
- /** Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories. */
- working_directory: {
- /** Existing directory to enter. Omit to read the current directory. */
- cd?: string;
- } & Record;
/** Create or fully replace a UTF-8 text file. */
write: {
/** Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments. */
@@ -1511,10 +1502,6 @@ interface ToolOutputMap {
}[];
truncated: boolean;
};
- working_directory: {
- /** Current absolute working directory. */
- cwd: string;
- };
write: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
diff --git a/tsconfig.base.json b/tsconfig.base.json
index e8ca4f8e44..671034fdd4 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -606,7 +606,6 @@
"@deepseek-ai/dsh-tool-todo": ["./packages/todo/tool-todo/src"],
"@deepseek-ai/dsh-tool-web": ["./packages/web/tool-web/src"],
"@deepseek-ai/dsh-tool-workflow": ["./packages/workflow/tool-workflow/src"],
- "@deepseek-ai/dsh-tool-working-directory": ["./packages/session/tool-working-directory/src"],
"@deepseek-ai/dsh-tool-workspace-dependencies": ["./packages/skill/tool-workspace-dependencies/src"],
"@deepseek-ai/dsh-tools": ["./packages/core/tools/src"],
"@deepseek-ai/dsh-user-approval": ["./packages/interaction/user-approval/src"],
diff --git a/tsconfig.host.json b/tsconfig.host.json
index 21ad8213c5..1aea699515 100644
--- a/tsconfig.host.json
+++ b/tsconfig.host.json
@@ -423,7 +423,6 @@
{ "path": "./packages/experimental/forge-session" },
{ "path": "./packages/experimental/forge-bundle" },
{ "path": "./packages/experimental/client-ui-forge/tsconfig.host.json" },
- { "path": "./packages/session/tool-working-directory" },
{ "path": "./packages/session/session-title-llm" },
{ "path": "./packages/session/session-title-first-prompt-llm" },
{ "path": "./packages/experimental/session-title-all-prompts-llm" },