Skip to content

[PR] fix: transform complete CloudCode SSE event payloads - #6603

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_v1-multiline-events
Nov 14, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-13_v1-multiline-events

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

CloudCode/Antigravity SSE envelopes can contain one JSON payload spread across several data: fields. mapDataPayload previously parsed only the first field, so an opening { failed parsing and the envelope reached the Gemini adapter unchanged.

A real-HTTP regression through startServer reproduces the consequence on master e1f31ad9d5b47500362699a9867819b861c7de96: a complete upstream reply becomes empty client-visible model text, and the proxy sends a second upstream request. With this fix, the client receives hello from cloudcode exactly once and only one upstream request is made. This fixture demonstrates the supported wire shape; it does not assert that Google's production service currently emits pretty-printed SSE by default.

Change

Assemble the complete SSE data payload before applying the existing CloudCode envelope helper. Replace transformed data fields with one complete JSON field and retain event, id, comment and retry fields. Unchanged or unsupported payloads pass through verbatim.

Both inbound unwrapping and outbound wrapping use the correction. JSON-body handling, request envelopes, session identity and compression policy are unchanged.

Validation

  • Unchanged-master regression: 6 new cases fail, 6 controls pass.
  • Fixed related suites: 38 pass, 0 fail across v1internal-multiline-sse, issue3129-v1internal, issue3280-v1internal-loop-rounds and adapter-google.
  • Coverage includes both envelope directions, real HTTP with compression enabled, preserved non-data fields, one-byte UTF-8 chunks, LF/CRLF/CR line endings, and malformed/non-object pass-through controls.
  • npm run typecheck, npm run build, npm run check:unused-exports, npm run check:test-import-graph and git diff --check pass.

Local tests used Node v24.22.1 and the repository's test/storage preloads. The full-suite verdict remains with CI on this pushed head.

Prior work

All-state issue/PR searches found no existing complete-event envelope fix. #3372 handles CRLF boundaries, #3282 handles later loop rounds, and my earlier #6102 handles summary extraction. This change corrects the separate CloudCode envelope boundary exercised by the live proxy.

Suggested triage: bug, p2, scope/wiring; Topic I — other host lanes.

Fixes #6600

@ranxianglei ranxianglei changed the title fix: transform complete CloudCode SSE event payloads [PR] fix: transform complete CloudCode SSE event payloads Nov 13, 2026
@ranxianglei
ranxianglei merged commit 548d9c6 into ranxianglei:master Nov 14, 2026
44 of 48 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner

Superseded by #6677 (merged as 3858b6956, 2026-11-14).

Landed into master via the real merge commit 548d9c66f94 (Merge Afloat16/2026-11-13_v1-multiline-events (PR #6603)), so your original commits are preserved verbatim in master history — only hashes of the batch wrapper changed, your authorship and commit messages are intact.

The fix for #6600 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CloudCode multiline SSE envelopes lose the model reply and trigger a retry

2 participants