-
Notifications
You must be signed in to change notification settings - Fork 19.9k
Description
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 posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.
Package (Required)
- langchain
- langchain-openai
- langchain-anthropic
- langchain-classic
- langchain-core
- langchain-cli
- langchain-model-profiles
- langchain-tests
- langchain-text-splitters
- langchain-chroma
- langchain-deepseek
- langchain-exa
- langchain-fireworks
- langchain-groq
- langchain-huggingface
- langchain-mistralai
- langchain-nomic
- langchain-ollama
- langchain-perplexity
- langchain-prompty
- langchain-qdrant
- langchain-xai
- Other / not sure / general
Example Code (Python)
from ast import mod
import os
import asyncio
from typing import Literal
from dotenv import load_dotenv
from deepagents import create_deep_agent
from langchain.chat_models import init_chat_model
# Load environment
load_dotenv()
universal_coder = {
"name": "atomic_coder",
"description": "Executes ONE atomic coding task. Blind to the larger project context.",
"system_prompt": """You are an atomic code executor. You receive ONE specific coding instruction.
use tool write_files to write in files
use tool edit_file to edit in files
use tool glob to know where is the location to edit
use tool grep to edit files also
YOUR CONSTRAINTS:
- You do NOT know what project this is for
- You do NOT know what other tasks are being done
- You ONLY execute the exact instruction given
- Output clean, working code with no commentary
EXECUTION RULES:
1. If asked to "Write function X" β Write ONLY that function
2. If asked to "Create file Y.html" β Create ONLY that file
3. If asked to "Fix bug Z" β Fix ONLY that bug
4. Use write_file to save output
5. Keep responses under 150 lines
LANGUAGE SUPPORT:
- Detect language from instruction (Python, JavaScript, HTML/CSS, etc.)
- Use modern syntax and best practices
- Add minimal comments only for complex logic
DO NOT:
- Ask clarifying questions
- Suggest improvements to the overall architecture
- Explain the "why" - just execute the "what"
""",
"model": "openai:gpt-4o-mini" # Cheap model as per MAKER
}
# Model configuration
model = init_chat_model(
model="openai:gpt-5-mini",
streaming=False # Disable streaming to avoid verification issues
)
manager_system_prompt = """ You are a Coding Project Manager using the MAKER framework.
YOUR WORKFLOW:
1. DECOMPOSE: Break user's request into 10-50 ATOMIC tasks using 'write_todos'
- Each task = 1 function OR 1 file OR 1 bug fix
- Make tasks PARALLEL-SAFE (no dependencies between tasks in same batch)
2. DELEGATE: Call 'task(name="atomic_coder")' for EACH todo
- Pass ONLY the specific instruction (e.g., "Write validateEmail() in JS")
- DO NOT pass project context
3. PARALLELIZE: Group independent tasks and delegate them simultaneously
- Example: All HTML components can run in parallel
- Then all JS functions can run in parallel
- Then integration/testing runs sequentially
4. COMPILE: After all tasks complete, review the file system and assemble results
DECOMPOSITION EXAMPLE:
User: "Build a calculator app"
Bad (Monolithic):
β "Build calculator app" β atomic_coder
Good (MAKER):
β
Phase 1 (Parallel):
- "Create calculator.html with button grid"
- "Create styles.css with calculator UI"
β
Phase 2 (Parallel):
- "Write add(a,b) function in calc.js"
- "Write subtract(a,b) function in calc.js"
- "Write multiply(a,b) function in calc.js"
- "Write divide(a,b) function in calc.js"
β
Phase 3 (Sequential):
- "Write handleButtonClick() to connect UI to logic"
- "Test all functions with edge cases"
TASK SIZING:
- β
GOOD: "Write a login form with email and password fields"
- β
GOOD: "Create handleSubmit() function for the login form"
- β BAD: "Build the entire authentication system"
PARALLEL EXECUTION RULES:
- Files in different directories β Parallel
- Functions in same file β Sequential (to avoid conflicts)
- Independent components β Parallel
- Dependent tasks β Sequential
OUTPUT FORMAT:
When done, provide:
1. Task Summary: "Completed X tasks in Y batches"
2. File Tree: Show created files
3. Usage Instructions: How to run the code
"""
# ============================================
# CREATE AGENT
# ============================================
agent = create_deep_agent(
model=model,
subagents=[universal_coder],
system_prompt=manager_system_prompt,
)
result = agent.invoke({"messages": [{"role": "user", "content": "CREATE a very beautiful todo list app"}]})
# Print the agent's response
print(result["messages"][-1].content)
print(f"β Agent initialized with {len(agent.get_graph().nodes)} nodes")Error Message and Stack Trace (if applicable)
Connection failed. Ensure your server is running at this endpoint.
This happens in the langsmith studioDescription
even though the server is running
Even Though i have used latest version of everything this issue is still there please fix it
System Info
System Information
OS: Windows
OS Version: 10.0.26100
Python Version: 3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)]
Package Information
langchain_core: 1.0.0
langchain: 1.0.2
langsmith: 0.4.37
langchain_anthropic: 1.0.0
langchain_mcp_adapters: 0.1.11
langchain_ollama: 1.0.0
langchain_openai: 1.0.1
langchain_pinecone: 0.0.1
langgraph_api: 0.4.46
langgraph_cli: 0.4.4
langgraph_runtime_inmem: 0.14.1
langgraph_sdk: 0.2.9
Optional packages not installed
langserve
Other Dependencies
anthropic: 0.71.0
blockbuster: 1.5.25
claude-agent-sdk: Installed. No version info available.
click: 8.3.0
cloudpickle: 3.1.1
cryptography: 44.0.3
grpcio: 1.76.0
grpcio-tools: 1.76.0
httpx: 0.28.1
jsonpatch: 1.33
jsonschema-rs: 0.29.1
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-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.1
langgraph-checkpoint: 3.0.0
langsmith-pyo3: Installed. No version info available.
mcp: 1.18.0
numpy: 2.3.4
ollama: 0.6.0
openai: 2.6.0
openai-agents: Installed. No version info available.
opentelemetry-api: 1.38.0
opentelemetry-exporter-otlp-proto-http: 1.38.0
opentelemetry-sdk: 1.38.0
orjson: 3.11.3
packaging: 25.0
pinecone-client: 3.2.2
protobuf: 6.33.0
pydantic: 2.12.3
pyjwt: 2.10.1
pytest: Installed. No version info available.
python-dotenv: 1.1.1
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: 14.2.0
simsimd: 3.9.0
sse-starlette: 2.1.3
starlette: 0.48.0
structlog: 25.4.0
tenacity: 9.1.2
tiktoken: 0.12.0
truststore: 0.10.4
typing-extensions: 4.15.0
uvicorn: 0.38.0
vcrpy: Installed. No version info available.
watchfiles: 1.1.1
zstandard: 0.25.0