mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 02:25:02 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user