Files
PaperClipAI/server/src/services/execution-workspace-policy.ts
T
Devin FoleyandPaperclip ea371b9684 fix: retain project defaults in partial workspace overrides (#14502)
## Thinking Path

> - Paperclip manages AI agents and their work.
> - Project workspace policies define how isolated worktrees are set up.
> - Tasks can override a branch without providing every setup field.
> - The resolver currently replaces the entire project strategy with
that partial override.
> - Losing an explicit setup command can run the repository fallback
script and block the task.
> - This pull request keeps enabled project defaults when the task uses
the same strategy type.

## Linked Issues or Issue Description

**What happened?**
A project uses `git_worktree` with `provisionCommand: "true"`. A task
overrides only `baseRef`. The resolver drops the command. Worktree
creation then invokes `scripts/provision-worktree.sh`, which can fail
because its required setup is absent.

**Expected behavior**
A branch override keeps the project's provision, runtime provision, and
teardown commands unless the task explicitly overrides them. A different
strategy type must not inherit those commands.

**Steps to reproduce**
Configure the project with an enabled `git_worktree` strategy and
`provisionCommand: "true"`. Give the task an isolated workspace with a
`git_worktree` strategy and a different `baseRef`. Add a failing
repository fallback provisioner. Before this change, worktree creation
invokes that script. After this change, it uses the project's explicit
command and succeeds.

Related: #4968 concerns agent strategy and working-directory fallback.
#13903 concerns gated API fields and reusable-workspace updates. #11091
concerns provision hooks on workspace reuse. None fixes partial task
overrides discarding project defaults.

## What Changed

- Merge a partial task strategy over the enabled project's strategy only
when their types match.
- Preserve explicit null values when parsing nullable strategy fields,
so they can clear project values.
- Keep explicit empty-string overrides and agent fallback behavior.
- Exclude disabled project strategies and avoid an inherited branch
template when a task pins an existing branch.
- Add policy regression coverage and a real Git worktree test with a
failing fallback script.
- Document inheritance, explicit clearing, and no-op provisioning in the
development guide.

## Verification

- Policy regression: eight failures before the fix; all 41 policy tests
pass after it.
- Real worktree regression: passes and creates a worktree using the
task's base branch without invoking the failing fallback provisioner.
- `pnpm -r typecheck`: passed.
- `pnpm build`: passed.
- `pnpm test:run`: general-server phase completed with 13,873 passed, 86
skipped, and 14 failures in unchanged macOS skills-cache and Git
long-path tests. The same failures reproduce on unmodified base code.
The command stops at that phase, so no full local pass is claimed.
- CI initially failed the existing Telegram subscription recovery test
on a 15-second timeout. The separate fix and investigation are in
#14501. A serialized job also lost its runner; GitHub reported lost
communication, and that job was rerun without source changes. All 52
final-commit checks pass, with two intentional skips. Greptile is 5/5,
with no unresolved comments or merge conflicts. The chat shard passed on
one unchanged rerun. The timeout cause remains unproven; #14501 adds
phase diagnostics for a recurrence.

## Risks

Tasks that specify a partial strategy now retain the project's omitted
fields, including setup and teardown hooks. This is the intended
behavior change. Inheritance requires an enabled project policy and
matching strategy types. Explicit task values still win. Null and empty
commands restore existing runtime defaults; they do not guarantee that
no script runs. Use `"true"` for an explicit no-op provision command. No
migration, live configuration change, or task replay is included.

## Model Used

OpenAI GPT-6 (Codex), with reasoning, terminal tools, and code
execution. The context window size is not exposed in this session.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes:` / `Closes`
/ `Refs` OR (b) described the issue in-PR following the relevant issue
template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub references)
- [x] My branch name describes the change and contains no internal
Paperclip ticket id or instance-derived details
- [x] I have run focused tests locally and they pass; full-suite status
is recorded above
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-28 18:09:20 -07:00

449 lines
20 KiB
TypeScript

import type {
ExecutionWorkspaceMode,
ExecutionWorkspaceStrategy,
IssueExecutionWorkspaceSettings,
ProjectExecutionWorkspaceDefaultMode,
ProjectExecutionWorkspacePolicy,
SharedWorkspaceConcurrency,
} from "@paperclipai/shared";
import { asString, parseObject } from "../adapters/utils.js";
export type ParsedExecutionWorkspaceMode = Exclude<ExecutionWorkspaceMode, "inherit" | "reuse_existing">;
export const WORKSPACE_WORKTREE_REQUIRES_PROJECT_CODE = "workspace_worktree_requires_project";
export const WORKSPACE_WORKTREE_REQUIRES_PROJECT_REMEDIATION =
"Attach a project to the task, or bind a reusable execution workspace, then retry.";
export const WORKSPACE_WORKTREE_REQUIRES_PROJECT_MESSAGE =
`This task is set to run in an isolated git worktree, but it has no project and no reusable execution workspace to create the worktree from. ${WORKSPACE_WORKTREE_REQUIRES_PROJECT_REMEDIATION}`;
type WorkspaceStrategyType = ExecutionWorkspaceStrategy["type"];
export type UnrunnableWorktreeIssueRef = {
projectId?: string | null;
projectWorkspaceId?: string | null;
executionWorkspaceId?: string | null;
executionWorkspacePreference?: string | null;
};
function cloneRecord(value: Record<string, unknown> | null | undefined): Record<string, unknown> | null {
if (!value) return null;
return { ...value };
}
function parseExecutionWorkspaceStrategy(raw: unknown): ExecutionWorkspaceStrategy | null {
const parsed = parseObject(raw);
const type = asString(parsed.type, "");
if (type !== "project_primary" && type !== "git_worktree" && type !== "adapter_managed" && type !== "cloud_sandbox") {
return null;
}
return {
type,
...(typeof parsed.baseRef === "string" || parsed.baseRef === null ? { baseRef: parsed.baseRef } : {}),
...(typeof parsed.branchTemplate === "string" || parsed.branchTemplate === null ? { branchTemplate: parsed.branchTemplate } : {}),
...(typeof parsed.existingBranch === "string" && parsed.existingBranch.trim().length > 0
? { existingBranch: parsed.existingBranch.trim() }
: {}),
...(typeof parsed.worktreeParentDir === "string" || parsed.worktreeParentDir === null ? { worktreeParentDir: parsed.worktreeParentDir } : {}),
...(typeof parsed.provisionCommand === "string" || parsed.provisionCommand === null ? { provisionCommand: parsed.provisionCommand } : {}),
...(typeof parsed.runtimeProvisionCommand === "string" || parsed.runtimeProvisionCommand === null
? { runtimeProvisionCommand: parsed.runtimeProvisionCommand }
: {}),
...(typeof parsed.teardownCommand === "string" || parsed.teardownCommand === null ? { teardownCommand: parsed.teardownCommand } : {}),
};
}
export function resolveEffectiveWorkspaceStrategyType(
mode: ParsedExecutionWorkspaceMode,
config: Record<string, unknown> | null | undefined,
): WorkspaceStrategyType {
const workspaceStrategy = parseObject(config?.workspaceStrategy);
const type = asString(workspaceStrategy.type, "");
if (type === "project_primary" || type === "git_worktree" || type === "adapter_managed" || type === "cloud_sandbox") {
return type;
}
// Default mirrors workspace-runtime.ts realizeExecutionWorkspace: missing type -> "project_primary".
// agent_default is a metadata-only mode that never creates a worktree, so it keeps "adapter_managed".
return mode === "agent_default" ? "adapter_managed" : "project_primary";
}
export function resolvePinnedIssueWorkspaceStrategyType(input: {
mode: ParsedExecutionWorkspaceMode;
issueSettings: IssueExecutionWorkspaceSettings | null;
}): WorkspaceStrategyType {
const strategyType = input.issueSettings?.workspaceStrategy?.type;
if (
strategyType === "project_primary" ||
strategyType === "git_worktree" ||
strategyType === "adapter_managed" ||
strategyType === "cloud_sandbox"
) {
return strategyType;
}
// When no explicit strategy type is set, mirror the runtime default (project_primary for most
// modes; adapter_managed for agent_default). Mode alone never implies git_worktree.
return input.mode === "agent_default" ? "adapter_managed" : "project_primary";
}
export function hasReusableExecutionWorkspaceBinding(issue: UnrunnableWorktreeIssueRef): boolean {
return Boolean(issue.executionWorkspaceId && issue.executionWorkspacePreference === "reuse_existing");
}
export function isUnrunnableWorktreeCombo(input: {
issue: UnrunnableWorktreeIssueRef;
resolvedMode: ParsedExecutionWorkspaceMode;
resolvedStrategy: string | null | undefined;
reusableExecutionWorkspaceAvailable?: boolean | null;
hasResolvablePriorSessionWorkspace?: boolean | null;
}): boolean {
if (input.resolvedMode !== "isolated_workspace" && input.resolvedMode !== "operator_branch") return false;
if (input.resolvedStrategy !== "git_worktree") return false;
if (input.issue.projectId || input.issue.projectWorkspaceId) return false;
const hasReusableWorkspace =
input.reusableExecutionWorkspaceAvailable ?? hasReusableExecutionWorkspaceBinding(input.issue);
if (hasReusableWorkspace) return false;
return input.hasResolvablePriorSessionWorkspace !== true;
}
export function parseProjectExecutionWorkspacePolicy(raw: unknown): ProjectExecutionWorkspacePolicy | null {
const parsed = parseObject(raw);
if (Object.keys(parsed).length === 0) return null;
const enabled = typeof parsed.enabled === "boolean" ? parsed.enabled : false;
const workspaceStrategy = parseExecutionWorkspaceStrategy(parsed.workspaceStrategy);
const defaultMode = asString(parsed.defaultMode, "");
const defaultProjectWorkspaceId =
typeof parsed.defaultProjectWorkspaceId === "string" ? parsed.defaultProjectWorkspaceId : undefined;
const allowIssueOverride =
typeof parsed.allowIssueOverride === "boolean" ? parsed.allowIssueOverride : undefined;
const sharedWorkspaceConcurrency = parseSharedWorkspaceConcurrency(parsed.sharedWorkspaceConcurrency);
const normalizedDefaultMode = (() => {
if (
defaultMode === "shared_workspace" ||
defaultMode === "isolated_workspace" ||
defaultMode === "operator_branch" ||
defaultMode === "adapter_default"
) {
return defaultMode as ProjectExecutionWorkspaceDefaultMode;
}
if (defaultMode === "project_primary") return "shared_workspace";
if (defaultMode === "isolated") return "isolated_workspace";
return undefined;
})();
return {
enabled,
...(sharedWorkspaceConcurrency ? { sharedWorkspaceConcurrency } : {}),
...(normalizedDefaultMode ? { defaultMode: normalizedDefaultMode } : {}),
...(allowIssueOverride !== undefined ? { allowIssueOverride } : {}),
...(defaultProjectWorkspaceId ? { defaultProjectWorkspaceId } : {}),
...(workspaceStrategy ? { workspaceStrategy } : {}),
...(parsed.workspaceRuntime && typeof parsed.workspaceRuntime === "object" && !Array.isArray(parsed.workspaceRuntime)
? { workspaceRuntime: { ...(parsed.workspaceRuntime as Record<string, unknown>) } }
: {}),
...(parsed.branchPolicy && typeof parsed.branchPolicy === "object" && !Array.isArray(parsed.branchPolicy)
? { branchPolicy: { ...(parsed.branchPolicy as Record<string, unknown>) } }
: {}),
...(parsed.pullRequestPolicy && typeof parsed.pullRequestPolicy === "object" && !Array.isArray(parsed.pullRequestPolicy)
? { pullRequestPolicy: { ...(parsed.pullRequestPolicy as Record<string, unknown>) } }
: {}),
...(parsed.runtimePolicy && typeof parsed.runtimePolicy === "object" && !Array.isArray(parsed.runtimePolicy)
? { runtimePolicy: { ...(parsed.runtimePolicy as Record<string, unknown>) } }
: {}),
...(parsed.cleanupPolicy && typeof parsed.cleanupPolicy === "object" && !Array.isArray(parsed.cleanupPolicy)
? { cleanupPolicy: { ...(parsed.cleanupPolicy as Record<string, unknown>) } }
: {}),
...(parsed.authorizationPolicy && typeof parsed.authorizationPolicy === "object" && !Array.isArray(parsed.authorizationPolicy)
? { authorizationPolicy: { ...(parsed.authorizationPolicy as Record<string, unknown>) } }
: {}),
};
}
export function gateProjectExecutionWorkspacePolicy(
projectPolicy: ProjectExecutionWorkspacePolicy | null,
isolatedWorkspacesEnabled: boolean,
): ProjectExecutionWorkspacePolicy | null {
if (!isolatedWorkspacesEnabled) return null;
return projectPolicy;
}
/**
* Operator default: a project with a configured workspace and no policy of its
* own runs its tasks in an isolated per-task worktree.
*
* This substitutes a policy rather than moving the terminal fallback in
* `resolveExecutionWorkspaceMode`, and the distinction is load-bearing:
*
* - A task with no project must keep its existing behavior. Isolation needs a
* repository to cut a worktree from, and `isUnrunnableWorktreeCombo` blocks
* an isolated + `git_worktree` task that has neither `projectId` nor
* `projectWorkspaceId`. Moving the terminal fallback would resolve isolated
* for project-less tasks (agent chat, for example) and strand them before
* dispatch. A project without a configured workspace also uses a plain
* managed directory, not a Git checkout. `hasProjectWorkspace` keeps both
* cases on their existing path; configured checkouts are still validated
* before a worktree is created.
* - `buildExecutionWorkspaceAdapterConfig` only supplies the default
* `git_worktree` strategy when some layer actually asserts workspace
* control. A moved fallback would leave `hasWorkspaceControl` false and
* produce isolated mode carrying a `project_primary` strategy — a
* combination no caller expects. Substituting a real policy makes
* `projectHasPolicy` true, so mode and strategy stay coherent.
*
* A stored project policy always wins, including one that is explicitly
* disabled: `parseProjectExecutionWorkspacePolicy` returns `enabled: false`
* for a blob that never opted in, and that is a tenant decision to stay on the
* shared checkout, not an absent one to fill in.
*/
export function applyDefaultIsolatedExecutionWorkspacePolicy(input: {
projectPolicy: ProjectExecutionWorkspacePolicy | null;
defaultIsolatedWorkspacesEnabled: boolean;
hasProjectWorkspace: boolean;
}): ProjectExecutionWorkspacePolicy | null {
if (!input.defaultIsolatedWorkspacesEnabled) return input.projectPolicy;
if (!input.hasProjectWorkspace) return input.projectPolicy;
if (input.projectPolicy) return input.projectPolicy;
return { enabled: true, defaultMode: "isolated_workspace" };
}
type ParseIssueExecutionWorkspaceSettingsOptions = {
includeEnvironmentId?: boolean;
};
export function parseIssueExecutionWorkspaceSettings(
raw: unknown,
options: ParseIssueExecutionWorkspaceSettingsOptions = {},
): IssueExecutionWorkspaceSettings | null {
const parsed = parseObject(raw);
if (Object.keys(parsed).length === 0) return null;
const workspaceStrategy = parseExecutionWorkspaceStrategy(parsed.workspaceStrategy);
const sharedWorkspaceConcurrency = parseSharedWorkspaceConcurrency(parsed.sharedWorkspaceConcurrency);
const mode = asString(parsed.mode, "");
const normalizedMode = (() => {
if (
mode === "inherit" ||
mode === "shared_workspace" ||
mode === "isolated_workspace" ||
mode === "operator_branch" ||
mode === "reuse_existing" ||
mode === "agent_default"
) {
return mode;
}
if (mode === "project_primary") return "shared_workspace";
if (mode === "isolated") return "isolated_workspace";
return "";
})();
const networkEgress = parseObject(parsed.networkEgress);
const allowFqdns = Array.isArray(networkEgress.allowFqdns)
? networkEgress.allowFqdns
.filter((value): value is string => typeof value === "string" && value.trim().length > 0)
.map((value) => value.trim().toLowerCase())
: [];
const allowCidrs = Array.isArray(networkEgress.allowCidrs)
? networkEgress.allowCidrs
.filter((value): value is string => typeof value === "string" && value.trim().length > 0)
.map((value) => value.trim())
: [];
return {
...(normalizedMode
? { mode: normalizedMode as IssueExecutionWorkspaceSettings["mode"] }
: {}),
...(sharedWorkspaceConcurrency ? { sharedWorkspaceConcurrency } : {}),
...(options.includeEnvironmentId && (typeof parsed.environmentId === "string" || parsed.environmentId === null)
? { environmentId: parsed.environmentId }
: {}),
...(workspaceStrategy ? { workspaceStrategy } : {}),
...(parsed.workspaceRuntime && typeof parsed.workspaceRuntime === "object" && !Array.isArray(parsed.workspaceRuntime)
? { workspaceRuntime: { ...(parsed.workspaceRuntime as Record<string, unknown>) } }
: {}),
...(allowFqdns.length > 0 || allowCidrs.length > 0
? { networkEgress: { allowFqdns, allowCidrs } }
: {}),
};
}
export function selectEnvironmentExecutionWorkspaceSettings(
parsedSettings: IssueExecutionWorkspaceSettings | null,
isolatedWorkspacesEnabled: boolean,
): IssueExecutionWorkspaceSettings | null {
if (!parsedSettings) return null;
if (isolatedWorkspacesEnabled) return parsedSettings;
return parsedSettings.networkEgress
? { networkEgress: parsedSettings.networkEgress }
: null;
}
export type ExecutionWorkspaceEnvironmentSource =
| "agent"
| "instance"
| "default"
| "managed";
export type ExecutionWorkspaceEnvironmentResolution = {
environmentId: string;
source: ExecutionWorkspaceEnvironmentSource;
};
export class ManagedSandboxUnavailableError extends Error {
constructor() {
super(
"This instance runs agents only in its platform-managed sandbox environment " +
"(managed sandbox only), but no active managed sandbox environment exists — " +
"its provider plugin may be unavailable. Refusing to fall back to local execution.",
);
this.name = "ManagedSandboxUnavailableError";
}
}
export function resolveExecutionWorkspaceEnvironmentId(input: {
agentDefaultEnvironmentId: string | null;
instanceDefaultEnvironmentId: string | null;
localDefaultEnvironmentId: string;
/**
* Managed-sandbox-only policy (`enableManagedSandboxOnly`): any selection
* that lands on the local environment is redirected to the managed
* sandbox environment instead, and with no managed environment available
* the resolution fails closed — never local. Non-local selections (ssh,
* user-created sandboxes) are untouched: the policy hides local, it does
* not forbid other environments.
*/
managedSandboxOnly?: boolean;
managedSandboxEnvironmentId?: string | null;
}): ExecutionWorkspaceEnvironmentResolution {
const resolved = ((): ExecutionWorkspaceEnvironmentResolution => {
if (input.agentDefaultEnvironmentId) {
return {
environmentId: input.agentDefaultEnvironmentId,
source: "agent",
};
}
if (input.instanceDefaultEnvironmentId) {
return {
environmentId: input.instanceDefaultEnvironmentId,
source: "instance",
};
}
return {
environmentId: input.localDefaultEnvironmentId,
source: "default",
};
})();
if (input.managedSandboxOnly !== true || resolved.environmentId !== input.localDefaultEnvironmentId) {
return resolved;
}
if (!input.managedSandboxEnvironmentId) {
throw new ManagedSandboxUnavailableError();
}
return { environmentId: input.managedSandboxEnvironmentId, source: "managed" };
}
export function defaultIssueExecutionWorkspaceSettingsForProject(
projectPolicy: ProjectExecutionWorkspacePolicy | null,
): IssueExecutionWorkspaceSettings | null {
if (!projectPolicy?.enabled) return null;
return {
mode:
projectPolicy.defaultMode === "isolated_workspace"
? "isolated_workspace"
: projectPolicy.defaultMode === "operator_branch"
? "operator_branch"
: projectPolicy.defaultMode === "adapter_default"
? "agent_default"
: "shared_workspace",
};
}
export function issueExecutionWorkspaceModeForPersistedWorkspace(
mode: string | null | undefined,
): IssueExecutionWorkspaceSettings["mode"] {
if (mode === null || mode === undefined) {
return "agent_default";
}
if (mode === "isolated_workspace" || mode === "operator_branch" || mode === "shared_workspace") {
return mode;
}
if (mode === "adapter_managed" || mode === "cloud_sandbox") {
return "agent_default";
}
return "shared_workspace";
}
export function resolveExecutionWorkspaceMode(input: {
projectPolicy: ProjectExecutionWorkspacePolicy | null;
issueSettings: IssueExecutionWorkspaceSettings | null;
legacyUseProjectWorkspace: boolean | null;
}): ParsedExecutionWorkspaceMode {
const issueMode = input.issueSettings?.mode;
if (issueMode && issueMode !== "inherit" && issueMode !== "reuse_existing") {
return issueMode;
}
if (input.projectPolicy?.enabled) {
if (input.projectPolicy.defaultMode === "isolated_workspace") return "isolated_workspace";
if (input.projectPolicy.defaultMode === "operator_branch") return "operator_branch";
if (input.projectPolicy.defaultMode === "adapter_default") return "agent_default";
return "shared_workspace";
}
if (input.legacyUseProjectWorkspace === false) {
return "agent_default";
}
return "shared_workspace";
}
function parseSharedWorkspaceConcurrency(raw: unknown): SharedWorkspaceConcurrency | undefined {
return raw === "auto" || raw === "serialize" || raw === "allow" ? raw : undefined;
}
export function resolveSharedWorkspaceConcurrency(input: {
projectPolicy: ProjectExecutionWorkspacePolicy | null;
issueSettings: IssueExecutionWorkspaceSettings | null;
}): SharedWorkspaceConcurrency {
return input.issueSettings?.sharedWorkspaceConcurrency
?? (input.projectPolicy?.enabled ? input.projectPolicy.sharedWorkspaceConcurrency : undefined)
?? "auto";
}
export function buildExecutionWorkspaceAdapterConfig(input: {
agentConfig: Record<string, unknown>;
projectPolicy: ProjectExecutionWorkspacePolicy | null;
issueSettings: IssueExecutionWorkspaceSettings | null;
mode: ParsedExecutionWorkspaceMode;
legacyUseProjectWorkspace: boolean | null;
}): Record<string, unknown> {
const nextConfig = { ...input.agentConfig };
const projectHasPolicy = Boolean(input.projectPolicy?.enabled);
const issueHasWorkspaceOverrides = Boolean(
input.issueSettings?.mode ||
input.issueSettings?.workspaceStrategy ||
input.issueSettings?.workspaceRuntime,
);
const hasWorkspaceControl = projectHasPolicy || issueHasWorkspaceOverrides || input.legacyUseProjectWorkspace === false;
if (hasWorkspaceControl) {
if (input.mode === "isolated_workspace") {
const projectStrategy = projectHasPolicy ? input.projectPolicy?.workspaceStrategy : undefined;
const issueStrategy = input.issueSettings?.workspaceStrategy;
// An issue that changes its branch still needs the project's setup hooks.
// Do not carry those defaults into a different execution strategy.
const strategy = issueStrategy && projectStrategy?.type === issueStrategy.type
? { ...projectStrategy, ...issueStrategy }
: issueStrategy ?? projectStrategy ??
parseExecutionWorkspaceStrategy(nextConfig.workspaceStrategy) ??
({ type: "git_worktree" } satisfies ExecutionWorkspaceStrategy);
if (issueStrategy?.existingBranch && issueStrategy.branchTemplate === undefined && strategy !== issueStrategy) {
delete strategy.branchTemplate;
}
nextConfig.workspaceStrategy = strategy as unknown as Record<string, unknown>;
} else {
delete nextConfig.workspaceStrategy;
}
if (input.mode === "agent_default") {
delete nextConfig.workspaceRuntime;
} else if (input.issueSettings?.workspaceRuntime) {
nextConfig.workspaceRuntime = cloneRecord(input.issueSettings.workspaceRuntime) ?? undefined;
} else if (input.projectPolicy?.workspaceRuntime) {
nextConfig.workspaceRuntime = cloneRecord(input.projectPolicy.workspaceRuntime) ?? undefined;
}
}
return nextConfig;
}