add support for -w,--writable-root to add more writable roots for sandbox (#263)

This adds support for a new flag, `-w,--writable-root`, that can be
specified multiple times to _amend_ the list of folders that should be
configured as "writable roots" by the sandbox used in `full-auto` mode.
Values that are passed as relative paths will be resolved to absolute
paths.

Incidentally, this required updating a number of the `agent*.test.ts`
files: it feels like some of the setup logic across those tests could be
consolidated.

In my testing, it seems that this might be slightly out of distribution
for the model, as I had to explicitly tell it to run `apply_patch` and
that it had the permissions to write those files (initially, it just
showed me a diff and told me to apply it myself). Nevertheless, I think
this is a good starting point.
This commit is contained in:
Michael Bolin
2025-04-17 15:39:26 -07:00
committed by GitHub
parent d5eed65963
commit ae5b1b5cb5
22 changed files with 103 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ type Props = {
imagePaths?: Array<string>;
rollout?: AppRollout;
approvalPolicy: ApprovalPolicy;
additionalWritableRoots: ReadonlyArray<string>;
fullStdout: boolean;
};
@@ -31,6 +32,7 @@ export default function App({
rollout,
imagePaths,
approvalPolicy,
additionalWritableRoots,
fullStdout,
}: Props): JSX.Element {
const app = useApp();
@@ -97,6 +99,7 @@ export default function App({
prompt={prompt}
imagePaths={imagePaths}
approvalPolicy={approvalPolicy}
additionalWritableRoots={additionalWritableRoots}
fullStdout={fullStdout}
/>
);