Skip to content

Commit 1531602

Browse files
Nicholas Wasmillerclaude
andcommitted
fix(server): a resumed legacy idle compaction keeps T3 Code authorship
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7b081e1 commit 1531602

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎apps/server/src/orchestration-v2/RestartContinuation.test.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,10 +1079,11 @@ it.effect("does not continue a run the user asked to stop before the restart", (
10791079

10801080
it.effect("compacts again after a cut /compact turn, and does not continue a cut /logout", () =>
10811081
Effect.gen(function* () {
1082-
for (const [text, idleCompaction, expected] of [
1083-
[" /Compact ", undefined, ["user:/compact"]],
1084-
["/compact", "beforeCacheExpires", ["agent:/compact"]],
1085-
[" /LOGOUT ", undefined, []],
1082+
for (const [text, creationSource, expected] of [
1083+
[" /Compact ", "mcp", ["user:/compact"]],
1084+
// Servers before `idleCompaction` marked their own compaction this way.
1085+
["/compact", "server", ["agent:/compact"]],
1086+
[" /LOGOUT ", "mcp", []],
10861087
] as const) {
10871088
const sent = yield* continuationDispatches({
10881089
...cutMidTurn(),
@@ -1091,9 +1092,9 @@ it.effect("compacts again after a cut /compact turn, and does not continue a cut
10911092
id: MessageId.make("message:user"),
10921093
role: "user",
10931094
createdBy: "agent",
1095+
creationSource,
10941096
text,
10951097
attachments: [],
1096-
idleCompaction,
10971098
},
10981099
],
10991100
} as unknown as OrchestrationV2ThreadProjection);

‎apps/server/src/orchestration-v2/RestartContinuation.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
33
import {
44
CommandId,
55
IDLE_COMPACTION_TEXT,
6+
idleCompactionOf,
67
isCompactionCommandMessage,
78
isOrchestrationV2WorkActive,
89
latestProviderTurnForAttempt,
@@ -337,7 +338,7 @@ export const continueRestartedRun = Effect.fn("RestartContinuation.continueResta
337338
// Agent + server with no idleCompaction reads as an automatic idle compaction.
338339
createdBy: !recompact
339340
? "agent"
340-
: sourceMessage.idleCompaction === undefined
341+
: idleCompactionOf(sourceMessage) === undefined
341342
? "user"
342343
: sourceMessage.createdBy,
343344
creationSource: "server",

0 commit comments

Comments
 (0)