Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ temp/
docs/superpowers/
docs/plans/
docs/specs/
.superpowers/

# Skill-optimizer generated artifacts
.skill-optimizer/
Expand Down
16 changes: 14 additions & 2 deletions src/workbench/docker-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { chmodSync, cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -212,6 +212,8 @@ async function copyAgentResults(containerName: string, resultsDir: string, repoR
copy.stderr.trim(),
].filter(Boolean).join('\n\n'));
}

await runShellCommand(`chmod -R a+rw ${shellQuote(resultsDir)}`, { cwd: repoRoot });
}
Comment on lines +215 to 217
Comment on lines +215 to 217

async function removeContainer(containerName: string, repoRoot: string): Promise<void> {
Expand Down Expand Up @@ -408,6 +410,8 @@ export function prepareDockerWorkbenchRun(
mkdirSync(referencesDir, { recursive: true });
mkdirSync(workDir, { recursive: true });
mkdirSync(resultsDir, { recursive: true });
chmodSync(workDir, 0o777);
chmodSync(resultsDir, 0o777);
Comment on lines 412 to +414

copyDirectoryContents(resolvedCase.referencesDir, referencesDir);
copyCaseSupportDirs(resolvedCase.configDir, caseDir);
Expand All @@ -434,7 +438,15 @@ export function prepareDockerWorkbenchRun(
resultPath: join(resultsDir, 'result.json'),
tracePath: join(resultsDir, 'trace.jsonl'),
...(mcpConfigPath ? { mcpConfigPath } : {}),
cleanup: () => rmSync(tempDir, { recursive: true, force: true }),
cleanup: () => {
try {
rmSync(tempDir, { recursive: true, force: true });
} catch (error) {
// The container (uid 10001) may write subdirs (.cache, .venv) that the host user
// cannot delete. Don't let cleanup failures kill the run; tmpfiles.d will sweep /tmp later.
console.warn(`workbench: could not remove ${tempDir}: ${error instanceof Error ? error.message : String(error)}`);
}
},
};
}

Expand Down
Loading