Skip to content

feat(tui): show prompt after /compact to choose continue or branch#17868

Open
jwcrystal wants to merge 2 commits intoanomalyco:devfrom
jwcrystal:feat/compaction-prompt
Open

feat(tui): show prompt after /compact to choose continue or branch#17868
jwcrystal wants to merge 2 commits intoanomalyco:devfrom
jwcrystal:feat/compaction-prompt

Conversation

@jwcrystal
Copy link
Copy Markdown

Issue for this PR

Closes #17802

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After running /compact, show an inline prompt letting users choose:

  • Continue - Keep working in the current session
  • New Session - Start a new session with the compaction summary as context

This addresses the missing UX after compaction - users previously had no feedback on what happened or how to continue. Auto compaction continues silently without interruption.

How did you verify your code works?

  1. Run /compact manually → prompt appears
  2. Select Continue → prompt closes, continue in current session
  3. Select New Session → navigates to home with summary in prompt
  4. Trigger auto compaction → continues without prompt

Screenshots / recordings

◆ Context summarized
[Continue] [New Session]
⇆ select  enter confirm  esc dismiss

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

After compaction completes, show an inline prompt (similar to permission/question
prompts) with options to Continue in the current session or create a New Session
with the summary injected as initial context.

- Add CompactionPrompt component following the permission/question prompt pattern
- Listen to session.compacted event to trigger the prompt
- Save summary before dismissing to ensure it's available for new session
Auto compaction should continue automatically without interrupting the user.
Only show the prompt for manual /compact commands.
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #7824: feat: add /branch command to create new session with compacted context
#7824

This PR appears to be related because it also deals with creating a new session with compacted context. Your PR (17868) adds a prompt after /compact to let users choose between continuing in the current session or starting a new session with the compaction summary, which is related functionality.

However, PR #7824 is quite old and may have been merged already. You should verify if this functionality already exists or if your PR is building upon it.

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.

[FEATURE]: Show prompt after /compact to choose continue or branch

1 participant