Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags added to the graph are not propagated in v0.2.x (worked in v0.1.x) #2890

Closed
4 tasks done
zoltan-fedor opened this issue Dec 28, 2024 · 0 comments · Fixed by #3039
Closed
4 tasks done

Tags added to the graph are not propagated in v0.2.x (worked in v0.1.x) #2890

zoltan-fedor opened this issue Dec 28, 2024 · 0 comments · Fixed by #3039

Comments

@zoltan-fedor
Copy link

zoltan-fedor commented Dec 28, 2024

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

from langgraph.graph import StateGraph

workflow = StateGraph(AgentState)
...
workflow.compile().with_config(tags=["mygraph"])

Error Message and Stack Trace (if applicable)

No response

Description

In v0.1.x I could add a tag to a graph with either of the following:

from langgraph.graph import StateGraph

workflow = StateGraph(AgentState)
...
workflow.compile().with_config({"run_name": "my_run", "tags": ["mygraph"]})

Or with:

workflow = StateGraph(AgentState)
...
workflow.compile().with_config(run_name="my_run", tags=["mygraph"])

In v0.1.x the added tag (mygraph) shows up in the metadata of the events:

{
  tags: [
    0: "seq:step:3",
    1: "mygraph"    <=== TAG IS HERE
  ]
  langgraph_step: "1"
  langgraph_node: "agent"
  langgraph_triggers: [
    0: "start:agent"
  ]
}

In v0.2.x the added tag is not in the metadata:

{
  tags: [
    0: "seq:step:3"   <=== NO 'mygraph' TAG!!!
  ]
  langgraph_step: "1"
  langgraph_node: "agent"
  langgraph_triggers: [
    0: "start:agent"
  ]
}

Is it possible that the new tags added to the v0.2.x codebase like TAG_HIDDEN overwrite the user-supplied tags somewhere instead of appending to it and so the user-supplied tags gets lost?

See TAG_HIDDEN:

TAG_HIDDEN = sys.intern("langsmith:hidden")

Ps,:

  • The run_name can be successfully propagated from the with_config() method, only the tags are not propagated in v0.2.x
  • The issue was the same with the latest version of Langchain and also with older version like langchain==0.2.9, once langgraph got upgraded to v0.2.x the tags stopped propagate both with langchain==0.2.9 and langchain==0.2.17

System Info

System Information

OS: Linux
OS Version: #115~20.04.1-Ubuntu SMP Mon Apr 15 17:33:04 UTC 2024
Python Version: 3.11.9 (main, Apr 6 2024, 17:59:24) [GCC 9.4.0]

Package Information

langchain_core: 0.2.43
langchain: 0.2.17
langchain_community: 0.2.19
langsmith: 0.1.147
langchain_cli: 0.0.35
langchain_openai: 0.1.25
langchain_text_splitters: 0.2.4
langgraph: 0.2.60
langserve: 0.2.2

Other Dependencies

aiohttp: 3.11.11
async-timeout: Installed. No version info available.
dataclasses-json: 0.6.7
fastapi: 0.115.6
gitpython: 3.1.43
gritql: 0.1.5
httpx: 0.27.0
jsonpatch: 1.33
langgraph-checkpoint: 2.0.9
langgraph-sdk: 0.1.48
langserve[all]: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
numpy: 1.26.4
openai: 1.58.1
orjson: 3.10.12
packaging: 24.2
pydantic: 2.10.4
pyproject-toml: 0.0.10
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.36
sse-starlette: 1.8.2
tenacity: 8.5.0
tiktoken: 0.8.0
tomlkit: 0.13.2
typer[all]: Installed. No version info available.
typing-extensions: 4.12.2
uvicorn: 0.34.0

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

Successfully merging a pull request may close this issue.

2 participants