Skip to content

Conversation

@JovialOptimist
Copy link
Collaborator

No description provided.

Press [ESC] twice in quick succession (500ms) to interrupt the AI at any point in its response. Currently does not save the conversation, but will. This is a better way to regain control compared to CTRL+C, and has historical backing in Claude Code.
Interrupting now saves the conversation. The only issue right now is that the displayed content is slightly desynchronized from the actual content (display lags behind actual AI content).
Displayed text and saved text during an interrupt now matches perfectly. Interrupting the AI is super fluid. You can do it at any point in its response. Last issue to fix is giving the user control immediately during an early interrupt (right now it still waits for input from AI).
A new polling method was added to handle early interrupts. Now early interrupts are handled as fast as regular ones.
Instead of explicitly approving or denying a tool call, users can press ESC to regain control of the conversation and type more content to the AI. This is good if you need to provide more context to the AI before a tool call is made, or if it is performing a bad tool call and you want to tell it so (like ending itself while trying to build cycod).

Right now, the chat-history is saved with an Assistant message that declares the function call was cancelled (`{"role":"assistant","content":"Function call cancelled by user - returning to conversation."}`), but this doesn't seem to carry the same "weight" (importance to the AI) as the actual function call returning this same information (like is done when the function is approved or denied). I'll be looking into this in the next commit.
Now cancelling the request outputs exactly like approve and deny, so it should be much clearer both to the AI and user what has happened.
Moved UserWantsControlException and function call decision enum inside ChatCommand for better encapsulation. Replaced CallDeniedMessage with CancelledFunctionResultMessage for clarity. Removed redundant cancellation tracking and streamlined function call completion logic.
Potential fix for TRX files. If className is null, dorny will be unable to parse. We need checks around that.
Refrains from polling for ESC (interrupts) while generating titles. This prevents the polling process from accidentally consuming valid input.
Previously there was a race condition between title generation and "waste time".
Removed polling-based implementation that cost lots of CPU, in favor of an event-based system.
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