@devries-cameron20 / t3code-1 / commits / 3a9640c3eb
Fork 0

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

fix(claude): name the notebook a NotebookEdit changed (#22130)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Victor Vogel committed Oct 30, 2026 at 15:37 UTC 3a9640c3eb839fadd22f43dd3fc7e5dc433f6725
2 files changed +85 -1
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+84
@@ -6865,6 +6865,90 @@ describe("ClaudeAdapterV2 background wake turns", () => {
6865 ),
6866 );
6867
6868 + it.effect("names the notebook a Claude NotebookEdit changed", () =>
6869 + Effect.gen(function* () {
6870 + const harness = yield* makeWakeHarness;
6871 + yield* harness.runtime.startTurn(
6872 + makeClaudeTestTurnInput({
6873 + threadId: harness.threadId,
6874 + providerThread: harness.providerThread,
6875 + now: yield* DateTime.now,
6876 + attemptId: RunAttemptId.make("attempt-notebook-edit"),
6877 + text: "Fix the notebook",
6878 + attachments: [],
6879 + }),
6880 + );
6881 + yield* Queue.offer(
6882 + harness.sdkMessages,
6883 + claudeSdkFrame({
6884 + type: "assistant",
6885 + uuid: "00000000-0000-4000-8000-000000000604",
6886 + session_id: WAKE_NATIVE_SESSION,
6887 + parent_tool_use_id: null,
6888 + message: {
6889 + id: "msg_notebook_edit",
6890 + model: "claude-sonnet-4-6",
6891 + type: "message",
6892 + role: "assistant",
6893 + content: [
6894 + {
6895 + type: "tool_use",
6896 + id: "notebook",
6897 + name: "NotebookEdit",
6898 + input: {
6899 + notebook_path: "/workspace/analysis.ipynb",
6900 + cell_id: "c1",
6901 + new_source: "print(1)",
6902 + },
6903 + },
6904 + ],
6905 + stop_reason: "tool_use",
6906 + stop_sequence: null,
6907 + usage: {
6908 + input_tokens: 1,
6909 + output_tokens: 1,
6910 + cache_creation_input_tokens: 0,
6911 + cache_read_input_tokens: 0,
6912 + },
6913 + },
6914 + }),
6915 + );
6916 + yield* Queue.offer(
6917 + harness.sdkMessages,
6918 + claudeSdkFrame({
6919 + type: "user",
6920 + uuid: "00000000-0000-4000-8000-000000000605",
6921 + session_id: WAKE_NATIVE_SESSION,
6922 + parent_tool_use_id: null,
6923 + message: {
6924 + role: "user",
6925 + content: [{ type: "tool_result", tool_use_id: "notebook", content: "Updated cell c1" }],
6926 + },
6927 + }),
6928 + );
6929 + yield* Queue.offer(
6930 + harness.sdkMessages,
6931 + makeResultFrame({ uuid: "00000000-0000-4000-8000-000000000606", result: "Done" }),
6932 + );
6933 + yield* Queue.take(harness.terminalReceipts);
6934 + const item = harness.events
6935 + .flatMap((event) =>
6936 + event.type === "turn_item.updated" &&
6937 + event.turnItem.nativeItemRef?.nativeId === "notebook"
6938 + ? [event.turnItem]
6939 + : [],
6940 + )
6941 + .at(-1);
6942 + assert.equal(item?.type, "file_change");
6943 + if (item?.type === "file_change") assert.equal(item.fileName, "/workspace/analysis.ipynb");
6944 + }).pipe(
6945 + Effect.scoped,
6946 + Effect.provide(
6947 + Layer.mergeAll(NodeServices.layer, IdAllocator.layer, McpProviderSessions.layer),
6948 + ),
6949 + ),
6950 + );
6951 +
6952 it.effect.each(["claude-haiku-4-5-20251001", "claude-sonnet-4-6"])(
6953 "renegotiates auto only when switching API models after fallback to default: %s",
6954 (nextModel) =>
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
+1 -1
@@ -2923,7 +2923,7 @@ function parseClaudeBackgroundTaskEntry(
2923
2924 function fileNameFromClaudeTool(toolName: string, input: ClaudeNativeToolInput): string {
2925 return (
2926 - firstStringInputField(input, ["file_path", "path", "filename", "fileName"]) ??
2926 + firstStringInputField(input, ["file_path", "notebook_path", "path", "filename", "fileName"]) ??
2927 `${toolName} result`
2928 );
2929 }