Skip to content

Conversation

@adolfousier
Copy link

fix: issue that wasn't allowing users to cancel immediately, allowing users to stop request instantly to give further instructions

  • Add AbortedSessions map to track aborted sessions
  • Ignore SSE events for aborted sessions to stop UI streaming
  • Mark last assistant message as completed on abort
  • Clear aborted flag when starting new operations to allow subsequent requests

This fix ensures cancellation works properly.

adolfousier and others added 2 commits October 19, 2025 13:19
- Add AbortedSessions map to track aborted sessions
- Ignore SSE events for aborted sessions to stop UI streaming
- Mark last assistant message as completed on abort
- Clear aborted flag when starting new operations to allow subsequent requests

This fix ensures cancellation works properly.
@rekram1-node
Copy link
Collaborator

@adolfousier this does change some other things, for example now I don't see:

The operation was aborted.

Is the intention to change a bunch of visuals too? or just to make double esc happen faster?

@adolfousier
Copy link
Author

adolfousier commented Oct 20, 2025

To clarify, the issue was not about faster or slower, the escape wasn't stopping all operations at all. I commented this issue here two weeks ago: #1418 (comment)

No, the intent wasn't visual changes. The main intent was fix the 'esc' to stop all operations instantly, because it wasn't on my mac or my Ubuntu machines, it do works sometimes but most of the times it keeps streaming and won't stop till the end of stream. Which is very frustrating to the user as they are hopeless waiting the stream finish.

That fix, do stop anything, any machine, any operation, immediately. If user 'esc' twice(fast or slow) its to stop operations no matter what, it does just that, as expected by the user.

I did not noticed the 'The operation was aborted.' wasn't visible,

@adolfousier
Copy link
Author

adolfousier commented Oct 20, 2025

@adolfousier this does change some other things, for example now I don't see:

The operation was aborted.

Is the intention to change a bunch of visuals too? or just to make double esc happen faster?

I've the fix to restore the aborted message, shall I push it or how do you prefer to move on with this fix? It's a single, minimal fix to restore the abort message display but keeping the consistent cancellation.

Screenshot From 2025-10-20 18-49-43

Thank you

@rekram1-node
Copy link
Collaborator

rekram1-node commented Oct 20, 2025

sure go ahead and push it, there is something to what you are getting at with a delay in esc twice, and yours does seem faster

@adolfousier
Copy link
Author

adolfousier commented Oct 20, 2025

sure go ahead and push it, there is something to what you are getting at with a delay in esc twice, and yours does seem faster

Done, hope everything is fine and to keep contributing, thank you @rekram1-node

@rekram1-node
Copy link
Collaborator

ill take a look at it tmr for u

adolfousier and others added 4 commits October 21, 2025 07:13
- tui.go: ESC double-press with 1s timeout, consistent debounce behavior
- textarea.go: cache reset for memory management during active typing
- app.go: AbortedSessions tracking + enhanced Cancel method (already present)
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.

2 participants