-
-
Notifications
You must be signed in to change notification settings - Fork 214
fix: remove extraneous data:
from streaming responses
#49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Streaming responses contain "data: data:" which breaks openAI compatibility as described in Michael-A-Kuykendall#26. Fix it by removing the extra data: call.
data:
from streaming responses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes OpenAI API compatibility issues by removing duplicate "data:" prefixes from Server-Sent Events (SSE) streaming responses, addressing issue #26.
Key Changes
- Removes extraneous "data:" prefix and newlines from streaming token responses
- Simplifies the "[DONE]" sentinel message format
- Updates both initial chunk, token chunks, and final chunk formatting
"data: {}\n\n", | ||
serde_json::to_string(&initial_chunk).unwrap() | ||
)); | ||
let _ = tx_tokens.send(serde_json::to_string(&initial_chunk).unwrap()); |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SSE format requires 'data: ' prefix and double newlines for proper client parsing. Removing these breaks SSE protocol compliance. The format should be 'data: {json}\n\n' for each event.
Copilot uses AI. Check for mistakes.
"data: {}\n\n", | ||
serde_json::to_string(&chunk).unwrap() | ||
)); | ||
let _ = tx_tokens.send(serde_json::to_string(&chunk).unwrap()); |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Token chunks must follow SSE format with 'data: ' prefix and proper line endings. Raw JSON strings without SSE formatting will not be parsed correctly by SSE clients.
Copilot uses AI. Check for mistakes.
let _ = tx.send(serde_json::to_string(&final_chunk).unwrap()); | ||
let _ = tx.send("[DONE]".to_string()); |
Copilot
AI
Sep 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both the final chunk and [DONE] sentinel need proper SSE formatting. They should be 'data: {json}\n\n' and 'data: [DONE]\n\n' respectively to maintain SSE protocol compliance.
Copilot uses AI. Check for mistakes.
Hi @qlyoung, Thank you for taking the time to identify and propose a fix for the OpenAI compatibility issue. I appreciate your attention to the technical details and the clear description of the problem. However, I need to respectfully decline this PR due to several governance and process requirements that weren't followed. Shimmy operates under strict development standards to maintain quality and consistency: Technical Process Requirements Not Met:
Current Project Governance:Shimmy is currently maintained under a lead maintainer model where I maintain sole merge authority to ensure consistent project direction during this critical growth phase. Repository Access Update:I've now implemented stricter branch protection rules to prevent unauthorized PRs going forward. This should have been in place from the start. How to Contribute Going Forward:
About the Bug Fix:The SSE formatting issue you've identified appears valid and needs addressing. I'll handle implementing the fix following our internal development process, including full test coverage and constitutional compliance. Your technical insight is valuable, and I encourage you to continue reporting issues you discover. Thanks for your help! |
@Michael-A-Kuykendall As I pointed out in my PR description:
Your tests don't even compile on your main branch:
I see you noticed this also:
There is not a single commit in this repo that has a DCO:
It makes no sense to ask these things of your contributors when your own code doesn't even follow these standards. In any case, I don't really care if this PR is merged or not, I just want the bug fixed. And again, I didn't find or describe this bug. It's the same bug in #26 that you declared you had committed a fix for, without actually doing it. |
- Fix SSE streaming data: data: bug (remove duplicate prefixes) - Fix broken test compilation (add missing serde derives, public methods) - Apply cargo fmt to resolve all formatting issues - Fix all clippy warnings: - Remove redundant template logic in model registry - Fix field assignment patterns in telemetry config - Convert assert!(true) to meaningful comments - Fix doc comment spacing issues - Remove unused self parameter in recursive function - Configure DCO sign-off for all future commits - Maintain constitutional compliance (lightweight binary, test coverage) Addresses issues raised in PR #49 and #26. All tests now compile and code quality standards are enforced consistently. Signed-off-by: Mike Kuykendall <[email protected]>
Fixed in commit 09744c2. You were right about all the governance issues - tests, clippy warnings, DCO, formatting. All cleaned up now. The SSE bug is also properly fixed. Thanks! |
- Fix SSE streaming data: data: bug (remove duplicate prefixes) - Fix broken test compilation (add missing serde derives, public methods) - Apply cargo fmt to resolve all formatting issues - Fix all clippy warnings: - Remove redundant template logic in model registry - Fix field assignment patterns in telemetry config - Convert assert!(true) to meaningful comments - Fix doc comment spacing issues - Remove unused self parameter in recursive function - Configure DCO sign-off for all future commits - Maintain constitutional compliance (lightweight binary, test coverage) Addresses issues raised in PR #49 and #26. All tests now compile and code quality standards are enforced consistently. Signed-off-by: Mike Kuykendall <[email protected]>
Description
Streaming responses contain
data: data:
which breaks OpenAI compatibility asdescribed in #26. Fix it by removing the extra
data:
.While there is a (double-posted) comment in #26 claiming that the fix was committed, there's no reference to a corresponding PR or commit, and I don't see any change in the tree.
Type of Change
Shimmy Philosophy Compliance
Testing
cargo test
and all tests passThe tests don't compile on
main
.cargo clippy
with no warningsThere are 13 warnings on
main
.cargo fmt
cargo fmt
produces a large number of whitespace changes onmain
.Legal Compliance
git commit -s
)No commits on the main branch have a DCO on them, this doesn't appear to be current practice at all.
Binary Size Impact
No
Skipped all these.
Enterprise Considerations
Community Impact
New binary size: ___ MB
Change: ± ___ MB
Checklist
Additional Notes
Any additional information or context for reviewers.