Appearance
Workspace / Sandbox
Grok Bot 的 execution environment 分散在 host/box/、host/local-exec/、runner/tools/、Turn wiring 和 durable state 中。这里不能拿单个 Docker/box 文件代表完整 security boundary。
Runtime 相关映射
| 文件 | Symbol / surface | 观察点 |
|---|---|---|
turn-run-shell.ts | createTurnAgentRunContext() | shell-watch / scope / resource owner 如何进入 Turn |
turn-observation.ts | listAsyncTasks() | background shell/subagent/cloud-agent 如何统一观察 |
turn-observation.ts | shellRewatchEntries() use site | host restart 后 reattached shell 如何回到观察面 |
durable-file-policy.ts | durable filenames | host recovery state 为什么不应混成 workspace snapshot |
runner/tools/ | concrete capabilities | shell/browser/communication 等“手”如何被独立实现 |
Reattach 的意义
text
host restart
↓
external/background shell 仍可能存在
↓
shell rewatch state
↓
listAsyncTasks()
↓
Runtime 再次看到 running task这说明 Session State、Workspace State、Process State 不是同一个东西。恢复时需要 reconciliation,而不是只 load 一个 JSON checkpoint 就认为环境完全回来了。
本地定位
bash
rg -n "createTurnAgentRunContext|shellWatchHost|shellRewatchEntries|listAsyncTasks" source/host/runner/turn-run-shell.ts source/host/runner/turn-observation.ts
find source/host/runner/tools -maxdepth 1 -type f | sort
find source/host/box source/host/local-exec -maxdepth 2 -type f | sort | head -80