docs(gateway): drop the stale "cross-protocol streaming -> 400" claims - #181
Merged
Conversation
Two module-header doc comments still described the pre-P3-B state, in which streaming requests were restricted to same-protocol passthrough and any cross-protocol streaming request failed with 400. That restriction no longer exists. 6095ef0 (P3-B) deleted the key filter that enforced it in forward_stream, added src/sse.rs with the protocol-pair SSE converters, and updated that function's own doc comment plus README -- but left the gateway module header behind. The same tree therefore carried two contradicting claims: README.md:12 "非流式 + SSE 流式全支持" src/gateway.rs:13 "跨协议 -> 400 明确报错" Only one protocol pair remains unimplemented (responses upstream -> anthropic client), which forward_stream returns 400 for explicitly. Neither comment is replaced with a snapshot of the current coverage: a comment asserting "X is not yet supported" rots as soon as X ships, and it is the implementation's own success that invalidates it. Both now state the invariant (streaming requests are converted cross-protocol too) and point at the authority for the converter list, so a future pair being added or removed cannot contradict the header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two module-header doc comments still described the pre-P3-B state, in which streaming requests were restricted to same-protocol passthrough and any cross-protocol streaming request failed with
400.That restriction no longer exists.
6095ef0(P3-B) deleted the key filter that enforced it inforward_stream, addedsrc/sse.rswith the protocol-pair SSE converters, and updated that function's own doc comment plusREADME.md— but left the two module headers behind. The same tree therefore carried two claims that contradict each other:README.md:12非流式 + SSE 流式全支持src/gateway.rs:13跨协议 → 400 明确报错src/protocol.rs:14流式 SSE 转换留 P3-BOnly one protocol pair remains unimplemented — responses upstream → anthropic client — which
forward_streamreturns an explicit400for. The other five pairs are implemented and dispatched:Related Issue
None — no issue exists for this. Doc-comment staleness found by a tree scan, not a report.
Changes
src/gateway.rs— the module header no longer claims cross-protocol streaming returns400.src/protocol.rs— the module header no longer claims streaming SSE conversion is deferred to P3-B.Comment-only: 4 insertions, 3 deletions, zero non-comment lines. No production behaviour, no constant, no i18n key, no cache-bust, no config.
Neither comment is replaced with a snapshot of the current coverage. A comment asserting "X is not yet supported" rots the moment X ships, and it is the implementation's own success that invalidates it — the person adding the feature has no reason to look back at a header saying it wasn't there. Both lines now state the invariant (streaming requests are converted cross-protocol too) and point at the authority for the converter list (
src/sse.rs+ theforward_streamdispatch), so a pair being added or removed later cannot contradict the header.Tests
cargo test— 165 passed / 0 failedcargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleanCoverage of the claim itself was checked with a throwaway capability checker (
tmp/c2025_check.py, not committed):The
--self-testleg matters: the fix's whole effect is to delete the corpus being checked, so a green afterwards is vacuous on its own. The checker was also re-run after the fix and did report the two real claims as gone, rather than silently losing track of them.The behaviour the header now describes is pinned by an existing test, which passes on this branch:
Checklist
docs/)docs(gateway): …)