mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend/copilot): set skip_transcript_upload before await delete
Move flag assignment before the await to prevent re-upload if cancellation interrupts delete_transcript.
This commit is contained in:
@@ -1059,6 +1059,9 @@ async def stream_chat_completion_sdk(
|
||||
and use_resume
|
||||
and user_id
|
||||
):
|
||||
# Set before await so cancellation during delete
|
||||
# cannot allow re-upload of an oversized transcript.
|
||||
skip_transcript_upload = True
|
||||
logger.warning(
|
||||
"%s Prompt too long with --resume — deleting "
|
||||
"oversized transcript for session %s",
|
||||
@@ -1073,9 +1076,6 @@ async def stream_chat_completion_sdk(
|
||||
log_prefix,
|
||||
del_err,
|
||||
)
|
||||
# Prevent the finally block from re-uploading the
|
||||
# same oversized transcript.
|
||||
skip_transcript_upload = True
|
||||
|
||||
yield StreamError(
|
||||
errorText=f"SDK stream error: {stream_err}",
|
||||
|
||||
Reference in New Issue
Block a user