Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: scheduled tasks can run in one thread with a fresh session each run #30326

Mergedjuliusmarmingemerged 10 commits intot3/fresh-session-clear fromrefs/pull/30326/headmerged by juliusmarminge View on GitHub

Showing 19 changed files with 47 additions and 1 deletion (loading 16).

x
0 of 19 viewed, 19 left
40 additions and 0 deletionsapps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsxModified
View file
@@ -11,6 +11,7 @@
EnvironmentId,
ProjectId,
ScheduledTask,
+ ScheduledTaskThreadMode,
ScheduledTaskUpsertInput,
} from "@t3tools/contracts";
import {
@@ -109,6 +110,12 @@
{ index: 0, label: "Sun" },
] as const;
​
+const THREAD_MODE_LABELS: Record<ScheduledTaskThreadMode, string> = {
+ new_thread: "New thread each run",
+ continue: "One thread, same conversation",
+ fresh_session: "One thread, fresh session",
+};
+​
function describeSchedule(task: ScheduledTask): string {
if (task.schedule.type === "webhook") return "On webhook";
if (task.schedule.type === "once") {
@@ -722,6 +729,7 @@
const offersOnce =
config?.environment.capabilities.oneTimeSchedules === true ||
draft.task?.schedule.type === "once";
+ const offersThreadModes = config?.environment.capabilities.scheduledTaskThreadModes === true;
const save = async () => {
if (