Skip to content

fix: propagate IngestEvent errors and document HTTP/2 requirement#15

Merged
tumberger merged 2 commits intomainfrom
04-08-feat_revert_to_bidi_streaming
Apr 8, 2026
Merged

fix: propagate IngestEvent errors and document HTTP/2 requirement#15
tumberger merged 2 commits intomainfrom
04-08-feat_revert_to_bidi_streaming

Conversation

@tumberger
Copy link
Copy Markdown
Contributor

@tumberger tumberger commented Apr 8, 2026

IngestEvent uses bidi streaming which requires HTTP/2. Previously the
Receive() error and response were silently discarded. Now all errors
are properly propagated so the sidecar can surface ingestion failures.

The dev server needs HTTPS (via mkcert) for HTTP/2 ALPN negotiation.
Production already has HTTP/2 via edge TLS at api.kontext.security.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


Open with Devin

IngestEvent uses bidi streaming which requires HTTP/2. Previously the
Receive() error and response were silently discarded. Now all errors
are properly propagated so the sidecar can surface ingestion failures.

The dev server needs HTTPS (via mkcert) for HTTP/2 ALPN negotiation.
Production already has HTTP/2 via edge TLS at api.kontext.security.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tumberger tumberger marked this pull request as ready for review April 8, 2026 12:35
devin-ai-integration[bot]

This comment was marked as resolved.

CloseResponse() was only called on the happy path. Early returns from
Send(), CloseRequest(), or Receive() errors skipped it, leaking the
underlying HTTP/2 stream. Use defer to ensure cleanup on all paths.

Addresses Devin review finding on PR #15.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tumberger tumberger merged commit 5e7e2e2 into main Apr 8, 2026
4 checks passed
tumberger added a commit that referenced this pull request Apr 8, 2026
* fix: propagate IngestEvent errors and document HTTP/2 requirement

IngestEvent uses bidi streaming which requires HTTP/2. Previously the
Receive() error and response were silently discarded. Now all errors
are properly propagated so the sidecar can surface ingestion failures.

The dev server needs HTTPS (via mkcert) for HTTP/2 ALPN negotiation.
Production already has HTTP/2 via edge TLS at api.kontext.security.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: defer stream.CloseResponse() to prevent HTTP/2 stream leak

CloseResponse() was only called on the happy path. Early returns from
Send(), CloseRequest(), or Receive() errors skipped it, leaking the
underlying HTTP/2 stream. Use defer to ensure cleanup on all paths.

Addresses Devin review finding on PR #15.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use /tmp for sidecar socket to avoid macOS sun_path limit

macOS $TMPDIR is a long path (/var/folders/.../T/) which pushes the
Unix socket path over the 104-byte sun_path limit. Use /tmp with a
truncated session ID instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: change ProcessHookEvent from bidi streaming to unary RPC

Bidi streaming required HTTP/2 end-to-end, which Cloud Run doesn't
support without --use-http2 (which breaks HTTP/1.1 REST endpoints).
The RPC was already effectively unary — one event in, one ack out.

- Regenerate proto stubs from kontext-dev/proto (unary definition)
- Simplify IngestEvent to match CreateSession/Heartbeat/EndSession
- Update README to reflect unary RPC

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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