fix(langgraph): surface stream-connect failures fast (configurable retry budget)#677
Merged
Conversation
… retry budget (#667 regression) @langchain/langgraph-sdk 1.9.x (bumped from 1.7.4 in #667) wraps every connect attempt — including the initial run stream — in AsyncCaller's p-retry (default 4 retries, exponential backoff ~15s) before throwing a ConnectionError. A failed stream therefore no longer fails fast: the error alert surfaces ~15-20s late instead of immediately, which broke examples/chat e2e `error-handling` (15s assertion window) and degrades the real UX of a dropped connection. Production keeps the SDK's resilient default. Add a `clientOptions.maxRetries` knob on `provideAgent` / `agent()` (threaded → FetchStreamTransport → createLangGraphClient → SDK `callerOptions`). examples/chat reads a localStorage flag (`THREADPLANE_E2E_MAX_RETRIES`) to opt into fail-fast (0 retries) under test; the e2e sets it via addInitScript so the alert surfaces immediately. - libs/langgraph: LangGraphClientOptions type + clientOptions on AgentOptions / AgentConfig; createLangGraphClient maps maxRetries → callerOptions. - examples/chat: e2eClientOptions() helper (+ unit tests); DemoShell switches to factory-form provideAgent so the flag is read at injection time. - api-docs regenerated for the new public surface. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 17, 2026
blove
added a commit
that referenced
this pull request
Jun 17, 2026
…eak app build) (#679) `tsconfig.app.json` includes `src/**/*.ts` with `types: []`, so the Angular app build type-checks every spec. `e2e-overrides.spec.ts` (added in #677) used ambient `describe`/`it`/`expect`/`afterEach`, which fail under the app build (`TS2304`/`TS2593`) — the bundle never generates, the e2e server never starts, and all 4 `examples/chat` e2e shards time out. Matches the existing specs by importing the globals from vitest explicitly. Regressed main at 3c45540 (#677 merge); local `nx test` masked it because only `nx serve`/the app build compiles specs under tsconfig.app.json. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
examples/chate2eerror-handling.spec.tshas been red onmainsince ~#666, blocking the Canonical demo → Vercel deploy. A failed stream no longer surfaces the error alert within the test's 15s window.Root cause (proven)
#667 bumped
@langchain/langgraph-sdk1.7.4 → 1.9.22. The new SDK wraps every connect attempt — including the initial run stream — inAsyncCaller's p-retry (default 4 retries, exponential backoff ≈ 15s) before throwing aConnectionError. So a failed stream no longer fails fast: the error alert surfaces ~15-20s late instead of immediately.This is both the CI failure and a real UX regression (a dropped connection hangs ~15s with no feedback).
Fix
Production keeps the SDK's resilient default. Add a
clientOptions.maxRetriesknob onprovideAgent/agent(), threaded →FetchStreamTransport→createLangGraphClient→ SDKcallerOptions.examples/chatopts into fail-fast (0retries) only under e2e, via alocalStorageflag the spec sets withaddInitScript.LangGraphClientOptionstype;clientOptionsonAgentOptions/AgentConfig;createLangGraphClientmapsmaxRetries→callerOptions.e2eClientOptions()helper (+ unit tests);DemoShellswitches to factory-formprovideAgentso the flag is read at injection time (not module-load).Verification
examples/chate2e full suite: 41 passed (error-handling now passes in 2.9s).langgraphlint + unit tests pass;examples-chat-angularunit tests pass (37, incl. newe2eClientOptionsspecs).🤖 Generated with Claude Code