Skip to content

feat(web): stale Claude threads can start with the Compact chip off - #19643

Open
buzinas wants to merge 2 commits into
pingdotgg:mainfrom
buzinas:t3/49220096
Open

buzinas wants to merge 2 commits into
pingdotgg:mainfrom
buzinas:t3/49220096

Conversation

@buzinas

@buzinas buzinas commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When you return to a large Claude thread after its prompt cache expires, the composer shows a Compact chip that starts on. If you don't notice it and press Enter, the thread's history is summarized before your message is sent, and that can't be undone. The only way to get the full history back is to fork the thread. Users who usually want to keep full history have no way to make that the starting state.

Change

Adds a client setting, Settings → General → Compact stale threads by default. It's on by default, so nothing changes for existing users.

  • When it's off, the chip starts at Full on stale threads. You can still click it to compact before a single message.
  • The composer now remembers each thread's chip choice as on or off. A thread with no choice follows the setting. A successful send clears the thread's choice so it goes back to the setting. A failed send keeps it for the retry, as before. Previously a successful send always turned the chip back on.
  • The setting is in the client settings contract and its patch schema. It's searchable in Settings, has its own reset, and is included in reset-all. The Claude provider guide says where to find it.

Web and desktop share this composer. Mobile has no Compact chip, so it's unaffected.

Scope and approval

This is a focused configuration option for an existing feature, the compact-before-send chip from #17127 and #17945. The setting only controls whether the chip starts on or off. When the chip is shown, what compaction does, and how the chip works for one message are unchanged. The default stays the same.

Verification

  • vp test run packages/contracts/src/settings.test.ts apps/desktop/src/settings/DesktopClientSettings.test.ts: 178 passed. This includes a new test that the setting defaults to on and accepts false.
  • vp test run apps/web/src/components/chat/ContextWindowMeter.logic.test.ts: 26 passed. New tests cover how the chip follows the setting per thread: the default, a thread's own choice overriding it either way, and a thread returning to the setting once its choice is cleared after a send.
  • tsc-rs --noEmit passes for packages/contracts, apps/web, and apps/desktop.
  • vp lint on the changed files reports 0 errors. The 4 warnings were already in ChatView.tsx on main.
  • Manual check in a dev server seeded with a real stale Claude thread (338k tokens):
    • With the setting on (default), the chip starts at Compact and the send button reads "Compact and send".
    • With the setting off, the chip starts at Full and the send button reads "Submit message".
    • Clicking the chip still switches it to Compact for that message.
    • The row's reset button restores the default.
  • Not checked in a running client: an actual send. Checking it would mean starting a Claude turn. The reset that runs after a successful send is covered by the tests above.

Before / setting on (default): chip starts at Compact

Compact chip starting on with the default setting

After / new setting:

Compact stale threads by default setting, turned off

After / setting off: chip starts at Full

Compact chip starting at Full with the setting off

Written with Claude Opus 5.5 in Claude Code, run inside T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 14, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This adds a persisted user-facing setting that changes whether stale Claude thread sends compact history, while also changing per-thread state reset behavior. Although the default is unchanged and the diff is focused, the composer decision and reset flow lack direct behavioral test coverage.

You can add or adjust custom eligibility rules. Learn more.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7047025-e7f0-49ff-9f4c-88c7fb3e6077
📥 Commits

Reviewing files that changed from the base of the PR and between 9a1f081 and ffb69b2.

📒 Files selected for processing: 4
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/settings/SettingsPanels.tsx
  • packages/contracts/src/settings.test.ts
  • packages/contracts/src/settings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The client settings schema adds a default for Compact chip behavior on stale threads. General settings exposes the preference. ChatView resolves each thread’s chip state from the preference or a per-thread choice.

Changes: Stale thread compaction

Layer / File(s) Summary
Define the client preference
packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts, apps/desktop/src/settings/DesktopClientSettings.test.ts
The client setting defaults to true and accepts an explicit false patch. Tests cover the setting, and the desktop settings fixture includes the default.
Configure and find the preference
apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/settingsSearch.ts, docs/user/providers-claude.md
General settings adds a switch and reset action. Restore behavior and search include the setting. The Claude provider guide explains how to start the Compact chip at Full.
Apply the default to thread state
apps/web/src/components/chat/ContextWindowMeter.logic.ts, apps/web/src/components/ChatView.tsx, apps/web/src/components/chat/ContextWindowMeter.logic.test.ts
ChatView resolves the chip state from a per-thread choice or the setting. Clearing a choice restores the default. Tests cover default resolution, overrides, clearing, and preserving map identity when unchanged.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: bil0000

Merge Risk: ⚪ Minimal · up to ffb69

The preference persists, and automatic compaction remains limited to eligible stale Claude threads. No actionable merge-blocking risk remains.

Security architecture risk: ⚪ Minimal · up to ffb69

The change adds a preference without expanding access or changing what compaction can do. Existing users retain the same default, explicit thread choices take precedence, and failed sends retain their choice. No material security risk introduced or worsened by this change was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed preference can influence eligible sends across threads in the same client, while each explicit chip override is isolated by environment and thread. The compared changes do not add a server operation, request destination, or broader credential authority.

Trust Boundaries and Controls

  • observed — The default is not a replacement for compaction eligibility checks. The existing provider, token threshold, timestamp, dismissal, availability, and send-mode conditions still gate the compaction path; an explicit Full choice prevents automatic compaction.

Resilience and Maintainability Implications

  • observed — Compaction and user-turn initiation remain separate steps. If compaction starts successfully but the user turn fails, the choice remains available for retry and the earlier compaction is not rolled back by this flow. This partial-failure behavior already existed at the PR base; the new default does not introduce the non-atomic sequence.
Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: users can configure whether the Compact chip starts on for stale Claude threads.
Description check Passed The description covers the problem, change, scope and approval rationale, and focused verification. It includes UI screenshots and states that an actual send was not checked.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@buzinas

buzinas commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@juliusmarminge @t3dotgg @maria-rcks focused PR to add a setting for a very annoying new default on compaction!

buzinas and others added 2 commits October 15, 2026 13:19
Add a "Compact stale threads by default" setting. It stays on by default.
When it's off, the Compact chip on a stale Claude thread starts at Full,
and the chip still switches for a single message. After a successful send,
the thread's chip goes back to the setting.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Move the per-thread chip choice into ContextWindowMeter.logic so the
default, a thread's own choice, and the reset after a send are tested.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant