Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): run_scheduled_task_now returns the thread the run launched #17458

Mergedsbansal1999(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/17458/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 43 additions and 3 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 2 deletionsapps/server/src/mcp/toolkits/thread/handlers.tsModified
View file
@@ -84,12 +84,12 @@
code: "invalid_request",
message: "The scheduled task was not found.",
});
- const { task } = yield* scheduler
+ const { task, threadId } = yield* scheduler
.runNow({ id: input.taskId })
.pipe(Effect.mapError(unavailable));
return {
taskId: task.id,
- threadId: task.threadId,
+ threadId,
lastRunStatus: task.lastRunStatus,
runCount: task.runCount,
nextRunAt: task.nextRunAt,
1 addition and 1 deletionapps/server/src/mcp/toolkits/thread/tools.tsModified
View file
@@ -257,7 +257,7 @@
const ScheduledTaskRunTool = Tool.make("run_scheduled_task_now", {
...commandTool,
description:
- "Run a scheduled task now through the existing scheduler. Requires a full-access/default caller. Each call is a new manual run; completion means dispatch/bookkeeping completed, not that the provider turn finished.",
+ "Run a scheduled task now through the existing scheduler. Requires a full-access/default caller. Returns the thread this run dispatched to, or null if dispatch failed. Each call is a new manual run; completion means dispatch/bookkeeping completed, not that the provider turn finished.",
parameters: Schema.Struct({ taskId: ScheduledTaskId }),
success: Schema.Struct({
taskId: ScheduledTaskId,