Skip to content

fix(langgraph): support falsy command resume values - #2610

Open
xiaotianna wants to merge 3 commits into
langchain-ai:mainfrom
xiaotianna:fix/falsy-command-resume
Open

fix(langgraph): support falsy command resume values#2610
xiaotianna wants to merge 3 commits into
langchain-ai:mainfrom
xiaotianna:fix/falsy-command-resume

Conversation

@xiaotianna

Copy link
Copy Markdown

Summary

Allow falsy values such as false, 0, and an empty string to be used as
Command.resume values.

PregelLoop determines whether a resume value is present using
resume != null, but mapCommand previously used a truthiness check. As a
result, falsy resume values produced no pending writes and caused:

EmptyInputError: Received empty Command input

Changes

  • Treat only null and undefined as missing resume values
  • Preserve false, 0, and "" as valid resume values
  • Add regression tests for these falsy values

Tests

pnpm exec vitest run src/pregel/io.mapCommand.test.ts --project unit --typecheck.enabled=false

Result: 14 tests passed.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 86baa79

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/langgraph Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@langchain/langgraph-checkpoint

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint@2610

@langchain/langgraph-checkpoint-mongodb

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint-mongodb@2610

@langchain/langgraph-checkpoint-postgres

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint-postgres@2610

@langchain/langgraph-checkpoint-redis

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint-redis@2610

@langchain/langgraph-checkpoint-sqlite

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint-sqlite@2610

@langchain/langgraph-checkpoint-validation

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-checkpoint-validation@2610

create-langgraph

npm i https://pkg.pr.new/langchain-ai/langgraphjs/create-langgraph@2610

@langchain/langgraph-api

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-api@2610

@langchain/langgraph-cli

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-cli@2610

@langchain/langgraph

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph@2610

@langchain/langgraph-cua

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-cua@2610

@langchain/langgraph-supervisor

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-supervisor@2610

@langchain/langgraph-swarm

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-swarm@2610

@langchain/langgraph-ui

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-ui@2610

@langchain/langgraph-sdk

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/langgraph-sdk@2610

@langchain/angular

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/angular@2610

@langchain/react

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/react@2610

@langchain/svelte

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/svelte@2610

@langchain/vue

npm i https://pkg.pr.new/langchain-ai/langgraphjs/@langchain/vue@2610

commit: 86baa79

@xiaotianna

Copy link
Copy Markdown
Author

This failure seems unrelated to this PR's code changes.

The failing workflow is .github/workflows/dependabot-auto-merge.yml, which uses:

dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98

The action is pinned to a full commit SHA, but dependabot/fetch-metadata@* is not included in the repository/enterprise allowed action patterns.

This PR only changes libs/langgraph-core/src/pregel/io.ts, its test file, and a changeset, so I don't think this CI failure is caused by my change.

Could a maintainer either add dependabot/fetch-metadata@* to the Actions allowlist, or update/disable the Dependabot auto-merge workflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant