Skip to content

Customize compaction behavior - #3439

Open
ckelly17 wants to merge 22 commits into
devfrom
ck-force-compact
Open

Customize compaction behavior#3439
ckelly17 wants to merge 22 commits into
devfrom
ck-force-compact

Conversation

@ckelly17

@ckelly17 ckelly17 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Compaction Options picker to the token-counter popover in the chat input bar, letting users choose how the conversation is compacted before triggering it manually
  • The default strategy is theme-configurable via defaultCompactionStrategy ("SUMMARY" | "TOOL_PRUNE" | "AUTO") and initializes the picker on room load
  • Strategies are exposed under a collapsible Compaction Options section with labeled radio buttons and info tooltips explaining each approach; the top-level Compact button triggers compaction immediately with the selected strategy

What's included

  • CompactStrategyPicker inline component in room-input.tsx — single Compact button + collapsible strategy radio group
  • compactionStrategy state in room-content.tsx seeded from root.theme.defaultCompactionStrategy
  • compactMessages(strategy?) in room.store.ts passes the chosen strategy to the pixel (compactionTypes=["<strategy>"]); omits the param when strategy is AUTO
  • defaultCompactionStrategy wired through ThemeMaproot.store.ts → component state

Test plan

  • Open a room; token counter appears when tokens are in use
  • Hover the token pie chart — popover opens with a Compact button and collapsed Compaction Options
  • Expand Compaction Options — three radio buttons (Summarize, Prune Tools, Auto) with tooltip icons
  • Select a strategy, click Compact — toast confirms success; conversation is compacted with the chosen method
  • Set defaultCompactionStrategy: "TOOL_PRUNE" in theme.local.json, restart dev server — picker initializes to Prune Tools
  • Verify send button and chat input are never disabled or replaced due to token usage
image image

@ckelly17
ckelly17 requested a review from a team as a code owner July 16, 2026 18:32
@snyk-io

snyk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ckelly17
ckelly17 marked this pull request as draft July 16, 2026 18:52
@ckelly17 ckelly17 changed the title feat: force auto compaction with custom behavior Customize compaction behavior Jul 20, 2026
@ckelly17
ckelly17 marked this pull request as ready for review July 29, 2026 18:56
@tevanburen

Copy link
Copy Markdown
Contributor

Waiting on #3528 and #3529 btw

Comment thread libs/i18n/src/resources/locales/ar/playground/room.json
Comment thread libs/shared/src/types.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also add to the theme map editor page in /client

@tevanburen tevanburen self-assigned this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants