Bug: Wrong graph visualization in studio with the new Command #146

Open
opened 2026-02-15 17:16:17 -05:00 by yindo · 4 comments
Owner

Originally created by @DaniSevAzu on GitHub (Dec 21, 2024).

Steps to simulate de bug:

1.- implement the Graph from the new Command documentation example: https://langchain-ai.github.io/langgraphjs/how-tos/command/#define-graph
2.- Open the Studio url witn langgraph up.
3.- The Graph representation is not correct as you can see at the attached image:

CleanShot 2024-12-21 at 19 26 51

Originally created by @DaniSevAzu on GitHub (Dec 21, 2024). Steps to simulate de bug: 1.- implement the Graph from the new Command documentation example: https://langchain-ai.github.io/langgraphjs/how-tos/command/#define-graph 2.- Open the Studio url witn langgraph up. 3.- The Graph representation is not correct as you can see at the attached image: ![CleanShot 2024-12-21 at 19 26 51](https://github.com/user-attachments/assets/fb7cde53-d023-4faa-b264-397b921276c6)
yindo added the bug label 2026-02-15 17:16:17 -05:00
Author
Owner

@jacoblee93 commented on GitHub (Dec 23, 2024):

Hey @DaniSevAzu, can you share your graph?

We may need to update the Studio image CC @dqbd

@jacoblee93 commented on GitHub (Dec 23, 2024): Hey @DaniSevAzu, can you share your graph? We may need to update the Studio image CC @dqbd
Author
Owner

@lakshyaag12 commented on GitHub (Jan 17, 2025):

This is still occurring on 0.0.35

@lakshyaag12 commented on GitHub (Jan 17, 2025): This is still occurring on 0.0.35
Author
Owner

@dqbd commented on GitHub (Jan 17, 2025):

Hello! @jacoblee93 managed to replicate the issue using this graph

import { Annotation, Command, StateGraph } from "@langchain/langgraph";


const StateAnnotation = Annotation.Root({  foo: Annotation<string> });

const nodeA = async (_state: typeof StateAnnotation.State) => {
  console.log("Called A");
  const goto = Math.random() > 0.5 ? "nodeB" : "nodeC";
  return new Command({
    update: { foo: "a" },
    goto,
  });
};

const nodeB = async (state: typeof StateAnnotation.State) => {
  return { foo: state.foo + "|b" };
};

const nodeC = async (state: typeof StateAnnotation.State) => {
  return { foo: state.foo + "|c" };
};

export const graph = new StateGraph(StateAnnotation)
  .addNode("nodeA", nodeA, { ends: ["nodeB", "nodeC"] })
  .addNode("nodeB", nodeB)
  .addNode("nodeC", nodeC)
  .addEdge("__start__", "nodeA")
  .compile();
@dqbd commented on GitHub (Jan 17, 2025): Hello! @jacoblee93 managed to replicate the issue using this graph ``` import { Annotation, Command, StateGraph } from "@langchain/langgraph"; const StateAnnotation = Annotation.Root({ foo: Annotation<string> }); const nodeA = async (_state: typeof StateAnnotation.State) => { console.log("Called A"); const goto = Math.random() > 0.5 ? "nodeB" : "nodeC"; return new Command({ update: { foo: "a" }, goto, }); }; const nodeB = async (state: typeof StateAnnotation.State) => { return { foo: state.foo + "|b" }; }; const nodeC = async (state: typeof StateAnnotation.State) => { return { foo: state.foo + "|c" }; }; export const graph = new StateGraph(StateAnnotation) .addNode("nodeA", nodeA, { ends: ["nodeB", "nodeC"] }) .addNode("nodeB", nodeB) .addNode("nodeC", nodeC) .addEdge("__start__", "nodeA") .compile(); ```
Author
Owner

@nim442 commented on GitHub (Feb 2, 2025):

Any updates? Having the same issue

@nim442 commented on GitHub (Feb 2, 2025): Any updates? Having the same issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#146