Compare commits

...
Author SHA1 Message Date
Julius Marmingeandcodex f315a4297f test(server): cover silent Claude task updates
Co-authored-by: codex <[email protected]>
2026-07-17 21:30:57 +02:00
Julius Marminge bd60ed0a9c Merge branch 'main' into t3code/claude-binding-error 2026-07-17 21:21:11 +02:00
Theo BrowneandClaude Fable 5 e62609ba3c fix(server): stop surfacing Claude 'task_updated' messages as work-log errors
The Claude Agent SDK emits system/task_updated as a task-state sync
patch (per its typings, clients merge it into their local task map).
The adapter's system-message switch had no case for it, so it fell
into the unknown-message default and showed up in the work log as a
red-X 'Claude system message' row on every background task status
change. Terminal statuses already arrive via task_notification, so
absorb the message silently; the raw payload remains in the provider
log file.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 03:22:32 -07:00
2 changed files with 47 additions and 0 deletions

No files matched your search

@@ -1664,6 +1664,48 @@ describe("ClaudeAdapterLive", () => {
);
});
it.effect("does not surface Claude task_updated messages as runtime warnings", () => {
const harness = makeHarness();
return Effect.gen(function* () {
const adapter = yield* ClaudeAdapter;
const runtimeEventsFiber = yield* Stream.take(adapter.streamEvents, 6).pipe(
Stream.runCollect,
Effect.forkChild,
);
yield* adapter.startSession({
threadId: THREAD_ID,
provider: ProviderDriverKind.make("claudeAgent"),
runtimeMode: "full-access",
});
harness.query.emit({
type: "system",
subtype: "task_updated",
task_id: "task-subagent-1",
status: "in_progress",
session_id: "sdk-session-task-updated",
uuid: "task-updated-1",
} as unknown as SDKMessage);
harness.query.emit({
type: "system",
subtype: "task_progress",
task_id: "task-subagent-1",
description: "Running background teammate",
session_id: "sdk-session-task-updated",
uuid: "task-progress-after-update-1",
} as unknown as SDKMessage);
const runtimeEvents = Array.from(yield* Fiber.join(runtimeEventsFiber));
assert.isFalse(runtimeEvents.some((event) => event.type === "runtime.warning"));
assert.isTrue(runtimeEvents.some((event) => event.type === "task.progress"));
}).pipe(
Effect.provideService(Random.Random, makeDeterministicRandomService()),
Effect.provide(harness.layer),
);
});
it.effect("forwards Claude task progress summaries for subagent updates", () => {
const harness = makeHarness();
return Effect.gen(function* () {
@@ -2741,6 +2741,11 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
return;
case "thinking_tokens":
return;
// Task-state sync patch for the client's local task map. Terminal
// statuses arrive separately via task_notification, so there is
// nothing to surface; the raw payload stays in the provider log.
case "task_updated":
return;
case "permission_denied":
yield* offerRuntimeEvent({
...base,