Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude 5.1+ text before a tool call shows as assistant text #18364

MergedGigioxx(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18364/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 105 additions and 1 deletion.

x
0 of 2 viewed, 2 left
69 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -2806,6 +2806,75 @@
+ it.effect.each([
+ { model: "claude-opus-5-5", expected: "assistant_message" },
+ { model: "claude-fable-5-1", expected: "assistant_message" },
+ { model: "claude-opus-5", expected: "reasoning" },
+ { model: "claude-sonnet-4-6", expected: "reasoning" },
+ ] as const)(
+ "shows $model thinking right before a tool call as $expected",
+ ({ model, expected }) =>
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarness;
+ yield* harness.runtime.startTurn(
+ makeClaudeTestTurnInput({
+ threadId: harness.threadId,
+ providerThread: harness.providerThread,
+ now: yield* DateTime.now,
+ attemptId: RunAttemptId.make("thinking-before-tool-attempt"),
+ text: "Check the memory file",
+ attachments: [],
+ }),
+ );
+ const snapshot = (uuid: string, content: ReadonlyArray<unknown>) =>
+ claudeSdkFrame({
+ type: "assistant",
+ uuid,
+ session_id: WAKE_NATIVE_SESSION,
+ parent_tool_use_id: null,