The best way to control Claude Code, Codex and more from any computer or phone
fix(server): handoff context names every file of a multi-file patch (#29905)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 17:21 UTC
e5d07108760777a8b366c727d01c582cddf27dbc
4 files changed
+45
-2
apps/server/src/orchestration-v2/ContextHandoffBudget.test.ts
+13
@@ -137,6 +137,19 @@ describe("handoff budget", () => {
137
assert.equal(command?.kind, "command_execution");
138
assert.include(command!.text, "Exit code: 1");
139
assert.include(command!.text, "界".repeat(300));
140
+ assert.equal(
141
+ historicalMessage({
142
+ ...base,
143
+ type: "file_change",
144
+ fileName: "src/a.ts",
145
+ changes: [
146
+ { operation: "update", path: "src/a.ts" },
147
+ { operation: "add", path: "src/b.ts" },
148
+ { operation: "update", path: "src/new.ts", oldPath: "src/old.ts" },
149
+ ],
150
+ })?.text,
151
+ "File change: src/a.ts, src/b.ts, src/new.ts",
152
+ );
153
assert.isNull(
154
historicalMessage({
155
...base,
apps/server/src/orchestration-v2/ContextHandoffService.test.ts
+30
@@ -210,6 +210,36 @@ it.effect("caps the side chat context block without summarizing discarded parent
210
});
211
assert.isTrue(framingOnly.startsWith("You are in a side chat beside the main thread."));
212
assert.notInclude(framingOnly, "Main thread activity");
213
+
214
+ const multiFilePatch = ContextHandoffService.makeSideChatContext({
215
+ parentThreadId,
216
+ digest: [
217
+ {
218
+ id: TurnItemId.make("turn-item:patch"),
219
+ threadId: parentThreadId,
220
+ runId: null,
221
+ nodeId: null,
222
+ providerThreadId: null,
223
+ providerTurnId: null,
224
+ nativeItemRef: null,
225
+ parentItemId: null,
226
+ ordinal: 60,
227
+ status: "completed",
228
+ title: null,
229
+ startedAt: null,
230
+ completedAt: null,
231
+ updatedAt: DateTime.makeUnsafe(0),
232
+ type: "file_change",
233
+ fileName: "src/a.ts",
234
+ changes: [
235
+ { operation: "update", path: "src/a.ts" },
236
+ { operation: "add", path: "src/b.ts" },
237
+ { operation: "update", path: "src/new.ts", oldPath: "src/old.ts" },
238
+ ],
239
+ },
240
+ ],
241
+ });
242
+ assert.include(multiFilePatch, "- File change: src/a.ts, src/b.ts, src/new.ts");
243
}).pipe(Effect.provide(layerTest)),
244
);
245
apps/server/src/orchestration-v2/ContextHandoffService.ts
+1
-1
@@ -213,7 +213,7 @@ function summarizeDeltaItem(item: OrchestrationV2TurnItem): string | null {
213
case "command_execution":
214
return `- Command: ${compactText(item.input)}`;
215
case "file_change":
216
- return `- File change: ${item.fileName}`;
216
+ return `- File change: ${compactText(item.changes?.map((change) => change.path).join(", ") ?? item.fileName)}`;
217
case "checkpoint":
218
return `- Checkpoint: ${item.files.length} files`;
219
case "handoff":
packages/provider-core/src/server/handoffBudget.ts
+1
-1
@@ -147,7 +147,7 @@ export function historicalMessage(
147
text = item.message;
148
break;
149
case "file_change":
150
- text = `File change: ${item.fileName}`;
150
+ text = `File change: ${item.changes?.map((change) => change.path).join(", ") ?? item.fileName}`;
151
break;
152
case "proposed_plan":
153
text = item.markdown;