| layout | default |
|---|---|
| title | Chapter 2: Worktree Isolation and Workspace Model |
| nav_order | 2 |
| parent | Superset Terminal Tutorial |
Welcome to Chapter 2: Worktree Isolation and Workspace Model. In this part of Superset Terminal Tutorial: Command Center for Parallel Coding Agents, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.
Superset isolates each active task in its own git worktree and workspace context.
- avoids branch conflicts between parallel tasks
- preserves clean context per agent run
- enables fast switch/cleanup between active workspaces
You now understand how Superset prevents multi-agent interference through workspace isolation.
Next: Chapter 3: Workspace Orchestration Lifecycle
The copyModuleSubtree function in apps/desktop/runtime-dependencies.ts handles a key part of this chapter's functionality:
}
function copyModuleSubtree(
moduleName: string,
filter: string[],
): PackagedNodeModuleCopy {
return {
from: `node_modules/${moduleName}`,
to: `node_modules/${moduleName}`,
filter,
};
}
const externalizedRuntimeModules: ExternalizedRuntimeModule[] = [
{
specifier: "better-sqlite3",
materialize: ["better-sqlite3"],
packagedCopies: [copyWholeModule("better-sqlite3")],
asarUnpackGlobs: ["**/node_modules/better-sqlite3/**/*"],
},
{
specifier: "node-pty",
materialize: ["node-pty"],
packagedCopies: [copyWholeModule("node-pty")],
asarUnpackGlobs: ["**/node_modules/node-pty/**/*"],
},
{
specifier: "@superset/macos-process-metrics",
materialize: ["@superset/macos-process-metrics"],
packagedCopies: [copyWholeModule("@superset/macos-process-metrics")],
asarUnpackGlobs: ["**/node_modules/@superset/macos-process-metrics/**/*"],
},This function is important because it defines how Superset Terminal Tutorial: Command Center for Parallel Coding Agents implements the patterns covered in this chapter.
flowchart TD
A[copyModuleSubtree]