Problem
After auto-compaction, the agent immediately continues execution based on the compaction summary. There is no opportunity for the user to intervene or provide guidance before the agent acts.
Current Behavior
- Context window fills up
- Auto-compaction triggers
- Summary is generated and injected as the first message
- Agent immediately acts on summary (e.g., executes "Next Steps" from the summary)
- User has no chance to redirect or confirm
The Issue
The agent treats the compaction summary as an implicit instruction to continue. If the summary contains something like "Next Steps: Set up OAuth", the agent may immediately start executing that task — even though:
- The user may not want that task done right now
- The agent skipped reading workspace boot files (AGENTS.md, BOOT.md, SOUL.md)
- The "Next Steps" were meant as a record, not as an immediate command
This creates a control gap: the user loses the ability to guide the agent's first action after compaction.
Proposed Solution
Add a config option to pause after compaction and wait for user input:
{
"compaction": {
"pauseAfterCompaction": true,
"pauseMessage": "Context was compacted. Awaiting your instruction before continuing."
}
}
When pauseAfterCompaction is enabled:
- Compaction completes
- Agent sends
pauseMessage to the user
- Agent waits for the next user message before taking any action
- User can then provide direction ("Read BOOT.md first", "Continue with X", etc.)
Alternative: Gate Mechanism
Another approach (related to #19148):
{
"compaction": {
"postCompactionMessage": "Before any action, read BOOT.md and output BOOT ACK to confirm.",
"requireAckBeforeAction": true
}
}
This would inject instructions and optionally block tool execution until acknowledgment.
Why This Matters
- User control: Compaction is a significant context change; users should be able to guide the agent's recovery
- Safety: Prevents unintended autonomous actions based on stale "Next Steps"
- Workflow compatibility: Agents with boot sequences need to read files before acting
Related Issues
Workaround Attempted
We tried using before_agent_start hooks with prependContext to inject boot instructions, but the agent's training default is to process the summary first, often skipping the injected content. A runtime-level pause would be more reliable.
Happy to provide more details or help test.
Problem
After auto-compaction, the agent immediately continues execution based on the compaction summary. There is no opportunity for the user to intervene or provide guidance before the agent acts.
Current Behavior
The Issue
The agent treats the compaction summary as an implicit instruction to continue. If the summary contains something like "Next Steps: Set up OAuth", the agent may immediately start executing that task — even though:
This creates a control gap: the user loses the ability to guide the agent's first action after compaction.
Proposed Solution
Add a config option to pause after compaction and wait for user input:
{ "compaction": { "pauseAfterCompaction": true, "pauseMessage": "Context was compacted. Awaiting your instruction before continuing." } }When
pauseAfterCompactionis enabled:pauseMessageto the userAlternative: Gate Mechanism
Another approach (related to #19148):
{ "compaction": { "postCompactionMessage": "Before any action, read BOOT.md and output BOOT ACK to confirm.", "requireAckBeforeAction": true } }This would inject instructions and optionally block tool execution until acknowledgment.
Why This Matters
Related Issues
Workaround Attempted
We tried using
before_agent_starthooks withprependContextto inject boot instructions, but the agent's training default is to process the summary first, often skipping the injected content. A runtime-level pause would be more reliable.Happy to provide more details or help test.