Skip to content

Commit 54d2413

Browse files
saphidclaude
andcommitted
fix(web): scheduled task edits keep the policy-capped runtime mode
The settings dialog caps a task's runtime mode at the managed policy before saving, but the web patch builder never sent runtimeMode, so an edit to an existing task over the ceiling kept its old mode. The patch now carries runtimeMode when it differs from the opening draft, as on mobile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c699392 commit 54d2413

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/web/src/components/settings/scheduledTasks.logic.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe("buildScheduledTaskUpdateInput", () => {
181181
expect(buildPatch(baseline, live, baseline)).toBeNull();
182182
});
183183

184-
it("sends enabled, thread, workspace, model, and project moves when changed", () => {
184+
it("sends enabled, thread, workspace, model, runtime mode, and project moves when changed", () => {
185185
const bound: ScheduledTask = { ...task, threadId: "thread:1" as ScheduledTask["threadId"] };
186186
const baseline = taskToDraft(bound);
187187
const draft = {
@@ -190,6 +190,7 @@ describe("buildScheduledTaskUpdateInput", () => {
190190
threadId: "",
191191
workspaceMode: "root" as const,
192192
modelKey: "codex:gpt-5.2-codex",
193+
runtimeMode: "auto-accept-edits" as const,
193194
projectId: "project:two",
194195
};
195196
expect(
@@ -207,6 +208,7 @@ describe("buildScheduledTaskUpdateInput", () => {
207208
threadId: null,
208209
workspaceStrategy: { type: "root" },
209210
modelSelection: { instanceId: "codex", model: "gpt-5.2-codex" },
211+
runtimeMode: "auto-accept-edits",
210212
nextProjectId: "project:two",
211213
});
212214
});

‎apps/web/src/components/settings/scheduledTasks.logic.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export function buildScheduledTaskUpdateInput(
171171
// silently reverting that change.
172172
}
173173
if (draft.modelKey !== baseline.modelKey) patch.modelSelection = modelSelection;
174+
if (draft.runtimeMode !== baseline.runtimeMode) patch.runtimeMode = draft.runtimeMode;
174175
if (draft.projectId !== baseline.projectId) {
175176
patch.nextProjectId = draft.projectId as ProjectId;
176177
}

0 commit comments

Comments
 (0)