Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): interrupts started by an agent no longer say "by user" in the timeline #24299

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/24299/headmerged by juliusmarminge View on GitHub

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

x
0 of 5 viewed, 5 left
8 additions and 3 deletionsapps/server/src/mcp/OrchestratorMcpService.tsModified
View file
@@ -278,6 +278,11 @@
​
+// Without a reason, a Stop reads as the user's (see RunExecutionService.USER_STOP_REASON).
+function agentStopReason(reason: string | undefined): string {
+ return reason === undefined ? "Stopped by an agent" : `Stopped by an agent: ${reason}`;
+}
+​
function errorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
@@ -2379,14 +2384,14 @@
const stopChild = Effect.gen(function* () {
const commandId = stableCommandId({ scope, requestKey: key, operation: "cancel-task" });
- const reason = input.reason;
+ const reason = agentStopReason(input.reason);
yield* threadManagement
.dispatch({
type: "thread.stop",
commandId,
threadId: current.childThreadId,
stopDelegatedTasks: false,
- ...(reason === undefined ? {} : { reason }),
+ reason,
.pipe(
Effect.mapError((error) =>