@devries-cameron20 / t3code Mirror · read-only / commits / 4adb946ae7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 12:15 UTC

fix(claude): show monitor commands in background work details (#37019)

Yash Singh committed Nov 14, 2026 at 20:23 UTC 4adb946ae77cd291804d864d0404d68ecfeb8cd9
3 files changed +19 -1
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+10
@@ -12436,12 +12436,22 @@ describe("ClaudeAdapterV2 background wake turns", () => {
12436
12437 const roster = providerThreadRosterEvents(harness.events).at(-1)?.providerThread
12438 .pendingBackgroundTasks;
12439 + const monitorItem = harness.events.find(
12440 + (event) =>
12441 + event.type === "turn_item.updated" &&
12442 + event.turnItem.nativeItemRef?.nativeId === "toolu_monitor_0",
12443 + );
12444 + assert.equal(monitorItem?.type, "turn_item.updated");
12445 + if (monitorItem?.type !== "turn_item.updated") return;
12446 assert.deepEqual(roster, [
12447 {
12448 taskId: longRunning.taskId,
12449 kind: "monitor",
12450 description: "Monitor 0",
12451 nativeItemId: "toolu_monitor_0",
12452 + command: "sleep 8 && echo MONITOR_DONE",
12453 + itemId: monitorItem.turnItem.id,
12454 + sourceThreadId: harness.threadId,
12455 },
12456 ]);
12457 }).pipe(
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+2 -1
@@ -10123,7 +10123,8 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
10123 ? undefined
10124 : findToolCall(input.activeContext, message.tool_use_id);
10125 const command =
10126 - launch?.classification.itemType === "command_execution"
10126 + launch?.classification.itemType === "command_execution" ||
10127 + launch?.toolName === "Monitor"
10128 ? firstStringInputField(launch.input, ["command"])
10129 : undefined;
10130 yield* upsertPendingBackgroundTask(input.nativeThreadId, {
apps/server/src/orchestration-v2/testkit/fixtures/claude_background_monitor_wake/output.ts
+7
@@ -27,6 +27,10 @@ export function assertClaudeBackgroundMonitorWakeOutput(
27 const projection = projectionFor(result, transcript.scenario);
28 assertSemanticProjectionIntegrity(projection);
29 assertUserMessagesInclude(projection, [CLAUDE_BACKGROUND_MONITOR_WAKE_PROMPT]);
30 + const monitorItem = projection.turnItems.find(
31 + (item) => item.nativeItemRef?.nativeId === "toolu_019b4EUbhEcYP4TS7vZn27N1",
32 + );
33 + assert.isDefined(monitorItem);
34
35 const rosterTasks = result.domainEvents
36 .flatMap((event) =>
@@ -41,6 +45,9 @@ export function assertClaudeBackgroundMonitorWakeOutput(
45 description: "Background monitor test",
46 kind: "monitor",
47 nativeItemId: "toolu_019b4EUbhEcYP4TS7vZn27N1",
48 + command: "sleep 8 && echo MONITOR_DONE",
49 + itemId: monitorItem?.id,
50 + sourceThreadId: monitorItem?.threadId,
51 });
52 }
53 assert.deepEqual(projection.providerThreads[0]?.pendingBackgroundTasks ?? [], []);