Skip to content

create_agent 'name' always None #33754

@kalyangoparajuansys

Description

@kalyangoparajuansys

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Example Code

Test_agent = create_agent(
model=llm,
tools=[],
system_prompt="you are a helpful assistant",
name="Test Agent",
)

Error Message and Stack Trace (if applicable)

Test Agent
{
"content": "Got it! How can I assist you today?",
"additional_kwargs": {
"refusal": null
},
"response_metadata": {
"token_usage": {
"completion_tokens": 11,
"prompt_tokens": 12,
"total_tokens": 23,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"model_provider": "openai",
"model_name": "gpt-4o-2024-11-20",
"system_fingerprint": "fp_b54fe76834",
"id": "chatcmpl-CWaJqINHdteLfGX5VeLVynbyOMwwm",
"prompt_filter_results": [
{
"prompt_index": 0,
"content_filter_results": {}
}
],
"finish_reason": "stop",
"logprobs": null,
"content_filter_results": {
"hate": {
"filtered": false,
"severity": "safe"
},
"protected_material_code": {
"filtered": false,
"detected": false
},
"protected_material_text": {
"filtered": false,
"detected": false
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": false,
"severity": "safe"
},
"violence": {
"filtered": false,
"severity": "safe"
}
}
},
"type": "ai",
"name": null,
"id": "lc_run--ebec7e04-ac43-4a20-9909-f1d78f189577-0",
"tool_calls": [],
"invalid_tool_calls": [],
"usage_metadata": {
"input_tokens": 12,
"output_tokens": 11,
"total_tokens": 23,
"input_token_details": {
"audio": 0,
"cache_read": 0
},
"output_token_details": {
"audio": 0,
"reasoning": 0
}
}
}

Description

I am using langchain 1.0.3. Irrespective of me providing a 'name' attribute when creating an agent using create_agent, the name key in the response is always set to 'null'
Previous versions (<1.0) did not have this problem, and I could get the name of the agent returning message by simply calling msg.name

System Info

System Information

OS: Windows
OS Version: 10.0.22631
Python Version: 3.13.5 (tags/v3.13.5:6cb20a2, Jun 11 2025, 16:15:46) [MSC v.1943 64 bit (AMD64)]

Package Information

langchain_core: 1.0.2
langchain: 1.0.3
langsmith: 0.4.38
langchain_openai: 1.0.1
langgraph_sdk: 0.2.9

Optional packages not installed

langserve

Other Dependencies

claude-agent-sdk: Installed. No version info available.
httpx: 0.28.1
jsonpatch: 1.33
langchain-anthropic: Installed. No version info available.
langchain-aws: Installed. No version info available.
langchain-community: Installed. No version info available.
langchain-deepseek: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-genai: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-huggingface: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-ollama: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.2
langsmith-pyo3: Installed. No version info available.
openai: 2.6.1
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.4
packaging: 25.0
pydantic: 2.12.3
pytest: Installed. No version info available.
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: Installed. No version info available.
tenacity: 9.1.2
tiktoken: 0.12.0
typing-extensions: 4.15.0
vcrpy: Installed. No version info available.
zstandard: 0.25.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing feature

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions