Keep every bot's computer work in its own workspace folder
Computers now mount only /home/gem/workspace from DATA_DIR/computers/<id>, so only the workspace persists and goes into the data archive. An older computer's whole home is moved aside to <id>-home-<ts> (kept, never archived) and its container recreated once by sync-computers. Each run works in bots/<bot>/users/<user> (also its cwd and HOME), with bots/<bot> for work every user shares and workspaces/<id> shared by a workspace's bots; the coordinator reaches the whole workspace. Computer tools are gated by withComputerDirs: bash and code start there, file tool paths and file: URLs outside the run's folders are refused, and so is sudo. search_computers, import_file and script tools start there too. The files browser shows members only the bots' folders they reach, their own user folder in each and their workspaces', with names on the id folders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+31
-3
@@ -96,12 +96,34 @@ export const AppData = {
|
||||
ComputerImage: "ghcr.io/agent-infra/sandbox:latest",
|
||||
ComputerContainerPrefix: `${SiteData["SiteSlug"]}-computer`,
|
||||
/**
|
||||
* A computer's home directory (`ComputerHomeDir` in its container) is
|
||||
* kept at `DATA_DIR/<ComputerDataDir>/<id>`, owned by the sandbox's
|
||||
* user. It stays when the computer is deleted.
|
||||
* Only a computer's workspace (`ComputerWorkspaceDir` in its
|
||||
* container) is kept, at `DATA_DIR/<ComputerDataDir>/<id>`, owned by
|
||||
* the sandbox's user. It stays when the computer is deleted. The rest
|
||||
* of its home (`ComputerHomeDir`: dotfiles, browser profile, the env
|
||||
* files) lives in the container and goes with it. Every bot works in
|
||||
* `bots/<bot id>` there, a user's work in `bots/<bot id>/users/<user
|
||||
* id>`, and a workspace's bots share `workspaces/<workspace id>`
|
||||
* (`computerRunDirs`).
|
||||
*/
|
||||
ComputerDataDir: "computers",
|
||||
ComputerHomeDir: "/home/gem",
|
||||
ComputerWorkspaceDir: "/home/gem/workspace",
|
||||
/**
|
||||
* Written at the root of a computer's workspace once it uses that
|
||||
* layout, so an older computer's whole home is told apart and moved
|
||||
* aside (`prepareComputerDataDir`).
|
||||
*/
|
||||
ComputerWorkspaceMarker: ".cobble-workspace",
|
||||
/**
|
||||
* An older computer's whole home is moved aside to
|
||||
* `<id><ComputerOldHomeSuffix><timestamp>` and kept, never archived.
|
||||
*/
|
||||
ComputerOldHomeSuffix: "-home-",
|
||||
/**
|
||||
* Recorded in a container's `metadata.layout` once it mounts only the
|
||||
* workspace.
|
||||
*/
|
||||
ComputerWorkspaceLayout: "workspace",
|
||||
ComputerUserUid: 1000,
|
||||
ComputerUserGid: 1000,
|
||||
/**
|
||||
@@ -488,6 +510,12 @@ export const AppData = {
|
||||
* Most folders deep a path may go, so nothing buries a file.
|
||||
*/
|
||||
BotFilePathMaxDepth: 8,
|
||||
/**
|
||||
* Most folders deep the files browser opens: a computer's workspace
|
||||
* starts four down (`bots/<bot>/users/<user>`) before a bot's own
|
||||
* folders begin.
|
||||
*/
|
||||
StorageBrowserMaxDepth: 16,
|
||||
/**
|
||||
* The files modal and the bot's file list: one page of them.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user