refactor: simplify sandbox boundary open flow

This commit is contained in:
Agent
2026-03-01 21:49:42 +00:00
parent 3be1343e00
commit dcd19da425
3 changed files with 81 additions and 48 deletions

View File

@@ -23,7 +23,6 @@ type PathSafetyOptions = {
action: string;
aliasPolicy?: PathAliasPolicy;
requireWritable?: boolean;
allowMissingTarget?: boolean;
allowedType?: SafeOpenSyncAllowedType;
};
@@ -267,7 +266,7 @@ class SandboxFsBridgeImpl implements SandboxFsBridge {
allowedType: options.allowedType,
});
if (!guarded.ok) {
if (guarded.reason !== "path" || options.allowMissingTarget === false) {
if (guarded.reason !== "path") {
throw guarded.error instanceof Error
? guarded.error
: new Error(