Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): instructed compact runs without a bare compaction first #24008

Mergedjuliusmarmingemerged 9 commits intomain fromrefs/pull/24008/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 20 additions and 9 deletions.

x
0 of 2 viewed, 2 left
15 additions and 8 deletionsapps/web/src/components/ChatView.logic.test.tsModified
View file
@@ -1102,14 +1102,21 @@
it("queues behind a compaction of a stale session, except for /compact itself", () => {
- expect(planComposerTurn({ ...base, resumeCompactionTokens: 120_000 })).toMatchObject({
- compactBeforeSend: true,
- turnDispatchMode: "queue",
- shouldQueueBehindActiveRun: true,
- });
- expect(
- planComposerTurn({ ...base, resumeCompactionTokens: 120_000, messageText: "/COMPACT" }),
- ).toMatchObject({ compactBeforeSend: false, turnDispatchMode: "auto" });
+ const stale = { ...base, resumeCompactionTokens: 120_000 };
+ for (const messageText of ["hello", "/compactfoo"]) {
+ expect(planComposerTurn({ ...stale, messageText })).toMatchObject({
+ compactBeforeSend: true,
+ turnDispatchMode: "queue",
+ shouldQueueBehindActiveRun: true,
+ });
+ }
+ for (const messageText of ["/COMPACT", "/compact keep the API notes", "/compact\n tests"]) {
+ expect(planComposerTurn({ ...stale, messageText })).toMatchObject({
+ compactBeforeSend: false,
+ turnDispatchMode: "auto",
+ shouldQueueBehindActiveRun: false,
+ });
+ }
it("queues behind a running turn only when asked to", () => {