Skip to content

fix: coerce default http2.connect port to a number#117

Merged
abcxff merged 1 commit into
mainfrom
abc/fixes-1
Jun 23, 2026
Merged

fix: coerce default http2.connect port to a number#117
abcxff merged 1 commit into
mainfrom
abc/fixes-1

Conversation

@abcxff

@abcxff abcxff commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

http2.connect() with no explicit port shipped port: "" to the sidecar (WHATWG URL.port is the empty string for protocol-default ports, and ?? only falls back on null/undefined). The sidecar then failed to deserialize "" into Option<u16>:

ERR_AGENTOS_NODE_SYNC_RPC: net.http2_session_connect payload must be valid JSON: invalid type: string "", expected u16

Coerce the raw port to a number, mapping ""/undefined/null to undefined so the field is omitted. The sidecar already defaults an absent port via url.port()/scheme, so no Rust change is required. Fixes AWS Bedrock (HTTP/2 via @smithy/node-http-handler) connections.

http2.connect() with no explicit port (e.g. "https://host") shipped
port: "" to the sidecar, because WHATWG URL.port is the empty string for
protocol-default ports and ?? only falls back on null/undefined. The
sidecar then failed to deserialize "" into Option<u16>:

  ERR_AGENTOS_NODE_SYNC_RPC: net.http2_session_connect payload must be
  valid JSON: invalid type: string "", expected u16

Coerce the raw port to a number, mapping ""/undefined/null to undefined
so the field is omitted. The sidecar already defaults an absent port via
url.port()/80, so no Rust change is required.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-117 June 23, 2026 21:57 Destroyed
@railway-app railway-app Bot temporarily deployed to rivet-frontend / secure-exec-pr-117 June 23, 2026 21:57 Destroyed
@abcxff abcxff merged commit cf0305e into main Jun 23, 2026
9 of 12 checks passed
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