Repository navigation
Reassemble multi-line SSE data events before JSON parsing #20
Copy link
Copy link
Closed
Labels
P1Priority 1: current iteration goalPriority 1: current iteration goalbugSomething isn't workingSomething isn't workingorch:readyOrchestrator V6: valid hashed contract is complete and dispatchableOrchestrator V6: valid hashed contract is complete and dispatchableready-for-humanRequires human implementationRequires human implementationtier:heavyOrchestrator provider tier: heavyOrchestrator provider tier: heavywayfinder:taskWayfinder implementation taskWayfinder implementation task
Description
Outcome
Parse protocol-valid SSE events at event boundaries, preserving multiline data and metadata without changing transparent byte identity or turning semantic JSON errors into malformed downstream streams.
Design and scope
- Add one blank-line-delimited SSE assembler wherever the Gateway semantically parses upstream SSE.
- Join repeated
data:fields with a literal newline before JSON or[DONE]handling, per SSE semantics. - Preserve event metadata (
event,id,retry, comments, unknown fields/order where represented) and retain the raw event bytes for routes that require transparent forwarding or sanitized diagnostics. - Transparent routes must forward byte-identical input, including CRLF/LF choice and raw bytes; parsing must not normalize or reserialize them.
- Converted Responses↔Chat routes consume assembled semantic events, preserve representable metadata and ordering, and handle
[DONE]exactly once. - A protocol-valid SSE event whose assembled data is semantically invalid JSON returns a protocol-valid sanitized 502 with no payload echo, no partial success terminal, no retry/fallback after exposure, and exactly one completion record.
Deterministic acceptance
- Fixtures cover multi-line JSON, newline-bearing data,
[DONE], metadata/comments, blank lines, CRLF/LF, fragmented input, unknown fields, invalid UTF-8/raw bytes on transparent paths, and semantic invalid JSON. - Deterministic Responses→Chat and Chat→Responses tests prove multiline assembly, metadata/raw preservation, transparent byte identity, single terminal, and sanitized 502 behavior.
- Existing single-line events and successful transparent streams remain unchanged.
- The shared
src-python/codex_proxy.pyand routing/protocol tests remain serial with Handle downstream client disconnects consistently for all SSE writes #18 and Bound upstream SSE reader queue and define reader lifecycle #19.
Final-SHA real-client gate
Every final candidate SHA must build Debug and pass the same twelve pinned-VM real-client cases:
- Desktop and CLI:
gpt-5.6-lunaandvolc/glm-5.2. - OpenCode, ZCode, Pi, and OMP: candidate-managed Luna selector and exact
codexhub-volc/glm-5.2. - Each case uses a disposable sentinel file, a real read-only tool call, and a streamed short sentinel; it proves canonical model, expected terminal, exactly one
request_complete=200, and no duplicate, fallback, or unclassified reconnect. - Desktop/ZCode are human GUI gates; login/credentials/GUI fail closed. Only one retry is allowed for pre-output capacity 429/503. A new SHA invalidates all evidence.
Issue-specific evidence includes deterministic Responses↔Chat multiline, [DONE], metadata, invalid-JSON, and raw-byte cases on the final SHA. Converted invalid JSON must end as one sanitized protocol-valid 502; transparent cases must remain byte-identical.
Verification and integration
python -m pytest -q tests/test_routing.py tests/test_chat_completions_gateway.py tests/test_protocol_translation.py
python -m pytest -q
git diff --check
python scripts/report_quality_gates.pyThe quality-gate command is report-only. The final SHA also requires Debug build, GitHub Actions, a strict heavy Reviewer, and human VM evidence. Squash to dev only.
Hotset
src-python/codex_proxy.pysrc-python/protocol_translation.pytests/test_routing.pytests/test_chat_completions_gateway.pytests/test_protocol_translation.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Priority 1: current iteration goalPriority 1: current iteration goalbugSomething isn't workingSomething isn't workingorch:readyOrchestrator V6: valid hashed contract is complete and dispatchableOrchestrator V6: valid hashed contract is complete and dispatchableready-for-humanRequires human implementationRequires human implementationtier:heavyOrchestrator provider tier: heavyOrchestrator provider tier: heavywayfinder:taskWayfinder implementation taskWayfinder implementation task
Activity
NOirBRight commentedon Jul 9, 2026
Agent Brief
Category: bug
Summary: Parse multi-line SSE data events as one event.
Current behavior:
System.Collections.Hashtable.Current
Desired behavior:
System.Collections.Hashtable.Desired
Key interfaces:
Acceptance criteria:
Out of scope:
NOirBRight commentedon Jul 20, 2026
1 remaining item
NOirBRight commentedon Jul 25, 2026
Phase 0 decomposition / frontier correction (2026-07-25):
orch:blocked; it is not dispatched as the legacy all-at-once contract.NOirBRight commentedon Jul 26, 2026
Parent acceptance closure — satisfied by #224 → #225
No third implementation Worker or candidate was created for #20, as required by its V2 contract.
Durable child evidence:
11c56e2ad9bdb37a1906a50d5be1791d21139a01devasc41fa9fbb2b906e8fe807a777f592b9fa5bfc29a30193872974: 7/7 success83c3ecb7f31e5f1c5ebea504b3ecf733303ea2e1devas9976e6358621e9e305988000ca8164382180ac9330204142421: 7/7 successTogether these deliveries implement the one lossless event-boundary assembler and migrate converted Responses↔Chat streams to complete-frame parsing while preserving transparent byte identity, multiline
data:semantics, sanitized protocol-valid failures, and exactly-once terminal accounting. Both child Issues are closed.Per the contract, no intermediate 12-case real-client run was performed for #20. The integrated final-SHA behavior remains part of the sole authoritative release qualification in #227.