Skip to content

fix(compaction): align token events and presentation with upstream - #54

Merged
imsherrill merged 1 commit into
mainfrom
fix/upstream-compaction
Sep 11, 2026
Merged

imsherrill merged 1 commit into
mainfrom
fix/upstream-compaction

Conversation

@imsherrill

@imsherrill imsherrill commented Sep 11, 2026 •

Copy link
Copy Markdown

Compaction ran natively, but Compadre omitted upstream's token-count data path and used the completion separator for in-progress work. Align those pieces with upstream so future merges have less custom presentation to reconcile.

Port the optional before/after token fields, Claude boundary mapping, usage fallback, and summary formatting from upstream pingdotgg#9293. Reuse its working-row compaction label and pingdotgg#9623 folding behavior. Preserve the hosted durable action transport and immutable native-event replay; document the source commits and remaining differences.

Validation: 273 focused tests pass, including Claude events, server projection, native worker-to-central replay, command cancellation, and rendered timeline states. Web/server typechecks and targeted lint pass (one existing lint warning). Contracts typecheck reproduces the unchanged compadrePreviews.test.ts:9 Effect globalDate failure on the base worktree.

Rollout: the root web/server service auto-deploys. New/restored Modal workers pick up the updated fork; already-running workers and historical receipts retain their existing summaries. No controller changes, worker replacement, history rewrite, or unrelated event-delivery fix is included.

Browser verification: an isolated local Claude session completed native manual compaction and displayed Compacted context 31.9K → 5.31K tokens; the label persisted after reload. The native provider reported 31,948 before and 5,307 after. No hosted user threads were operated.

Before: generic completion label · After: native working status · After: native completion · Token-count layout fixture.

Implemented with GPT-5 in the Codex harness.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 13.5 KiB — 15.1 KiB ✅
Codex Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Codex Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Codex Live turn WebSocket decoded — 56.3 KiB — 66.4 KiB ✅
Codex Live turn messages — 9 — 21 ✅
Claude Total thread wire — 13.6 KiB — 15.1 KiB ✅
Claude Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Claude Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Claude Live turn WebSocket decoded — 57.2 KiB — 66.4 KiB ✅
Claude Live turn messages — 9 — 21 ✅

Baseline: unavailable · PR result: 3f87cb6 · Source CI: failure

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: 111.9 KiB
  • Claude decoded thread snapshot: 112.6 KiB

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

@imsherrill

Copy link
Copy Markdown
Author

Pre-merge verification: CI run 34555495168 reproduces main run 34553757656: Check has the same existing diagnostic rules/files (18 errors, 37 warnings), and Server 3 has exactly the same 15 ProviderCommandReactor failures. Server 3 otherwise passes 1052 tests. Test, Server 1/2, Rust, release smoke, native fingerprint, and thread-transfer budget checks pass. No review findings. Local native Claude compaction completed with the expected token-count separator and persisted after reload; screenshots are attached. No CI gates were changed or disabled.

@imsherrill
imsherrill merged commit 65adb01 into main Sep 11, 2026
14 of 16 checks passed
@imsherrill

Copy link
Copy Markdown
Author

Deployment verification: squash commit 65adb01 is live on compadre-web, Render deploy dep-dahmn5u7bikc73e938i0, finished 2026-09-11 02:52:32 UTC. New instance srv-da73c4p5efls738hsesg-qsxd7 reports Listening and server ready; PostgreSQL migrations completed with 0 applied. GET https://compadre.comprehensive.io/ returns HTTP 200 after the expected restart interruption. Authenticated native compaction and reload were verified in the isolated local Claude browser test documented above, not on a hosted user thread. Hosted browser acceptance remains user-owned; existing worker generations were not restarted, so token-count production verification requires a new/restored updated worker. The isolated dev server and evidence browser have been stopped; the implementation worktree is clean.

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.

1 participant