Skip to content

fix(clients): ignore stale compaction after session stops - #129

Merged
rynfar merged 1 commit into
pylonfrom
fix/stale-compaction-composer
Aug 28, 2026
Merged

fix(clients): ignore stale compaction after session stops#129
rynfar merged 1 commit into
pylonfrom
fix/stale-compaction-composer

Conversation

@rynfar

@rynfar rynfar commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

A completed Prime Agent thread could become permanently unsendable after its session stopped. If the provider missed a compaction terminal event, the web composer kept treating the last persisted compacting activity as live even though no active session remained, so Send was disabled without a surfaced error.

Fix

Require an active, compaction-capable session scope before compaction state can block composer submission. The shared guard is used by web and mobile, and the regression test covers a stopped session with stale compacting activity.

Verification

  • vp test run packages/client-runtime/src/state/contextCompaction.test.ts (7/7)
  • vp run -F @t3tools/client-runtime typecheck
  • vp run -F @t3tools/web typecheck
  • vp run -F @t3tools/mobile typecheck
  • targeted vp lint on all four changed files
  • targeted vp fmt --check on all four changed files
  • git diff --check

Integrated browser evidence is pending explicit permission for browser use.

Implemented with GPT-5.6 Sol using the Prime Agent harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.3 KiB 13.3 KiB −4 B (−0.0%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB +6 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB −10 B (−0.2%) 7.8 KiB
Codex Live turn WebSocket decoded 55.5 KiB 55.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 9 9 0 (0.0%) 21
Claude Total thread wire 13.3 KiB 13.3 KiB −28 B (−0.2%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB +1 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB −29 B (−0.4%) 7.8 KiB
Claude Live turn WebSocket decoded 56.4 KiB 56.3 KiB −44 B (−0.1%) 66.4 KiB
Claude Live turn messages 10 9 −1 (−10.0%) 21

Baseline: 2b7a9b8 · PR result: 1b83337 · 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.

@rynfar
rynfar merged commit f9dd636 into pylon Aug 28, 2026
14 checks passed
@rynfar
rynfar deleted the fix/stale-compaction-composer branch August 28, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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