-
Notifications
You must be signed in to change notification settings - Fork 4
Interrupt gracefully #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
JovialOptimist
wants to merge
21
commits into
master
Choose a base branch
from
interrupt-gracefully
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
e578c7f to
f72c254
Compare
Potential fix for TRX files. If className is null, dorny will be unable to parse. We need checks around that.
This reverts commit f0f28f8.
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".
This reverts commit 7245aff.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.