fix(server): preserve runtime and provisioning settings in pre-realization workspace intent

Carry environmentId, workspaceRuntime, provisionCommand, and teardownCommand
from the parent's workspace settings when building the pre-realization intent
for accepted-plan children, so children run in the same environment as the
parent configured rather than falling back to project or default runtime.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Nicky LeachandPaperclip committed 2026-07-08 16:38:16 +00:00
1 parent 4ef3419db2
commit b63a24636e
1 file changed
+4
+4
View File
@@ -249,12 +249,16 @@ function buildPreRealizationExecutionWorkspaceSettings(raw: unknown): Record<str
: null;
const next: Record<string, unknown> = {};
if (mode) next.mode = mode;
if (settings.environmentId) next.environmentId = settings.environmentId;
if (settings.workspaceRuntime) next.workspaceRuntime = settings.workspaceRuntime;
if (settings.workspaceStrategy) {
next.workspaceStrategy = {
type: settings.workspaceStrategy.type,
...(settings.workspaceStrategy.baseRef ? { baseRef: settings.workspaceStrategy.baseRef } : {}),
...(settings.workspaceStrategy.branchTemplate ? { branchTemplate: settings.workspaceStrategy.branchTemplate } : {}),
...(settings.workspaceStrategy.worktreeParentDir ? { worktreeParentDir: settings.workspaceStrategy.worktreeParentDir } : {}),
...(settings.workspaceStrategy.provisionCommand ? { provisionCommand: settings.workspaceStrategy.provisionCommand } : {}),
...(settings.workspaceStrategy.teardownCommand ? { teardownCommand: settings.workspaceStrategy.teardownCommand } : {}),
};
}
return Object.keys(next).length > 0 ? next : null;