Skip to content

fix(web): sending to an idle Claude thread no longer auto-compacts first - #84

Merged
jayleaton merged 1 commit into
mainfrom
fix/idle-chat-unexpected-compaction
Oct 5, 2026
Merged

jayleaton merged 1 commit into
mainfrom
fix/idle-chat-unexpected-compaction

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Opening a Claude thread that had been idle for about an hour showed the "Resume with less context" banner. If you then sent a message without dismissing the banner, the web client first dispatched a hidden /compact turn and queued your message behind it. So the thread started compacting before your message ran. Upstream reverted that behavior in pingdotgg#15771 (2188bdd8b5), but this fork had not picked up the revert. This PR cherry-picks it.

Summary

  onSend:
-   compactBeforeSend = resumeCompactionBannerItem !== null && !compactDisabled && ...
-   if (compactBeforeSend) startThreadTurn({ text: "/compact" })   // extra turn, message queued behind it
-   startThreadTurn({ ...message, dispatchMode: compactBeforeSend ? "queue" : dispatchMode })
+   startThreadTurn({ ...message, dispatchMode })

The banner stays. Its Compact button still compacts on request, and Keep full history still dismisses it. Sending a message no longer compacts implicitly.

Evidence

  • Before (live data, read-only snapshot): six /compact user messages today on Claude threads, each creationSource: web / inputIntent: turn_start. Each came after 73–1,215 min idle and was followed 6–58 s later by the owner's real message. Example: thread mcp:82e15b2e…, idle 81 min, /compact at 12:22:49.534Z started run 35, and the owner's message started run 36 at 12:22:49.738Z. None of these messages were typed by the owner.
  • After: the send path no longer contains the /compact dispatch (diff above). apps/web tsc --noEmit passes. vp test run apps/web/src/components/chat/ContextWindowMeter.logic.test.ts passes (21/21). Not checked in a real client yet.
  • Not covered by this PR: Codex compaction after idle (for example the Captain thread at 11:41Z). That one is native Codex auto-compaction: the previous turn ended at 90.3% of the context window, and Codex compacts at the start of the next turn. It is provider behavior, not app-triggered.

Merge Danger

Door: two-way. Straight upstream revert. It can be re-reverted.

Blast Radius: web/desktop composer. Only affects sending while the Claude resume banner is visible. Mobile never had this path.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 5, 2026
@jayleaton
jayleaton merged commit feb500d into main Oct 5, 2026
17 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants