Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Conversation

@fiam
Copy link
Contributor

@fiam fiam commented Aug 28, 2025

When a chat request is ongoing, allow pressing Ctrl+C to interrupt
just that single chat request, without exiting the app, and print
a message indicating that Ctrl+C can be used again to exit the app.

To accomplish this, update all desktop/ functions to take a context.Context,
and then implement a cancellable chat function that uses signal.NotifyContext()
to handle the interrupt signal.

Intercept only os.Interrupt, which Ctrl+C is mapped to and is available
on all the supposed OSes, including Windows.

Signed-off-by: Alberto Garcia Hierro damaso.hierro@docker.com

@fiam
Copy link
Contributor Author

fiam commented Aug 28, 2025

This needs to be rebased on top of #144 rebased on main to allow merging this one before the other one. Sample output:

image

When a chat request is ongoing, allow pressing Ctrl+C to interrupt
just that single chat request, without exiting the app, and print
a message indicating that Ctrl+C can be used again to exit the app.

To accomplish this, update all desktop/ functions to take a context.Context,
and then implement a cancellable chat function that uses signal.NotifyContext()
to handle the interrupt signal.

Intercept only os.Interrupt, which Ctrl+C is mapped to and is available
on all the supposed OSes, including Windows.

Signed-off-by: Alberto Garcia Hierro <damaso.hierro@docker.com>
@fiam fiam force-pushed the chat-llm-cancel branch from 823745f to dca5524 Compare August 29, 2025 09:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant