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

Commit 9555a03

Browse files
authored
Fix copilot secret unredaction (#1108)
The copilot provider always sends `cleanup_sensitive` set to `False` as it manages the context itself. On streams where `finish_stream` was set to `False` as well, we would have yielded the rest of the context buffer though which would break secret unredaction. To reproduce, ask Copilot to make a simple modification in a file containing secrets so that it's forced to print the secrets back to you.
1 parent 4abe98a commit 9555a03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/codegate/pipeline/output.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ async def process_stream(
170170
finally:
171171
# NOTE: Don't use await in finally block, it will break the stream
172172
# Don't flush the buffer if we assume we'll call the pipeline again
173-
if cleanup_sensitive is False and finish_stream:
174-
self._record_to_db()
173+
if cleanup_sensitive is False:
174+
if finish_stream:
175+
self._record_to_db()
175176
return
176177

177178
# Process any remaining content in buffer when stream ends

0 commit comments

Comments
 (0)