Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/server/src/orchestration-v2/ContextHandoffBudget.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ describe("handoff budget", () => {
assert.equal(command?.kind, "command_execution");
assert.include(command!.text, "Exit code: 1");
assert.include(command!.text, "界".repeat(300));
assert.equal(
historicalMessage({
...base,
type: "file_change",
fileName: "src/a.ts",
changes: [
{ operation: "update", path: "src/a.ts" },
{ operation: "add", path: "src/b.ts" },
{ operation: "update", path: "src/new.ts", oldPath: "src/old.ts" },
],
})?.text,
"File change: src/a.ts, src/b.ts, src/new.ts",
);
assert.isNull(
historicalMessage({
...base,
Expand Down
30 changes: 30 additions & 0 deletions apps/server/src/orchestration-v2/ContextHandoffService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,36 @@ it.effect("caps the side chat context block without summarizing discarded parent
});
assert.isTrue(framingOnly.startsWith("You are in a side chat beside the main thread."));
assert.notInclude(framingOnly, "Main thread activity");

const multiFilePatch = ContextHandoffService.makeSideChatContext({
parentThreadId,
digest: [
{
id: TurnItemId.make("turn-item:patch"),
threadId: parentThreadId,
runId: null,
nodeId: null,
providerThreadId: null,
providerTurnId: null,
nativeItemRef: null,
parentItemId: null,
ordinal: 60,
status: "completed",
title: null,
startedAt: null,
completedAt: null,
updatedAt: DateTime.makeUnsafe(0),
type: "file_change",
fileName: "src/a.ts",
changes: [
{ operation: "update", path: "src/a.ts" },
{ operation: "add", path: "src/b.ts" },
{ operation: "update", path: "src/new.ts", oldPath: "src/old.ts" },
],
},
],
});
assert.include(multiFilePatch, "- File change: src/a.ts, src/b.ts, src/new.ts");
}).pipe(Effect.provide(layerTest)),
);

Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/orchestration-v2/ContextHandoffService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function summarizeDeltaItem(item: OrchestrationV2TurnItem): string | null {
case "command_execution":
return `- Command: ${compactText(item.input)}`;
case "file_change":
return `- File change: ${item.fileName}`;
return `- File change: ${compactText(item.changes?.map((change) => change.path).join(", ") ?? item.fileName)}`;
Comment thread
Yash-Singh1 marked this conversation as resolved.
Resolved
case "checkpoint":
return `- Checkpoint: ${item.files.length} files`;
case "handoff":
Expand Down
2 changes: 1 addition & 1 deletion packages/provider-core/src/server/handoffBudget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function historicalMessage(
text = item.message;
break;
case "file_change":
text = `File change: ${item.fileName}`;
text = `File change: ${item.changes?.map((change) => change.path).join(", ") ?? item.fileName}`;
break;
case "proposed_plan":
text = item.markdown;
Expand Down
Loading