Conversation
Generated with [Devin](https://devin.ai)
Generated with [Devin](https://devin.ai)
Codex dispatches thread/compact/start through the pinned app-server client and Claude sends provider-native /compact between turns, both behind a durable session.compact command bound to the session's exact authority generation. Provider facts project to one bounded compaction timeline event (outcome, trigger, strategy, token counts only), and an indeterminate dispatch reconciles against the retained event stream rather than replaying. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A durable per-session session_compact_policies row (schema v61, STRICT table, cascade FK, default-off seed trigger, monotonic-revision transition guard, delete guard, backfill) backs the new session.compact-policy get/set contract and CLI surface with revision CAS. After a token_usage event is durable, the pure evaluateAutoCompact decision (trigger capped by model context window, in-flight turn and minimum-interval suppression) can schedule the existing durable session.compact under the session serializer with trigger "policy" and a deterministic per-usage-bucket idempotency key, so a second observation in the same bucket replays the command instead of dispatching twice. The serialized closure re-evaluates fresh policy, interval, and turn state before dispatch, and beginEffect re-fences the turn check so a refused attempt stays prepared and retryable without burning the key or the interval budget. Docs record the verified provider compaction contract for Codex and Claude, the public command reference matches CLI help, and the reviewed release inventory and public-text allowlist were refreshed for the new shipped module and main's new public dependencies. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
4 tasks
Member
Author
|
Superseded by #252: the same feature ported onto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
5501d83a): provider-neutralsession.compact— Codex dispatchesthread/compact/startthrough the pinned app-server client, Claude writes/compacton the stream-json input; both reduce to one durablecompactiontimeline event (outcome/trigger/strategy/token fields only, no text), receipted before dispatch, idempotent by key, refused mid-turn, and reconciled against the event stream without replay.604e435c): opt-in per-session auto-compaction. Schema v61 addssession_compact_policies(STRICT, cascade FK, default-off seed trigger, monotonic-revision transition guard, delete guard, backfill).session.compact-policy get/setexposes it with revision CAS; CLI grammaroompa session compact-policy <session> on|off [--trigger-tokens 20000..4000000] [--min-interval-ms 30000..86400000] [--expected-revision n]. After a durabletoken_usageevent,evaluateAutoCompact(pure, total, property-tested) can schedulesession.compactunder the session serializer withtrigger: "policy"and a deterministic per-bucket idempotency key — exactly one dispatch per usage bucket; the serialized closure re-evaluates fresh policy/interval/turn state before dispatch.enabled: false,triggerTokens: 250_000,minIntervalMs: 300_000— compacting at 250k instead of provider-default ~1M roughly halves the average context cost.docs/providers/codex.md(new) anddocs/providers/claude.mdrecord the verified provider compaction contracts;site/content.tscommand reference matches CLI help; plankb/plans/session-compaction.mdis complete with full evidence.Test plan
bun run check— every step green on the final tree: install-pins, effect-architecture, security-primitives (baseline refreshed for two reviewed new call sites), eslint, tsc; scripts 1795/1795, local-efficiency plugin 119/119, cloud-efficiency plugin 36/36,bun test ./src6114 pass (4 five-second timeouts from machine load ~20, each verified green in isolation), convex 329/329, site 176/176, app 625/625;build:site -- --check,build:app,buildclean;check:packagegreen on a governed-ref checkout (history scan + refreshed 225-entry release inventory).Note: this targets
claude/oompa-v0.8.0, the line the worktree was cut from. When that line next converges tomain(currently itself at schema 61 via #225), this migration renumbers to the next free version.Generated with Devin