Skip to content

fix: handle compaction boundaries without metadata#3452

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/fix-compaction-metadata
Jul 22, 2026
Merged

fix: handle compaction boundaries without metadata#3452
trunk-io[bot] merged 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

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 14, 2026

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 ddf618d.

@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

@MattPua
MattPua requested a review from a team July 17, 2026 13:44
Generated-By: PostHog Code
Task-Id: 7f369b7a-64cf-4bac-8653-4061a42237c6
@MattPua
MattPua force-pushed the posthog-code/fix-compaction-metadata branch from 2d168dd to ddf618d Compare July 22, 2026 14:18
@MattPua MattPua added the Stamphog This will request an autostamp by stamphog on small changes label Jul 22, 2026 — with PostHog

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Contained UI fix making compaction-boundary metadata optional so Codex's boundary events render correctly; diff matches the description, includes new tests, and touches no risky territory.

  • Author wrote 0% of the modified lines and has 11 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 127L, 4F substantive, 210L/6F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (210L, 6F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ cf1c82e · reviewed head ddf618d

@trunk-io
trunk-io Bot merged commit f39769c into main Jul 22, 2026
39 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/fix-compaction-metadata branch July 22, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant