Emit a concise post‑Compact context message after manual Op::Compact

Resolved 💬 3 comments Opened Oct 20, 2025 by marcohefti Closed Dec 14, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Problem: After running manual compaction (Op::Compact), it is unclear what the next turn will "know."
Operators cannot easily confirm that prior user messages were aggregated and which summary the model will rely on.

Proposal: After a manual Op::Compact, emit a single concise AgentMessage that states what the next turn’s context includes. Do not emit this for inline auto-compaction (auto-compact-N) to avoid noise during automatic retries.

Suggested default message: Compact complete. Next turn context includes prior user messages and the following summary: {summary}

Optional richer message: Compact complete. Next turn context includes: prior user messages (trimmed); summary: {summary}; env: cwd={cwd}, approval={approval_policy}, sandbox={sandbox_policy}

Why this helps: Makes post-compaction behavior transparent, reduces confusion about context versus retained knowledge, and speeds up troubleshooting.

Additional information

Implementation notes: Use the compaction summary that already exists (summary_text) and emit the message immediately after history rewrite. Keep the existing "Compact task completed" message and insert the new message right before it. Suppress for inline auto-compaction by checking the sub-id prefix "auto-compact-". EnvironmentContext and user instructions are re-inserted automatically.

Non-goals: Do not change compaction semantics or bridge content; this is observability only. Do not emit the full bridge by default.

Acceptance criteria: After manual Op::Compact, exactly one informative AgentMessage is emitted with the compact template, including the compaction summary. No message is emitted for inline auto-compaction. No change to compaction logic or final model context.

View original on GitHub ↗

3 Comments

imajes · 10 months ago

that'd be awesome!

matssk · 9 months ago

Since the compaction message might be large,maybe by default just display the first few lines as a truncated message ending with ... then have some shortcut key to display/expand the full message.

etraut-openai contributor · 8 months ago

This feature request hasn't received any upvotes or additional posts in a while, so I'm going to close it.