feat(langgraph): single-source LANGGRAPH_CLIENT_OPTIONS for the SDK retry budget#681
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… > provider > token) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vert DemoShell to static provideAgent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… + override ordering Adds a describe block in agent.fn.spec.ts that exercises the FetchStreamTransport / createLangGraphClient path (no MockTransport) with four precedence cases: token-only, call-site wins, none provided, and AGENT_CONFIG middle layer. Also extends the LANGGRAPH_CLIENT_OPTIONS JSDoc to mention the full call-site → provideAgent → token precedence chain. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 18, 2026
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.
What
Adds one app-wide DI token —
LANGGRAPH_CLIENT_OPTIONS(LangGraphClientOptions, e.g.{ maxRetries }) — that both the agent streaming transport and theLangGraphThreadsAdapterread, so the LangGraph SDK retry budget is configured in one place. Completes the knob started in #677 (which only covered the agent stream path; thread CRUD still hung ~15s on a hard failure).How
client-options.ts— theLANGGRAPH_CLIENT_OPTIONStoken + a pureresolveClientOptions(...layers)first-defined-wins helper (internal).agent()resolves precedence: call-siteagent({ clientOptions })→provideAgent({ clientOptions })→ token → SDK default, and passes the resolved value into the bridge (override-after-spread).LangGraphThreadsAdapterreads the token directly; theLANGGRAPH_CLIENTinjected-client bypass is untouched.e2eClientOptions()and revertsDemoShellto staticprovideAgent(unwinds the per-agent factory-form workaround from fix(langgraph): surface stream-connect failures fast (configurable retry budget) #677).Consumers that don't provide the token are byte-for-byte unchanged (SDK default preserved).
Tests
resolveClientOptionsprecedence (4 cases).LangGraphThreadsAdapterthreads the token intocreateLangGraphClient;undefinedwhen absent;LANGGRAPH_CLIENTbypass intact (3 cases).FetchStreamTransportpath (token-only, call-site-wins, AGENT_CONFIG middle layer, none-provided — 4 cases), spyingcreateLangGraphClient.langgraphlint+test (216 pass),nx build examples-chat-angular(green), examples/chaterror-handlinge2e (passes — the failed stream still surfaces the alert fast, now via the shared token).Out of scope
InjectionToken/constexports (so this token — like its siblingsLANGGRAPH_CLIENT/LANGGRAPH_THREADS_CONFIG— is undocumented). Flagged as a separate follow-up; intentionally not bundled here to avoid 5 libraries of doc churn.apiUrl-wiring refactor; no thread-CRUD-abort e2e.Design spec + plan:
docs/superpowers/specs/2026-06-17-langgraph-shared-client-options-design.md,docs/superpowers/plans/2026-06-18-langgraph-shared-client-options.md.🤖 Generated with Claude Code