Skip to content

Conversation

@michaeloboyle
Copy link

Summary

Expand LangGraph agent detection to support create_react_agent() pattern used in projects like langmanus. This addresses the incomplete visualization reported in Issue #94.

Problem

Users reported that workflows using create_react_agent() showed only nodes with no edges or agent detection. The existing detector only recognized llm.bind_tools() patterns.

Solution

Enhanced agent_tracking.py to detect two additional patterns:

  1. agent_var = create_react_agent(llm, tools=[...])
  2. agent_var = module.create_react_agent(llm, tools=[...])

Changes

  • Modified: agentic_radar/analysis/langgraph/agent_tracking.py (+25 lines)
  • Added: Test fixtures matching real-world usage patterns
  • Added: Comprehensive test coverage (3 new tests)

Test Results

  • ✅ All 23 existing LangGraph tests pass (backward compatible)
  • ✅ 3 new tests pass
  • ✅ Verified with langmanus project: 0 agents detected → 3 agents detected
# Before
Total agents: 0

# After  
Total agents: 3
Agent names:
  - researcher
  - coder
  - browser

Implementation Details

Related

Closes #94


🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…plx-ai#94)

Expand LangGraph agent detection to support create_react_agent() pattern
used in projects like langmanus. This addresses the incomplete visualization
reported in Issue splx-ai#94.

**Changes:**
- Enhanced agent_tracking.py to detect two additional patterns:
  1. agent_var = create_react_agent(llm, tools=[...])
  2. agent_var = module.create_react_agent(llm, tools=[...])
- Added comprehensive test coverage (3 new tests)
- Created test fixtures matching real-world usage

**Test Results:**
- All 23 LangGraph tests pass
- Verified with langmanus project: now detects 3 agents (researcher, coder, browser)
- Previously: 0 agents detected
- Now: Full agent detection and visualization

**Implementation Details:**
- TDD approach: wrote failing tests first
- Pattern detection via AST analysis
- Backward compatible: existing bind_tools() detection unchanged
- Follows maintainer guidance from Issue splx-ai#94 comments

Addresses: splx-ai#94

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incomplete LangGraph Visualization for Langmanus Agent: Only Nodes Detected

1 participant