You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,7 @@ A workspace is the directory where an execution runs.
200
200
-`shared`: run directly in one real directory
201
201
-`isolated`: create a fresh temporary workspace per case x runner execution
202
202
203
-
Use `shared` when you want the agent to work against your real project checkout. Use `isolated` when you want clean filesystem state per execution or need to prepare each execution from a template.
203
+
Use `shared` when you want the agent to work against your real project checkout. Shared mode can still seed that directory with `templateDir` and `bootstrap` before the agent starts. Use `isolated` when you want clean filesystem state per execution or need a fresh prepared workspace every time.
204
204
205
205
You can configure workspaces in `skillgym.config.*` with `run.workspace`, or per suite with a named `workspace` export. Suite-level workspace config overrides config-level `run.workspace`.
Copy file name to clipboardExpand all lines: docs/workspaces.md
+42-14Lines changed: 42 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,13 @@
2
2
3
3
## Overview
4
4
5
-
`skillgym` supports two workspace modes:
5
+
`skillgym` supports three workspace modes:
6
6
7
-
-`shared`: run directly in a real working directory
7
+
-`none`: run directly in an existing working directory
8
+
-`shared`: create one workspace per suite run and reuse it across executions
8
9
-`isolated`: create a fresh workspace per case x runner execution
9
10
10
-
Use isolated workspaces when suites need different filesystem setups or when executions should not mutate the original source tree.
11
+
Use `none`when the agent should run in an existing directory. Use `shared`or `isolated`when the suite needs SkillGym to provision a workspace first.
11
12
12
13
## Suite-level workspace config
13
14
@@ -44,22 +45,43 @@ Suite workspace config overrides config-level `run.workspace`.
44
45
45
46
See `../examples/workspace-isolation-suite.ts` for a complete example that copies a template directory and runs a bootstrap command before the agent starts.
46
47
47
-
## Shared mode
48
+
## None mode
48
49
49
50
```ts
50
51
exportconst workspace = {
51
-
mode: "shared",
52
+
mode: "none",
52
53
cwd: "./fixtures/repo-a",
53
54
};
54
55
```
55
56
56
57
Behavior:
57
58
58
-
- executions run directly in the shared directory
59
+
- executions run directly in `cwd`
59
60
-`cwd` is optional
60
-
- if omitted, shared mode falls back to config `run.cwd`, then `process.cwd()`
61
+
- if omitted, none mode falls back to config `run.cwd`, then `process.cwd()`
61
62
-`templateDir` and `bootstrap` are not allowed
62
63
64
+
If a suite file does not export `workspace`, SkillGym falls back to config `run.workspace`, then to implicit `none` mode.
65
+
66
+
## Shared mode
67
+
68
+
```ts
69
+
exportconst workspace = {
70
+
mode: "shared",
71
+
templateDir: "./fixtures/repo-template",
72
+
};
73
+
```
74
+
75
+
Behavior:
76
+
77
+
- one shared workspace is created under `outputDir/workspaces/shared`
78
+
- all executions reuse that same workspace for the suite run
79
+
-`cwd` is not allowed
80
+
-`templateDir` copies into the shared workspace before any execution starts
81
+
-`bootstrap` runs once inside the shared workspace before any execution starts
82
+
- successful suite runs delete the shared workspace
83
+
- failed suite runs preserve the shared workspace
84
+
63
85
## Isolated mode
64
86
65
87
```ts
@@ -79,11 +101,11 @@ Behavior:
79
101
80
102
## Bootstrap commands
81
103
82
-
Bootstrap commands run inside the isolated workspace before the agent starts.
104
+
Bootstrap commands run inside the execution workspace before the agent starts.
-`cwd` is the provisioned shared workspace or isolated workspace
97
119
- non-zero exit fails that execution before the agent runs
98
-
- stdout and stderr are written to the execution artifact directory
120
+
- shared-workspace bootstrap stdout and stderr are written to `outputDir/workspaces/shared-setup`
121
+
- isolated-workspace bootstrap stdout and stderr are written to the execution artifact directory
99
122
100
123
Runtime environment variables:
101
124
102
125
-`SKILLGYM_WORKSPACE`
103
-
-`SKILLGYM_CASE_ID`
104
-
-`SKILLGYM_RUNNER_ID`
105
126
-`SKILLGYM_OUTPUT_DIR`
106
127
-`SKILLGYM_ARTIFACT_DIR`
107
128
129
+
Isolated workspace bootstrap also receives:
130
+
131
+
-`SKILLGYM_CASE_ID`
132
+
-`SKILLGYM_RUNNER_ID`
133
+
108
134
## Cleanup
109
135
110
136
Cleanup behavior is fixed:
111
137
138
+
- successful shared suite runs delete their workspace
139
+
- failed shared suite runs preserve their workspace
112
140
- successful isolated executions delete their workspace
113
141
- failed isolated executions preserve their workspace
114
142
@@ -120,7 +148,7 @@ Path rules:
120
148
121
149
- config `run.workspace` paths resolve from the config file directory
122
150
- suite `workspace` paths resolve from the suite file directory
123
-
-`bootstrap.command` and path-like `bootstrap.args` are resolved from the config or suite directory before the bootstrap runs inside the isolated workspace
151
+
-`bootstrap.command` and path-like `bootstrap.args` are resolved from the config or suite directory before the bootstrap runs inside the execution workspace
0 commit comments