Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit d455728

Browse files
committed
Don't flush the buffer and the sensitive data if we're reusing the output pipeline
Since we can reuse a single pipeline for multiple request-reply round trips, we shouldn't flush the buffer and destroy the context.
1 parent 380ec74 commit d455728

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/codegate/pipeline/output.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ async def process_stream(
160160
logger.error(f"Error processing stream: {e}")
161161
raise e
162162
finally:
163+
# Don't flush the buffer if we assume we'll call the pipeline again
164+
if cleanup_sensitive is False:
165+
return
166+
163167
# Process any remaining content in buffer when stream ends
164168
if self._context.buffer:
165169
final_content = "".join(self._context.buffer)

0 commit comments

Comments
 (0)