Refactor context handling in Assistant's call method
- Removed the forced closure of the script context upon context cancellation in the call method, improving the handling of script execution and cancellation scenarios. - This change enhances the robustness of the Neo API assistant by preventing potential issues related to premature context termination, paving the way for more reliable assistant functionalities.
This commit is contained in:
parent
e874e8dfb4
commit
50faf7ed77
1 changed files with 0 additions and 3 deletions
|
|
@ -221,9 +221,6 @@ func (ast *Assistant) call(ctx context.Context, method string, context chatctx.C
|
|||
// Wait for either context cancellation or method completion
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
if scriptCtx != nil {
|
||||
scriptCtx.Close() // Force close the script context
|
||||
}
|
||||
return nil, ctx.Err()
|
||||
case <-done:
|
||||
return result, callErr
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue