Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix streaming output corruption with copilot#1261

Merged
jhrozek merged 3 commits into
mainstacklok/codegate:mainfrom
copilot_secrets_out_bugstacklok/codegate:copilot_secrets_out_bugCopy head branch name to clipboard
Mar 14, 2025
Merged

Fix streaming output corruption with copilot#1261
jhrozek merged 3 commits into
mainstacklok/codegate:mainfrom
copilot_secrets_out_bugstacklok/codegate:copilot_secrets_out_bugCopy head branch name to clipboard

Conversation

@jhrozek

@jhrozek jhrozek commented Mar 10, 2025

Copy link
Copy Markdown
Contributor
  • Shortcut other steps if one holds the output - We had a bug in the output pipeline where if one step returned [] meaning that the output chunk should be held off, all the current chunks would continue to run and potentially modify the context.
  • Shortcut buffered PII sooner, as soon as the buffer can't be a UUID - Our PII refaction format is #UUID#. Our code was finding an opening #, then checking for a closing matching # or end of the output. For copilot, however, this meant that we were buffering the whole file, because the filename comes in this format:
# filepath: /Users/jakub/devel/demo-repo-python/app.py

This means we would keep searching for the closing hash which never
came. Instead, buffer only as long as the context between the hashes can
reasonably be a UUID.

Fixes: #1250

@jhrozek

jhrozek commented Mar 10, 2025

Copy link
Copy Markdown
Contributor Author

@blkt I can rebase this atop replace-litellm if you prefer

JAORMX
JAORMX previously approved these changes Mar 11, 2025
jhrozek added 2 commits March 12, 2025 22:31
We had a bug in the output pipeline where if one step returned []
meaning that the output chunk should be held off, all the current chunks
would continue to run and potentially modify the context.
Our PII refaction format is `#UUID#`. Our code was finding an opening #,
then checking for a closing matching # or end of the output. For
copilot, however, this meant that we were buffering the whole file,
because the filename comes in this format:

```
```

This means we would keep searching for the closing hash which never
came. Instead, buffer only as long as the context between the hashes can
reasonably be a UUID.

Fixes: #1250
@jhrozek

jhrozek commented Mar 12, 2025

Copy link
Copy Markdown
Contributor Author

just rebased atop Rado's test fix

@jhrozek jhrozek merged commit de09cad into main Mar 14, 2025
@jhrozek jhrozek deleted the copilot_secrets_out_bug branch March 14, 2025 08:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codegate garbles output on main

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.