Fix log spamming for custom sagemaker [DONE] chunk in streams

This commit is contained in:
Thomas Werkmeister 2026-06-29 12:07:55 +02:00 • committed by GitHub
parent 8e30cfbeb1
commit 9cffbdb1ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -173,7 +173,11 @@ class AWSEventStreamDecoder:
except Exception as e:
verbose_logger.error(f"Error parsing message: {e}. Attempting to combine with next event.")
continue
# remove custom sagemaker [DONE] message in stream
if accumulated_json.endswith("[DONE]"):
accumulated_json = accumulated_json[:-6].strip()
# Handle any remaining data after the iterator is exhausted
if accumulated_json:
try: