-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Handle cancelling/aborting while processing a turn #5543
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
Conversation
|
@codex review this |
| for window in input.windows(2) { | ||
| let current = &window[0]; | ||
| let next = &window[1]; | ||
| if current.get("type").and_then(|v| v.as_str()) == Some("function_call") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there some universally useful test helper we can add to make this and other tests more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into it.
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok when all the comments are processed. Not 100% convince by the design around the error but it will work
Currently we collect all all turn items in a vector, then we add it to the history on success. This result in losing those items on errors including aborting
ctrl+c.This PR:
Admittedly, this logic is an ad-hoc logic that doesn't handle a lot of error edge cases. The right thing to do is recording to the history on the spot as
items/tool calls outputcome. However, this isn't possible because of having differenttask_kindthat has differentconversation_histories. Thetry_run_turnhas no idea what thread are we using. We cannot also pass anarcto theconversation_historiesbecause it's a private element ofstate.That's said,
abortis the most common case and we should cover it until we removetask kind