Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,10 @@ function TaskForm({
{promptField}
</SettingsSection>

<SettingsSection title="Context">
<SettingsSection
title="Context"
footer={draft.threadId !== null ? "Runs use this thread's current model." : undefined}
Comment thread
Mezzle marked this conversation as resolved.
Resolved
>
<SelectRow
label="Project"
value={
Expand Down Expand Up @@ -904,7 +907,9 @@ function TaskForm({
(modelOptions.length ? "Choose model" : "No models available")
}
onPress={() => navigation.navigate("SettingsScheduledTaskModel")}
disabled={saving || dictationPending || environmentUnavailable}
disabled={
saving || dictationPending || environmentUnavailable || draft.threadId !== null
}
/>
</SettingsSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,20 @@ describe("ScheduledTasksSettings", () => {
await expect.element(dialog.getByRole("heading", { name: "New task" })).toBeInTheDocument();
await expect.element(name).toHaveValue("My draft");
});

it("locks the model while the task is bound to a thread", async () => {
setup();
await using _screen = await render(<ScheduledTasksSettings taskId={task.id} />);
const dialog = page.getByRole("dialog");
const model = dialog.getByRole("button", { name: "Choose model" });
const note = dialog.getByText("Runs use this thread's current model.");
await expect.element(model).toBeDisabled();
await expect.element(note).toBeVisible();

await userEvent.click(dialog.getByRole("combobox", { name: "Destination" }));
await userEvent.click(page.getByRole("option", { name: "New thread each run" }));

await expect.element(model).toBeEnabled();
await expect.element(note).not.toBeInTheDocument();
});
});
5 changes: 4 additions & 1 deletion apps/web/src/components/settings/ScheduledTasksSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ function ScheduledTaskEditorForm({
<div>
<ProviderModelPicker
environmentId={environmentId}
disabled={saving || !connected}
disabled={saving || !connected || draft.threadId !== ""}
Comment thread
Mezzle marked this conversation as resolved.
Resolved
activeInstanceId={activeInstanceId}
model={activeModel}
lockedProvider={null}
Expand All @@ -1799,6 +1799,9 @@ function ScheduledTaskEditorForm({
}
/>
</div>
{draft.threadId !== "" ? (
<p className="text-sm text-muted-foreground">Runs use this thread's current model.</p>
) : null}
Comment thread
Mezzle marked this conversation as resolved.
Resolved
</Field>

<div className="space-y-3">
Expand Down
Loading