Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d6134f8
feat(scheduled-tasks): bound tasks can steer, steer-or-start, or rest…
3xcalibur-tech Nov 4, 2026
e0c18c0
fix(scheduled-tasks): delivery mode survives stale editors, old serve…
3xcalibur-tech Nov 4, 2026
ece525c
test(server): the steer retry test asserts its replayed delivery
3xcalibur-tech Nov 4, 2026
9a79300
Merge upstream main into feat/scheduled-task-delivery-mode
3xcalibur-tech Nov 5, 2026
d856602
fix(scheduled-tasks): Steer only and Restart copy matches composer st…
3xcalibur-tech Nov 5, 2026
49f7926
fix(scheduled-tasks): Steer only and Restart copy notes the first run…
3xcalibur-tech Nov 5, 2026
c4ef722
Merge remote-tracking branch 'github/main' into feat/scheduled-task-d…
maria-rcks Nov 5, 2026
14c4185
Merge branch 'main' of https://github.com/pingdotgg/t3code into feat/…
3xcalibur-tech Nov 6, 2026
501a005
Merge branch 'main' of https://github.com/pingdotgg/t3code into feat/…
3xcalibur-tech Nov 8, 2026
e7cddbd
Merge remote-tracking branch 'github/main' into feat/scheduled-task-d…
maria-rcks Nov 11, 2026
9f3b329
Merge branch 'main' of https://github.com/pingdotgg/t3code into feat/…
3xcalibur-tech Nov 11, 2026
aed9ca2
Merge branch 'main' into feat/scheduled-task-delivery-mode
3xcalibur-tech Nov 11, 2026
389cc16
Merge branch 'main' of https://github.com/pingdotgg/t3code into feat/…
3xcalibur-tech Nov 12, 2026
428db5f
Merge branch 'main' into feat/scheduled-task-delivery-mode
3xcalibur-tech Nov 12, 2026
a77d95c
Merge remote-tracking branch 'upstream/main' into t3code/pr-31129/fea…
3xcalibur-tech Nov 13, 2026
03d1842
Merge remote-tracking branch 'upstream/main' into t3code/pr-31129/fea…
3xcalibur-tech Nov 13, 2026
ff9c4ad
Merge remote-tracking branch 'upstream/main' into t3code/pr-31129/fea…
3xcalibur-tech Nov 13, 2026
e2352a0
Merge remote-tracking branch 'upstream/main' into t3code/pr-31129/fea…
3xcalibur-tech Nov 14, 2026
01cb5af
fix(mobile): delivery mode picker uses the updater-only setDraft from…
3xcalibur-tech Nov 14, 2026
23ac87b
merge: bring main into scheduled task delivery mode
maria-rcks Nov 15, 2026
401f051
fix(scheduled-tasks): preserve delivery mode and track steered failures
maria-rcks Nov 15, 2026
9bb9516
fix(scheduled-tasks): follow delivery fallback runs
maria-rcks Nov 15, 2026
e313596
Merge remote-tracking branch 'upstream/main' into feat/scheduled-task…
3xcalibur-tech Nov 15, 2026
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 @@ -158,6 +158,7 @@ beforeEach(() => {
schedule: { type: "fixed_time", timeOfDay: "05:00" },
projectId: ProjectId.make("project"),
threadId: null,
sendMode: "queue",
workspaceStrategy: { type: "root" },
modelSelection: {
instanceId: ProviderInstanceId.make("codex"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScroll
import { SegmentedControl } from "../../components/ui/SegmentedControl";
import { ThemedSwitch } from "../../components/ui/ThemedSwitch";
import { webhookAddress } from "@t3tools/client-runtime/webhook-address";
import {
SCHEDULED_TASK_SEND_MODE_COPY,
SCHEDULED_TASK_SEND_MODES,
} from "@t3tools/client-runtime/scheduled-task-send-mode";
import { tryCopyTextWithHaptic } from "../../lib/copyTextWithHaptic";
import { usePreparedConnection } from "../../state/session";
import { buildModelOptions } from "../../lib/modelOptions";
Expand Down Expand Up @@ -810,6 +814,7 @@ function TaskForm({
enabled: draft.enabled,
threadId: draft.threadId,
...(offersThreadModes ? { threadMode: draft.threadMode } : {}),
...(draft.sendMode === draft.task?.sendMode ? {} : { sendMode: draft.sendMode }),
workspaceStrategy:
draft.workspace === "root"
? { type: "root" }
Expand Down Expand Up @@ -999,6 +1004,32 @@ function TaskForm({
) : null}
</SettingsSection>

{draft.threadMode === "continue" &&
config?.environment.capabilities.scheduledTaskSendMode === true ? (
<SettingsSection
title="Thread"
footer={SCHEDULED_TASK_SEND_MODE_COPY[draft.sendMode].description}
>
<SelectRow
label="Delivery"
value={SCHEDULED_TASK_SEND_MODE_COPY[draft.sendMode].label}
actions={
saving || dictationPending
? []
: SCHEDULED_TASK_SEND_MODES.map((mode) => ({
id: mode,
title: SCHEDULED_TASK_SEND_MODE_COPY[mode].label,
state: mode === draft.sendMode ? "on" : undefined,
}))
}
onSelect={(id) => {
const mode = SCHEDULED_TASK_SEND_MODES.find((candidate) => candidate === id);
if (mode) setDraft((current) => ({ ...current, sendMode: mode }));
}}
/>
</SettingsSection>
) : null}

<SettingsSection title="Workspace">
<SelectRow
label="Run in"
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/features/settings/scheduledTaskDraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
RuntimeMode,
ScheduledTask,
ScheduledTaskThreadMode,
ScheduledTaskSendMode,
ScheduledTaskUpsertSchedule,
ScheduledTaskWebhookSignature,
ThreadId,
Expand Down Expand Up @@ -214,6 +215,7 @@ export type ScheduledTaskDraft = {
readonly enabled: boolean;
readonly startFromOrigin: boolean;
readonly runtimeMode: RuntimeMode;
readonly sendMode: ScheduledTaskSendMode;
};

function draftSignature(draft: ScheduledTaskDraft): string {
Expand Down Expand Up @@ -244,6 +246,7 @@ function draftSignature(draft: ScheduledTaskDraft): string {
draft.enabled,
draft.startFromOrigin,
draft.runtimeMode,
draft.sendMode,
]);
}

Expand Down Expand Up @@ -306,6 +309,7 @@ export function createDraft(
enabled: true,
startFromOrigin: true,
runtimeMode: "full-access",
sendMode: "queue",
};
}

Expand All @@ -332,5 +336,6 @@ export function editDraft(task: ScheduledTask): ScheduledTaskDraft {
? (task.workspaceStrategy.startFromOrigin ?? false)
: true,
runtimeMode: task.runtimeMode,
sendMode: task.sendMode,
};
}
1 change: 1 addition & 0 deletions apps/server/src/environment/ServerEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export const make = Effect.gen(function* () {
oneTimeSchedules: true,
freshContext: true,
scheduledTaskThreadModes: true,
scheduledTaskSendMode: true,
npmReleaseLookup: true,
voiceTranscription: isSpeechPlatformSupported(hostPlatform, hostArchitecture, hostLibc),
cloudVoiceTranscription: true,
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/mcp/OrchestratorMcpService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3387,6 +3387,7 @@ describe("OrchestratorMcpService provider resolution", () => {
schedule: { type: "webhook", signature: null },
projectId,
threadId: null,
sendMode: "queue",
workspaceStrategy: { type: "root" },
modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5" },
runtimeMode: "approval-required",
Expand Down Expand Up @@ -3624,6 +3625,7 @@ describe("OrchestratorMcpService provider resolution", () => {
schedule: { type: "interval", everyMs: 3_600_000 },
projectId,
threadId: null,
sendMode: "queue",
workspaceStrategy: { type: "root" },
modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5" },
runtimeMode: "approval-required",
Expand Down
54 changes: 54 additions & 0 deletions apps/server/src/orchestration-v2/ThreadManagementService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,28 @@ const layerDispatchChokepointTest =
id: ThreadId.make("thread:thread-management:chokepoint"),
projectId: ProjectId.make("project:thread-management:chokepoint"),
deletedAt: null,
archivedAt: null,
modelSelection: {
instanceId: ProviderInstanceId.make("codex_work"),
model: "test",
},
},
// The steer retry test's send, accepted into a turn that has since ended.
runs: [{ id: RunId.make("run:thread-management:steer-replay"), status: "completed" }],
providerTurns: [],
messages: [
{
id: MessageId.make("message:thread-management:steer-replay"),
runId: RunId.make("run:thread-management:steer-replay"),
},
],
turnItems: [
{
type: "user_message",
messageId: MessageId.make("message:thread-management:steer-replay"),
inputIntent: "steer",
},
],
} as unknown as OrchestrationV2ThreadProjection),
dispatch: (command) =>
Effect.sync(() => {
Expand Down Expand Up @@ -211,6 +228,43 @@ it.effect(
},
);

it.effect("a retried steer replays its accepted send after the steered turn has ended", () => {
const projectId = ProjectId.make("project:thread-management:chokepoint");
const threadId = ThreadId.make("thread:thread-management:chokepoint");
const commandId = CommandId.make("command:thread-management:steer-replay");
const dispatched: Array<string> = [];
const layerTest = layerDispatchChokepointTest(ServerSettings.layerTest())(dispatched);

return Effect.gen(function* () {
const receipts = yield* CommandReceiptStore.CommandReceiptStoreV2;
yield* receipts.insertIfAbsent({
commandId,
threadId,
commandType: "message.dispatch",
acceptedAt: yield* DateTime.now,
resultSequence: 1,
status: "accepted",
error: null,
});

const threads = yield* ThreadManagementService.ThreadManagementService;
const result = yield* threads.sendToThread({
projectId,
commandId,
threadId,
messageId: MessageId.make("message:thread-management:steer-replay"),
text: "CI failed.",
attachments: [],
mode: "steer",
createdBy: "user",
creationSource: "server",
});

expect(result.delivery).toBe("steered");
expect(dispatched).toEqual(["message.dispatch"]);
}).pipe(Effect.provide(layerTest));
});

it.effect.each([
{ label: "fails a send that starts a turn", running: false },
{ label: "still steers a running turn", running: true },
Expand Down
14 changes: 9 additions & 5 deletions apps/server/src/orchestration-v2/ThreadManagementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,16 +884,20 @@ const make = Effect.gen(function* () {
{ readonly type: "message.dispatch" }
>["dispatchMode"];
if (mode === "steer" || mode === "restart") {
if (steerableRun === undefined) {
if (steerableRun === undefined && !(yield* hasReceipt(input.commandId))) {
return yield* new ThreadManagementNoSteerableRunError({
threadId: input.threadId,
mode,
});
}
dispatchMode = {
type: mode === "steer" ? "steer_active" : "restart_active",
targetRunId: steerableRun.id,
};
// A retry of an accepted send replays its receipt, even after the steered turn has ended.
dispatchMode =
steerableRun === undefined
? { type: "queue_after_active" }
: {
type: mode === "steer" ? "steer_active" : "restart_active",
targetRunId: steerableRun.id,
};
} else if (mode === "auto" && steerableRun !== undefined) {
dispatchMode = { type: "steer_active", targetRunId: steerableRun.id };
} else {
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/persistence/Migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ import Migration0092 from "./Migrations/092_QueuedTurnInputIndexJsonValid.ts";
import Migration0093 from "./Migrations/093_ProviderTurnAttemptIndex.ts";
import Migration0094 from "./Migrations/094_TurnItemMessageOrdinalIndex.ts";
import Migration0095 from "./Migrations/095_TurnItemInlineWorkOutput.ts";
import Migration0096 from "./Migrations/096_ScheduledTaskSendMode.ts";

const migrationEntries = [
[1, "OrchestrationEvents", Migration0001],
Expand Down Expand Up @@ -201,6 +202,7 @@ const migrationEntries = [
[93, "ProviderTurnAttemptIndex", Migration0093],
[94, "TurnItemMessageOrdinalIndex", Migration0094],
[95, "TurnItemInlineWorkOutput", Migration0095],
[96, "ScheduledTaskSendMode", Migration0096],
] as const;

export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Effect from "effect/Effect";
import * as SqlClient from "effect/sql/SqlClient";

export default Effect.gen(function* () {
const sql = yield* SqlClient.SqlClient;
yield* sql`ALTER TABLE scheduled_tasks ADD COLUMN send_mode TEXT NOT NULL DEFAULT 'queue'`;
});
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe("V2 preview upgrade", () => {
[93, "ProviderTurnAttemptIndex"],
[94, "TurnItemMessageOrdinalIndex"],
[95, "TurnItemInlineWorkOutput"],
[96, "ScheduledTaskSendMode"],
]);
assert.deepStrictEqual(yield* runMigrations(), []);
assert.deepStrictEqual(yield* sql`SELECT * FROM orchestration_v2_legacy_imports`, imports);
Expand Down Expand Up @@ -193,6 +194,7 @@ describe("V2 preview upgrade", () => {
[93, "ProviderTurnAttemptIndex"],
[94, "TurnItemMessageOrdinalIndex"],
[95, "TurnItemInlineWorkOutput"],
[96, "ScheduledTaskSendMode"],
]);
}).pipe(Effect.provide(NodeSqliteClient.layer({ filename: ":memory:" }))),
);
Expand Down
Loading
Loading