fix(frontend): prevent run creation retries - #4725
Open
Jholly2008 wants to merge 3 commits into
Open
Conversation
Jholly2008
marked this pull request as ready for review
August 7, 2026 09:14
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.
Why
An initial
POST /runs/streamcan reach the backend successfully while an intermediary still returns an ambiguous gateway error such as504. The LangGraph SDK retries failed HTTP requests by default, so retrying this non-idempotent request can create the same run more than once and duplicate user-visible work.What changed
GETto the server-providedLocation, including itsLast-Event-IDcursor.Surface area
frontend/backend/applanggraph.json, or prompt changedocker/or sandboxed executionskills/backend/pyproject.tomlorfrontend/package.json(say what it buys us)Screenshots / Recording
Not applicable; this change has no visual impact.
Bug fix verification
frontend/tests/unit/core/api/api-client.test.ts(does not retry run creation after an ambiguous gateway failure).mainand green on this branch? Yes. With the default SDK client, the mocked504was retried and the test received the second response (HTTP 400) instead of preserving the originalHTTP 504; on this branch the test passes with exactly one request.GETand carries the last event ID.Validation
python scripts/pnpm.py format— passedpython scripts/pnpm.py check— ESLint and TypeScript passedpython scripts/pnpm.py test— 989 tests passedBETTER_AUTH_SECRET=local-dev-secret python scripts/pnpm.py build— passedAI assistance
Tool(s) used: Codex
How you used it: Codex traced the SDK retry behavior, implemented the client-scoped change and regression tests, and ran the validation commands. I reviewed the resulting diff and test coverage.