Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): /compact with instructions no longer runs a bare compaction first #20236

Closedfixfon(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/20236/headopened View on GitHub

Showing 3 changed files with 35 additions and 4 deletions.

x
0 of 3 viewed, 3 left
13 additions and 0 deletionsapps/web/src/components/ChatView.logic.test.tsModified
View file
@@ -94,6 +94,7 @@
resolveThreadMetadataUpdateForNextTurn,
resolveSendEnvMode,
startNewThreadForProject,
+ shouldCompactBeforeSend,
shouldShowBranchMismatchBanner,
shouldShowPlanFollowUpPrompt,
shouldWriteThreadErrorToCurrentServerThread,
@@ -510,6 +511,18 @@
});
});
​
+describe("shouldCompactBeforeSend", () => {
+ it("lets /compact with instructions be the only compaction while the Compact chip is on", () => {
+ const chipOn = { resumeCompactionTokens: 120_000, keepFullHistory: false };
+ expect(shouldCompactBeforeSend({ ...chipOn, messageText: "fix the failing test" })).toBe(true);
+ expect(shouldCompactBeforeSend({ ...chipOn, messageText: "/compactfoo" })).toBe(true);
+ expect(shouldCompactBeforeSend({ ...chipOn, messageText: "/compact" })).toBe(false);
+ expect(
+ shouldCompactBeforeSend({ ...chipOn, messageText: "/Compact keep the auth refactor notes" }),
+ ).toBe(false);
+ });
+});
+​
describe("session branch mismatch dismissal", () => {
it("tracks dismissed keys and treats other keys as active", () => {
expect(isBranchMismatchDismissedForSession("t1:a:b")).toBe(false);