fix(patch): mask absent cache paths during Linux model startup

This commit is contained in:
Michael D'Angelo
2026-11-19 18:11:31 -08:00
parent 2e8fd512e6
commit e1b66e35fc
2 changed files with 13 additions and 18 deletions
+10 -17
View File
@@ -18968,29 +18968,22 @@ export async function readSkillCommandOutput(
modelReadOnlyPaths.add(path);
}
}
const filesystem: JsonObject = { ...profile.filesystem };
for (const path of modelReadOnlyPaths) {
// Binding a missing cache read-only can race another Linux
// sandbox removing its temporary mount source.
const mask = process.platform === "linux" && !existsSync(path);
filesystem[path] = { ".": mask ? "deny" : "read" };
}
// Snapshot Git still needs the operator configuration. The model
// must not read those files through its inherited workspace policy.
for (const path of appServer.permissions.externalConfigPaths ?? [])
filesystem[path] = { ".": "deny" };
startThread({
...workspaceOverride,
default_permissions: permissionProfile!,
permissions: {
[permissionProfile!]: {
...profile,
filesystem: {
...profile.filesystem,
...Object.fromEntries(
[...modelReadOnlyPaths].map((path) => [
path,
{ ".": "read" },
]),
),
...Object.fromEntries(
(appServer.permissions.externalConfigPaths ?? []).map(
(path) => [path, { ".": "deny" }],
),
),
},
},
[permissionProfile!]: { ...profile, filesystem },
},
});
continue;
@@ -427,6 +427,8 @@ glob_scan_max_depth = 8
...profiles[name],
filesystem: snapshotFilesystem,
});
const cacheAccess =
process.platform === "linux" && !existingStorage ? "deny" : "read";
expect(profiles[name]!["filesystem"]).toEqual({
...snapshotFilesystem,
...Object.fromEntries(
@@ -437,7 +439,7 @@ glob_scan_max_depth = 8
(configured && dirname(path) === extra),
),
...(configured ? (permissions.externalCachePaths ?? []) : []),
].map((path) => [path, { ".": "read" }]),
].map((path) => [path, { ".": cacheAccess }]),
),
...Object.fromEntries(
(permissions.externalConfigPaths ?? []).map((path) => [