Skip to content

feat(client): connect({ prior: DiscoverResult }) — zero-round-trip connect for gateway/distributed clients - #2350

Merged
felixweinberger merged 2 commits into
v2-2026-07-28from
fweinberger/connect-prior
Jun 23, 2026
Merged

felixweinberger merged 2 commits into
v2-2026-07-28from
fweinberger/connect-prior

docs(examples): gateway story — probe once, zero-round-trip connect f…

c7e184b
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 23, 2026 in 18m 39s

Code review found 2 potential issues

Found 5 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit packages/client/src/client/client.ts:1179-1197 PR description claims a legacy fallback for connect({prior}) that the implementation does not have
🟡 Nit docs/migration.md:1081-1082 New connect({prior})/getDiscoverResult() surface is not mentioned in docs/client.md

Annotations

Check warning on line 1197 in packages/client/src/client/client.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

PR description claims a legacy fallback for connect({prior}) that the implementation does not have

The PR description claims a legacy fallback for `connect({ prior })` that the implementation does not have: the "How Has This Been Tested?" section says the new test pins "prior legacy → exactly one initialize" and the "Behavior" section says "Legacy → run _legacyHandshake() (one initialize, required for stateful)", but `_connectFromPrior` throws `SdkError(EraNegotiationFailed)` on any non-modern overlap and `connectPrior.test.ts` pins exactly that ("no modern overlap: throws (no legacy fallback

Check warning on line 1082 in docs/migration.md

See this annotation in the file changed.

@claude claude / Claude Code Review

New connect({prior})/getDiscoverResult() surface is not mentioned in docs/client.md

The new public client surface (`connect({ prior })`, `getDiscoverResult()`, the exported `ConnectOptions` type) isn't mentioned in `docs/client.md` — its "Protocol version negotiation (2026-07-28 revision)" section still only documents `mode: 'auto'` / `{ pin }` and the probe cost, so a v2 user reading the standing client guide never learns the zero-round-trip option exists. A short paragraph there (and optionally a `clientGuide.examples.ts` snippet) pointing at the migration-guide paragraph and