Skip to content

Commit ce7bfec

Browse files
committed
fix(onboard): clear stale session presets when env overrides on recreate
1 parent acfd1b2 commit ce7bfec

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

src/lib/onboard.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3690,15 +3690,21 @@ async function createSandbox(
36903690
current.policyPresets = previousPolicies;
36913691
return current;
36923692
});
3693-
} else if (
3694-
Array.isArray(previousPolicies) &&
3695-
previousPolicies.length > 0 &&
3696-
isNonInteractive() &&
3697-
(process.env.NEMOCLAW_POLICY_PRESETS || "").trim().length > 0
3698-
) {
3699-
note(
3700-
` [non-interactive] NEMOCLAW_POLICY_PRESETS overrides previous presets on recreate (was: ${previousPolicies.join(", ")}).`,
3701-
);
3693+
} else {
3694+
onboardSession.updateSession((current: Session) => {
3695+
current.policyPresets = null;
3696+
return current;
3697+
});
3698+
if (
3699+
Array.isArray(previousPolicies) &&
3700+
previousPolicies.length > 0 &&
3701+
isNonInteractive() &&
3702+
(process.env.NEMOCLAW_POLICY_PRESETS || "").trim().length > 0
3703+
) {
3704+
note(
3705+
` [non-interactive] NEMOCLAW_POLICY_PRESETS overrides previous presets on recreate (was: ${previousPolicies.join(", ")}).`,
3706+
);
3707+
}
37023708
}
37033709

37043710
note(` Deleting and recreating sandbox '${sandboxName}'...`);

0 commit comments

Comments
 (0)