Skip to content

feat(core): schedule provider compaction automatically - #47324

Merged
nexxeln merged 3 commits into
v2from
auto-native-compaction
Sep 7, 2026
Merged

nexxeln merged 3 commits into
v2from
auto-native-compaction

Conversation

@nexxeln

@nexxeln nexxeln commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Enable automatic provider compaction at the existing safe Session boundaries when provider mode is selected. Add optional positive threshold, clamped to the model's usable input ceiling; omitted thresholds use that ceiling. Like local scheduling, automatic provider scheduling needs a positive catalog context limit.
  • Keep compaction.auto: false authoritative for new automatic work while preserving installed native context. Wait for fresh primary usage after a native checkpoint before scheduling again.
  • Recover classified automatic context overflow through existing local compaction over the original durable history (SessionHistory.load(..., "local")). Do not fall back for authentication, rate limits, cancellation, arbitrary failures, or manual native errors.
  • Update configuration documentation and generated contracts.

Third layer of the Core provider-compaction stack.

Validation

  • Core suite via bun run test: 5,235 passed, 35 skipped; Core/Schema/Protocol/Server/Client/SDK/TUI/Session UI/UI typechecks passed.
  • Live end-to-end runs through an isolated V2 server (providers.openai.compaction: { mode: "provider", threshold: 10000 }, gpt-5.4-mini) with both an API-key connection and a ChatGPT credential: automatic compaction fired at the step boundary with reason: "auto" and an installed providerContext, the runner waited for a fresh usage anchor before compacting again, manual /compact worked on top of the installed window, and a fact from before the checkpoints was recalled afterwards. Server logs contained no warnings or errors.
  • Default HTTP/SSE transport was exercised throughout; the opt-in WebSocket channel is unchanged by this layer.

@nexxeln nexxeln changed the title auto native compaction feat(core): schedule provider compaction automatically Sep 4, 2026
@nexxeln
nexxeln force-pushed the auto-native-compaction branch from ca022cb to f80699f Compare September 7, 2026 12:15
@nexxeln
nexxeln force-pushed the auto-native-compaction branch from f80699f to b199818 Compare September 7, 2026 12:46
Base automatically changed from manual-native to v2 September 7, 2026 12:50
@nexxeln
nexxeln force-pushed the auto-native-compaction branch from b199818 to 6a03744 Compare September 7, 2026 13:23
@nexxeln
nexxeln merged commit 898692a into v2 Sep 7, 2026
12 of 13 checks passed
@nexxeln
nexxeln deleted the auto-native-compaction branch September 7, 2026 13:57
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