Skip to content

bug: /compact is not interruptable #606

Closed

Description

@levabala

sometimes it's impossible to interrupt the /compact command

at 00:16 i'm spamming ESC:

2025-07-02.12-30-42.mov

and when the session is restored, the "working" state is still there and can't be escaped:

2025-07-02.12-31-46.mov

v0.1.174
macos 14.2.1
M1 Pro
auth via Claude Pro

Activity

  1. morgvanny commented on Jul 2, 2025

    @morgvanny

    Looking into this a bit, it seems the issue is that CompactSession spawns a goroutine to call the summarize API but doesn't use the context parameter or store a cancel function. The interrupt handler in tui.go calls a.app.Cancel() which only aborts the main session operations, not the compact operation running in its own goroutine. I think to make compact operations interruptable like regular session operations we'd need to:

    • Store a context.CancelFunc in the App struct when starting a compact operation
    • Pass a cancellable context to the Session.Summarize call
    • Have the interrupt handler also cancel this context if it exists
  2. added
    bugSomething isn't working
    and removed
    bugSomething isn't working
    on Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions