From b29ee6a6501eb3568d943ce760f271fd93bd5ba9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 23 Jul 2026 20:58:52 -0700 Subject: [PATCH] test(desktop): give the auto-compaction E2E real headroom over threshold_tokens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'queues an Enter-submitted draft while compaction is active' test pastes a large message to push the session over the fixture's 22k threshold_tokens. At repeat(500) the payload is only ~4k tokens — the other ~18k came from the ambient system prompt (tool schemas + skills index + memory), leaving the trigger margin-less. The hermes-agent skill hub restructure (e3d524b482) shrank the bundled skills index by ~160 tokens and dropped the total just under threshold: compaction never started, waitForHeldCompletion() hung, and the test timed out at 90s on every branch since — including main (first red run: 9a4d1a0130). Bump the payload to repeat(1500) (~12.4k tokens, total ~30k) so the test crosses the threshold on its own weight with ~8k tokens of margin, and document the invariant so the next prompt-weight change doesn't resurrect this. --- .../desktop/e2e/session-compression-and-queue-stop.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts b/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts index f15b8d0befcf..911f15c78407 100644 --- a/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts +++ b/apps/desktop/e2e/session-compression-and-queue-stop.spec.ts @@ -122,11 +122,16 @@ auxiliary: // A normal message crosses the tiny configured context budget. The mock // blocks only the resulting summary request, so these assertions run // during automatic compaction rather than a slash-command path. + // The payload must cross threshold_tokens (22k) on its OWN weight + // (~12k tokens) on top of the system prompt. Do not shrink it: at + // repeat(500) the trigger only worked because the ambient system prompt + // (skills index + tool schemas) happened to carry it over the line, and + // a 160-token skills-index cleanup on main broke the test for a day. await pasteAndSend(page, 'E2E_COMPACTION_HISTORY_ONE '.repeat(5)) await waitForTranscript(page, MOCK_REPLY) await pasteAndSend(page, 'E2E_COMPACTION_HISTORY_TWO '.repeat(5)) await waitForTranscript(page, MOCK_REPLY) - await pasteAndSend(page, 'E2E_TRIGGER_AUTOMATIC_COMPACTION '.repeat(500)) + await pasteAndSend(page, 'E2E_TRIGGER_AUTOMATIC_COMPACTION '.repeat(1500)) await fixture.mock.waitForHeldCompletion() await expect(page.getByRole('status', { name: 'Summarizing thread' }).last()).toBeVisible()