Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

What

  • Adds a dedicated control-plane endpoint workspace.compactHistory to trigger compaction (instead of inserting /compact as user text).
  • Tracks compaction via session state (activeCompactionOperation), removing legacy history-scanning detection.
  • Hardens history replacement so it only happens on successful stream-end with a validated summary.
  • Replaces compaction history atomically via HistoryService.replaceHistory() (avoids “delete then crash” window).

Why

Auto-inserted /compact could be sent/queued as plain text and treated like a normal message. This makes compaction deterministic and removes ambiguity between UI display and backend execution.

Notes

  • Summary validation currently requires non-empty text with a minimum word threshold to avoid replacing history with truncated output.
  • Frontend force-compaction and idle-compaction are migrated to the new endpoint.

Generated with mux • Model: openai:gpt-5.2 • Thinking: high

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent ammar-agent force-pushed the fix/compaction-control-plane branch from c18578f to cf9d676 Compare December 21, 2025 23:33
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