Skip to content

fix(harness): forward SSE events without filling relay buffers - #1238

Draft
zyn080302 wants to merge 1 commit into
volcengine:mainfrom
zyn080302:fix/sidecar-incremental-sse-20261129
Draft

zyn080302 wants to merge 1 commit into
volcengine:mainfrom
zyn080302:fix/sidecar-incremental-sse-20261129

Conversation

@zyn080302

Copy link
Copy Markdown
Contributor

Small SSE responses were delayed by veADK's Sidecar HTTP relays until the upstream stream ended or a 64 KiB read filled. This change forwards available bytes immediately, so clients can receive the first event while the upstream response remains open.

  • Use HTTPResponse.read1(64 * 1024) in the stable/fallback, Runtime Gateway, and managed MCP upstream relays.
  • Stream text/event-stream responses through the MCP loopback relay while preserving legacy JSON framing and session-header normalization.
  • Add real HTTP regressions for first-event delivery, chunked/Content-Length/connection-close framing, success/error responses, split UTF-8, truncation, and consumer disconnect/recovery. Run these tests in the existing Harness Sidecar release gate.

Request bodies, public APIs, dependency versions, timeouts, and retry policy are unchanged. Harness service's default streaming and explicitly enabled strict_stream_buffer behavior are retained. Earlier chunks are an intentional user-visible behavior change; no provider caching benefit or production latency improvement is claimed.

Validation uses CPython 3.12.13 and the unchanged lock file on Linux, with external network disabled during Python tests. The same 30 first-event tests fail at the expected timing boundary on the base revision and pass on the candidate. Candidate targeted checks pass 46/46; the built and installed wheel passes 40/40; the unchanged Harness HTTP service plus the complete relay chain passes 23/23 with request bodies preserved. Frontend Sidecar coverage, 1,389 Node tests, 236 Vitest tests, and all pre-commit hooks pass.

The complete Python regression finished in 490.35 seconds with 9,632 passed, 1 failed, 141 skipped, and 4 xfailed (no errors). The failure is tests/cli/test_github_cicd.py::test_list_github_delivery_versions_returns_recorded_versions: it leaves a GitHub request to the synthetic acme/demo repository unstubbed. The same test fails on the unchanged base revision with the same isolated environment. This PR remains a draft because the complete suite is not green; the failure is retained, and no test was deselected or weakened to hide it. Existing skips include optional live-model/database/CUA integration and unsupported runtime capabilities; they are not counted as passes. The repository's standard not codex_smoke and not piagent_smoke selection was used with four workers on eight available CPUs.

All five backend Sidecar gate groups pass (coverage 162, lifecycle 9, credentials 97, release 39, streaming 45); Sidecar coverage is 96%, retaining the existing 91% threshold. Earlier environment failures were corrected by restoring locked optional dependencies, build-cache prerequisites and OpenTelemetry collection for tests; the original failed run is retained separately.

No customer Runtime deployment, real-model replay, or production browser acceptance was performed; this PR changes the library transport layer.

This branch has not been deployed

No deployments
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.

1 participant