Skip to content

Feature request: Option to pause after compaction and wait for user confirmation before agent continues #21821

@Crispian0129

Description

@Crispian0129

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

  1. Context window fills up
  2. Auto-compaction triggers
  3. Summary is generated and injected as the first message
  4. Agent immediately acts on summary (e.g., executes "Next Steps" from the summary)
  5. 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:

  1. Compaction completes
  2. Agent sends pauseMessage to the user
  3. Agent waits for the next user message before taking any action
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions