Skip to content

feat(claude): compact old threads before they burn through usage - #8144

Merged
t3dotgg merged 12 commits into
mainfrom
t3code/investigate-claude-usage-burn
Aug 25, 2026
Merged

t3dotgg merged 12 commits into
mainfrom
t3code/investigate-claude-usage-burn

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Claude threads can resume with hundreds of thousands of old context tokens and burn through usage before the user realizes it. T3 also did not show Claude Code's resume summary prompt or expose an easy compaction control.

This change matches Claude Code's 70-minute and 100,000-token resume conditions, supports its native resume dialog on web and mobile, adds /compact to provider command menus, and puts a compact action in the context meter. Claude provider settings can now set an earlier auto-compaction threshold without shrinking the 1M context window.

Before

Claude thread without an old-context warning

After

Claude thread with an old-context compaction prompt

Claude's native resume summary choices

Claude provider auto-compaction setting

Verified with 142 server tests, 61 contract tests, 26 web tests, and scoped type checks for server, web, mobile, desktop, contracts, and client runtime. Screenshots use synthetic Sonnet 5 conversations and contain no personal thread data.

Built by GPT-5.6 Sol in the Codex harness.


Note

Medium Risk
Touches Claude session start, resume dialogs, and user-input/approval cancellation paths; incorrect abort handling or compaction gating could affect live threads, but changes are covered by extensive adapter and UI tests.

Overview
Adds Claude context compaction end to end: a configurable Auto-compact after threshold (100000–1000000 tokens) on Claude provider settings, forwarded to the SDK as autoCompactWindow and reflected in thread usage as autoCompactThreshold.

The server Claude adapter wires Claude’s resume_return dialog through onUserDialog and the existing user-input flow (compact / keep history / don’t ask again), registers /compact in slash commands, and fixes abort races by settling AskUserQuestion and tool approval waits when the signal was already aborted before listeners attach. Ultrathink no longer prefixes single-token slash commands like /compact.

The web composer gains Compact context on the context meter and a “Resume with less context” banner when an old Claude session exceeds ~70 minutes and 100k tokens, with gating for drafts, busy state, and compatible Claude instances. Shared copy in @t3tools/shared/claudeCompaction keeps server prompts and client dismissal detection aligned.

Reviewed by Cursor Bugbot for commit dc39e20. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Claude context compaction UI, autoCompactWindow setting, and resume dialog support

  • Adds a 'Compact context' action to the context window meter and a 'Resume with less context' banner in ChatView.tsx; clicking either injects /compact into the composer via the new ChatComposerHandle.compactContext() method
  • Wires autoCompactWindow (100000–1000000 tokens) through settings.ts → ClaudeAdapter.ts → Claude query settings, and surfaces the threshold in ThreadTokenUsageSnapshot.autoCompactThreshold so the UI can display it
  • The Claude adapter now handles resume_return dialogs through the shared AskUserQuestion flow, returning compact | continue | never; the 'never' answer is shared via CLAUDE_RESUME_COMPACTION_NEVER_ANSWER in claudeCompaction.ts
  • Registers a built-in /compact slash command in ClaudeProvider.ts and fixes model.ts so ultrathink effort no longer prefixes slash commands like /compact, which would break them
  • Behavioral Change: AskUserQuestion and tool-approval flows in makeClaudeAdapter now immediately resolve as cancelled if the abort signal was already aborted before listener registration, preventing hangs; ChatComposerProps replaces activeThreadActivities with activeContextWindow — existing consumers must update

Macroscope summarized dc39e20.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af46b8d6-ea93-46eb-ad83-f81b058d3753

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 24, 2026
Comment thread apps/web/src/components/chat/ChatComposer.tsx
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.4 KiB 13.3 KiB −117 B (−0.9%) 15.1 KiB ✅
Codex Thread snapshot wire 6.9 KiB 6.9 KiB −4 B (−0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.4 KiB −113 B (−1.7%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 55.0 KiB 55.6 KiB +602 B (+1.1%) 66.4 KiB ✅
Codex Live turn messages 16 11 −5 (−31.3%) 21 ✅
Claude Total thread wire 13.4 KiB 13.4 KiB −95 B (−0.7%) 15.1 KiB ✅
Claude Thread snapshot wire 6.9 KiB 6.9 KiB +8 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −103 B (−1.5%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 55.8 KiB 56.4 KiB +620 B (+1.1%) 66.4 KiB ✅
Claude Live turn messages 16 11 −5 (−31.3%) 21 ✅

Baseline: 9996038 · PR result: dc39e20 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 109.4 KiB
  • Claude decoded thread snapshot: 110.1 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp macroscopeapp Bot left a comment

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.

One consistency finding in the changed web UI: the new resume-compaction notice is a hand-rolled banner inside the composer glass shell instead of the existing composer banner/drawer surface contract. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/components/chat/ContextWindowMeter.logic.ts
@macroscopeapp

macroscopeapp Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This introduces a cross-layer Claude compaction workflow, including SDK configuration, resume-session dialogs, new context-meter/banner controls, and slash-command behavior. The new user-facing flow and its effect on session processing warrant human review.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

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

@macroscopeapp macroscopeapp Bot left a comment

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.

UI consistency review of the web changes. The resume-compaction notice now uses the shared ComposerBannerStack contract, which resolves the earlier finding. Two smaller consistency/interaction points remain, both inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ContextWindowMeter.tsx Outdated
Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/components/chat/ContextWindowMeter.logic.ts Outdated
Comment thread apps/web/src/components/ChatView.tsx

@macroscopeapp macroscopeapp Bot left a comment

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.

One finding on the new compaction affordances: the shared compactDisabled flag silently deadens both new controls, which departs from how every neighbouring composer/banner action communicates an unavailable state. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/components/ChatView.tsx

@macroscopeapp macroscopeapp Bot left a comment

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.

One finding: the new composer draft-content gate re-implements a shared predicate instead of reusing it. The previously flagged hover-popover grace period (closeDelay) and the banner action's button treatment both look resolved.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx

@macroscopeapp macroscopeapp Bot left a comment

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.

Follow-up on the disabled-reason handling added in d803371: the reason is now delivered only through aria-label on a disabled Button. buttonVariants sets disabled:pointer-events-none and a disabled <button> is out of the tab order, so that name is unreachable by hover, focus, or AT — sighted users still see a dead control with no explanation — while it also overrides the visible label when the button is enabled. The repo already has a disabled-reason contract (DisabledReasonTooltip in RightPanelTabs.tsx, CloudLinkSwitch in ConnectionsSettings.tsx: Tooltip + TooltipTrigger render={<span className="inline-flex">…</span>}), and the sibling composer-banner actions encode state in visible text (Stopping..., Waking..., Restoring...). Two inline notes below.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/chat/ContextWindowMeter.tsx
Comment thread apps/web/src/components/ChatView.tsx Outdated

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d803371. Configure here.

Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/ChatView.tsx
Comment thread apps/web/src/components/ChatView.tsx
t3dotgg and others added 3 commits August 24, 2026 22:08
…ints

The web client detects the resume dialog's "Don't ask again" answer by
matching the question text, but the copy lived only in the adapter, so a
reword would silently break the detection. The question template and the
never-answer label now live in @t3tools/shared/claudeCompaction with a
test that formats and matches the same string.

Also: exempt every slash command from the ultrathink prefix instead of
only /compact, settle resume dialogs whose abort landed before the
listener was registered, toast instead of silently ignoring a compact
while a pasted image compresses, clear a stranded /compact draft when a
dispatch is blocked, track banner dismissals per thread instead of in
one slot, and scope the compaction docs to the clients that have each
control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the size:L 100-499 changed lines (additions + deletions). label Aug 25, 2026
juliusmarminge added a commit that referenced this pull request Sep 8, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 8, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
saphid pushed a commit to saphid/t3code that referenced this pull request Sep 8, 2026
…gg#8144)

The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 8, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 9, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
StiensWout added a commit to StiensWout/t3code that referenced this pull request Sep 9, 2026
The base branch now carries live context usage on provider turns
(tokenUsage, pingdotgg#8144) and the web meter reads it from the projection. Pi
kept a second owner for the same data: a contextUsage snapshot on the
provider thread, refreshed after terminalization and invalidated by hand
on rollback.

Read Pi's session stats while the turn settles and attach them to the
completed provider turn instead, then drop the provider-thread field and
its generation bookkeeping. A turn without usable stats simply carries no
report, so the meter keeps the last reported turn without adapter-side
retention logic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 10, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge pushed a commit to StiensWout/t3code that referenced this pull request Sep 10, 2026
The base branch now carries live context usage on provider turns
(tokenUsage, pingdotgg#8144) and the web meter reads it from the projection. Pi
kept a second owner for the same data: a contextUsage snapshot on the
provider thread, refreshed after terminalization and invalidated by hand
on rollback.

Read Pi's session stats while the turn settles and attach them to the
completed provider turn instead, then drop the provider-thread field and
its generation bookkeeping. A turn without usable stats simply carries no
report, so the meter keeps the last reported turn without adapter-side
retention logic.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 11, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 11, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 11, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 12, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 14, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 15, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 16, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 17, 2026
The v2 context meter could only show token counts after a compaction had
already happened — v2 had no live usage plumbing at all, so main's
compaction-threshold UX was invisible on v2 threads. Provider turns now
carry an optional tokenUsage report: the Codex adapter maps the
app-server's thread/tokenUsage/updated notification (total breakdown +
model context window) onto the active provider turn, ChatView picks the
newest report out of the projection, and the meter prefers it over the
compaction fallback — so usage and remaining-context percentages update
while the turn runs.

Claude's v2 adapter does not report usage yet; its meter falls back to
compaction items as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:XL 500-999 changed lines (additions + deletions). 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.

1 participant