Gateway: keep spawned workspace overrides internal (#43801)

* Gateway: keep spawned workspace overrides internal

* Changelog: note GHSA-2rqg agent boundary fix

* Gateway: persist spawned workspace inheritance in sessions

* Agents: clean failed lineage spawn state

* Tests: cover lineage attachment cleanup

* Tests: cover lineage thread cleanup
This commit is contained in:
Vincent Koc
2026-03-12 04:20:00 -04:00
committed by GitHub
parent 97683071b5
commit 46a332385d
12 changed files with 226 additions and 35 deletions

View File

@@ -128,6 +128,27 @@ export async function applySessionsPatchToStore(params: {
}
}
if ("spawnedWorkspaceDir" in patch) {
const raw = patch.spawnedWorkspaceDir;
if (raw === null) {
if (existing?.spawnedWorkspaceDir) {
return invalid("spawnedWorkspaceDir cannot be cleared once set");
}
} else if (raw !== undefined) {
if (!supportsSpawnLineage(storeKey)) {
return invalid("spawnedWorkspaceDir is only supported for subagent:* or acp:* sessions");
}
const trimmed = String(raw).trim();
if (!trimmed) {
return invalid("invalid spawnedWorkspaceDir: empty");
}
if (existing?.spawnedWorkspaceDir && existing.spawnedWorkspaceDir !== trimmed) {
return invalid("spawnedWorkspaceDir cannot be changed once set");
}
next.spawnedWorkspaceDir = trimmed;
}
}
if ("spawnDepth" in patch) {
const raw = patch.spawnDepth;
if (raw === null) {