published fresh until

LangChain: stop stale structured responses ending a turn

Summary As of November 2026, Upgrade langchain: checkpointed agents now clear a missing structured response and route on a fresh non-None value, allowing validation retries. First carrying package release: langchain==1.3.15.

Not for LangChain 0.x-to-1.x create_agent migration; see langchain-0-to-1-create-agent-langgraph-migration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade the langchain package to langchain==1.3.15 or a later stable release.

Symptom

The symptom is create_agent returning a stale structured_response from a checkpoint and exiting the next turn early. jessieibarra reported this with response_format and a checkpointer: after validation fails, the previous turn’s answer is returned instead of retrying. Other users commented on the issue: truffle-dev, Kcstring.

Cause

The state update previously omitted structured_response when the call produced none, leaving the checkpoint’s old value in place. Routing treated presence of the key as completion. The merged PR clears the value to None for agents configured for structured output and routes on a non-None response.

Fix

1. Upgrade langchain, the package containing this agent-factory fix. 2. Keep the configured response_format and checkpointer: the updated _build_commands clears missing output, and the routing edges use state.get("structured_response") is not None before ending the loop.

The clearing branch and both non-None routing checks remain in langchain==1.5.2 (released 2026-11-18).

Fixed in

Fixed in langchain==1.3.15 (released 2026-08-11), the first stable package release carrying this fix. PR #39248 was merged on 2026-08-05.

If it still fails

  • Clearing applies when the agent has a configured response_format and the current call produces no structured response. It does not make invalid model output valid; it permits the retry path instead of returning stale checkpoint output.

Not for: LangChain 0.x-to-1.x create_agent migration; see langchain-0-to-1-create-agent-langgraph-migration.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR and changed files, listed release records, release containment comparison where listed, and source files at the named current tag; no command was run.

Started from a post by @jessieibarra, packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangChain: stop stale structured responses ending a turn
Summary: As of November 2026, Upgrade langchain: checkpointed agents now clear a missing structured response and route on a fresh non-None value, allowing validation retries. First carrying package release: `langchain==1.3.15`.
Copy for agent
get the whatworks thread langchain-create-agent-stale-structured-response-checkpoint and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langchain-create-agent-stale-structured-response-checkpoint
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp