Skip to content

Restore the composer context window meter - #66

Merged
ziyadakl merged 1 commit into
custom-v2from
custom-restore-context-meter
Nov 11, 2026
Merged

ziyadakl merged 1 commit into
custom-v2from
custom-restore-context-meter

Conversation

@ziyadakl

Copy link
Copy Markdown
Owner

Summary

Brings back the composer's context window meter (the small pie chart left of the send button; click it to compact). Upstream removed it in pingdotgg#33131. It is always shown once the provider reports usage; the removed Labs toggle is not restored.

 ChatView
+  compactDisabledReason (computed again)
   <ChatComposer>
+    contextWindowEntries / LiveUsage / ProviderThread
+    compactDisabledReason
     <ComposerFooterPrimaryActions>
+      <ContextWindowMeter>   (apps/web/src/components/chat/ContextWindowMeter.tsx, fork feature)
+        click -> onCompactContext (existing compactThreadContextStable)
       <ComposerPrimaryActions>

Left alone: the Thread details card (Settings > Appearance > Thread details > Context window), plan mode, the legacy sidebar, and everything else pingdotgg#33131 removed.

Changes from the pre-removal meter:

  • Meter popup uses the current formatContextWindowCompactionMessage(threshold) (no model name), so the model-name helper and the loading placeholder are not restored.
  • formatContextWindowCost now lives inside the meter file; providerSupportsManualCompaction is exported again from compaction.logic.ts.

Evidence

  • Before: composer footer has no meter; only /compact compacts.
    After: meter renders when activeContextWindow exists; click calls the same compact action as /compact.
  • effect-tsgo tsrs --noEmit in apps/web: 0 errors.
  • vp test run --project unit compaction.logic.test.ts contextWindow.test.ts: 2 files, 13 tests passed.
  • vp fmt --check and vp lint on the 5 touched files: clean.
  • Not run: browser rendering check (no display on the server).

Merge Danger

Door: two-way

Revert the commit to remove the meter.

Blast Radius: personal

Fork only. Possible future upstream-sync conflicts in ChatComposer.tsx, ChatView.tsx and ComposerFooterControls.tsx; the diff is about 50 lines plus one new file.

🤖 Generated with Claude Code

Fork feature: upstream removed the meter in pingdotgg#33131. Always shown once the provider reports usage; click compacts the thread. The Thread details context window is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 11, 2026
@ziyadakl
ziyadakl merged commit 7701cc1 into custom-v2 Nov 11, 2026
30 checks passed
@ziyadakl
ziyadakl deleted the custom-restore-context-meter branch November 11, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 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