mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(copilot): exclude heartbeat events from _events_yielded retry guard
StreamHeartbeat events are non-substantive keep-alive signals that clients ignore. Counting them in _events_yielded incorrectly prevented the retry-with-compaction logic from running when a tool call took longer than 10 seconds before a prompt-too-long error.
This commit is contained in:
@@ -1519,7 +1519,8 @@ async def stream_chat_completion_sdk(
|
||||
|
||||
try:
|
||||
async for event in _run_stream_attempt(state):
|
||||
_events_yielded += 1
|
||||
if not isinstance(event, StreamHeartbeat):
|
||||
_events_yielded += 1
|
||||
yield event
|
||||
break # Stream completed — exit retry loop
|
||||
except asyncio.CancelledError:
|
||||
|
||||
Reference in New Issue
Block a user