-
Notifications
You must be signed in to change notification settings - Fork 297
feat: add ability to gracefully stop runs #950
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
Merged
Merged
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
ebf7269
to
34e46fd
Compare
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.
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
pkg/sdkserver/routes.go:96
- Breaking out of the event loop on receiving a run-finish event may leave subsequent events unprocessed. Consider ensuring that remaining events are either drained or that the behavior is properly documented.
if e.Type == runner.EventTypeRunFinish { break }
pkg/openai/client.go:606
- [nitpick] Cancellation errors are being suppressed by setting err to nil when context.Canceled is detected. Verify that this behavior is intended so that genuine errors are not inadvertently hidden.
if errors.Is(err, context.Canceled) { err = nil }
pkg/engine/openapi.go:148
- The update from using the ptr helper (i.e. ptr(result)) to directly taking the address of result should be reviewed to ensure it remains consistent with other parts of the code and preserves the intended behavior.
Result: &result,
pkg/runner/runner.go:674
- [nitpick] The removal of the explicit copy of subCall.State (previously done via subState := *subCall.State) in favor of directly using WithResumeInput may introduce side effects related to state mutability. Confirm that this change correctly propagates the resume input without unintended modifications.
result, err := r.subCallResume(callCtx.Ctx, callCtx, monitor, env, subCall.ToolID, subCall.CallID, subCall.State.WithResumeInput(state.ResumeInput), toolCategory)
111a581
to
aed22fe
Compare
aed22fe
to
0e6087d
Compare
Various parts of a tool execution cannot be stopped gracefully. For example, non-streamed HTTP request can't be stopped gracefully. However, commands and chat completions can be gracefully stopped by a user and the result returned. An "ABORTED BY USER" message is added to such messages. Additionally, aborted chat completion responses are not stored in the cache. Signed-off-by: Donnie Adams <[email protected]>
0e6087d
to
4dcef31
Compare
StrongMonkey
approved these changes
Feb 24, 2025
njhale
approved these changes
Feb 24, 2025
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.
Various parts of a tool execution cannot be stopped gracefully. For example,
non-streamed HTTP request can't be stopped gracefully. However, commands and
chat completions can be gracefully stopped by a user and the result returned.
An "ABORTED BY USER" message is added to such messages. Additionally, aborted
chat completion responses are not stored in the cache.
Signed-off-by: Donnie Adams [email protected]