Skip to content

fix: handle compaction boundaries without metadata#3452

Open
MattPua wants to merge 1 commit into
mainfrom
posthog-code/fix-compaction-metadata
Open

fix: handle compaction boundaries without metadata#3452
MattPua wants to merge 1 commit into
mainfrom
posthog-code/fix-compaction-metadata

Conversation

@MattPua

@MattPua MattPua commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

Codex emits _posthog/compact_boundary without Claude's optional trigger, preTokens, and contextSize metadata. The UI treated those fields as required, so Codex compactions rendered as Conversation compacted · undefined · ~NaNK tokens.

With Codex
CleanShot 2026-07-14 at 17 46 57@2x

Changes

  • Make compaction metadata optional through the conversation builder and render types.
  • Render only metadata that exists while preserving the existing detailed Claude output.
  • Share the compaction boundary types instead of repeating the payload shape.
  • Add coverage for metadata-free Codex boundaries and both UI label formats.

How did you test this?

  • pnpm --dir packages/ui exec vitest run src/features/sessions/components/session-update/CompactBoundaryView.test.ts src/features/sessions/components/buildConversationItems.test.ts
  • pnpm --filter @posthog/ui typecheck
  • Commit hook: pnpm typecheck
  • Biome checks on touched files

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 7f369b7a-64cf-4bac-8653-4061a42237c6
@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found 2 issues in 1 file · 2 warnings.

2 warnings

src/features/sessions/components/session-update/CompactBoundaryView.tsx

Reviewed by React Doctor for commit 4cb16f2.

@MattPua MattPua marked this pull request as ready for review July 14, 2026 21:47
@MattPua MattPua marked this pull request as draft July 14, 2026 21:47
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix: handle compaction boundaries withou..." | Re-trigger Greptile

@MattPua MattPua marked this pull request as ready for review July 15, 2026 15:56
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "fix: handle compaction boundaries withou..." | Re-trigger Greptile

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.

1 participant