Langgraph allows you to invoke a graph using state properties that do not exist, and then displays these in langsmith in the __start__ node #207

Closed
opened 2026-02-15 17:17:19 -05:00 by yindo · 1 comment
Owner

Originally created by @ashburnham on GitHub (Mar 20, 2025).

If I invoke a graph which has one state property foo

graph.invoke({
  foo: 1,
  bar: 2,
})

The in Langsmith I will see both properties in the __start__ node, and the the invalid property the disappears when it gets to the following node in the graph.

This is confusing as bar should not be able to exist in the graph state.

Proposed behaviour:

  • graph.invoke to be type-safe so that it cannot be invoked with invalid properties.
  • invalid properties not to show at all in the state in Langsmith
Originally created by @ashburnham on GitHub (Mar 20, 2025). If I invoke a graph which has one state property foo ``` graph.invoke({ foo: 1, bar: 2, }) ``` The in Langsmith I will see both properties in the `__start__` node, and the the invalid property the disappears when it gets to the following node in the graph. This is confusing as bar should not be able to exist in the graph state. Proposed behaviour: - `graph.invoke` to be type-safe so that it cannot be invoked with invalid properties. - invalid properties not to show at all in the state in Langsmith
yindo closed this issue 2026-02-15 17:17:19 -05:00
Author
Owner

@dqbd commented on GitHub (May 28, 2025):

Hello!

graph.invoke to be type-safe so that it cannot be invoked with invalid properties.

I believe that you're most likely running Typescript with strict: false in tsconfig.json. With strict: true, the TypeScript will warn you that an invalid property is being sent.

invalid properties not to show at all in the state in Langsmith
Will close this as won't fix, as I believe that this is the expected behaviour.

@dqbd commented on GitHub (May 28, 2025): Hello! > graph.invoke to be type-safe so that it cannot be invoked with invalid properties. I believe that you're most likely running Typescript with `strict: false` in `tsconfig.json`. With `strict: true`, the TypeScript will warn you that an invalid property is being sent. > invalid properties not to show at all in the state in Langsmith Will close this as won't fix, as I believe that this is the expected behaviour.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#207