Skip to content

wip; make /compact client handle SSE so we can keep long-running compactions alive - #11282

Closed
sayan-oai wants to merge 1 commit into
mainfrom
dev/sayan/sse-compact
Closed

sayan-oai wants to merge 1 commit into
mainfrom
dev/sayan/sse-compact

Conversation

@sayan-oai

@sayan-oai sayan-oai commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor

WIP

TL;DR: make remote compaction resilient to idle POST timeouts by switching to an SSE /compact/stream path with keepalives, while keeping unary /compact as compatibility fallback.

Problem

Some networks/proxies drop long-running idle POST requests (~30s).
Remote compaction previously used a single unary /compact call, so these drops surfaced as compaction failures even when backend work could have completed.

Fix

  • Prefer new stream endpoint (/responses/compact/stream) and parse terminal SSE event
  • Map stream failures to existing API error semantics
  • Fallback to unary /responses/compact when stream endpoint is unsupported (404/405)

Tests

Tests for SSE parsing + error/header mapping for compact.failed.
Core integration test remote_compact_uses_stream_endpoint_when_available verifies compact uses stream endpoint.

@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

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