Skip to content

fix: keep lead agent graph factory signature compatible#2678

Merged
WillemJiang merged 1 commit intomainfrom
fix/pr2612-langgraph-signature
May 1, 2026
Merged

fix: keep lead agent graph factory signature compatible#2678
WillemJiang merged 1 commit intomainfrom
fix/pr2612-langgraph-signature

Conversation

@greatmengqi
Copy link
Copy Markdown
Collaborator

@greatmengqi greatmengqi commented Apr 30, 2026

Summary

  • restore the public lead-agent graph factory to the LangGraph-compatible make_lead_agent(config) signature
  • move the implementation to internal _make_lead_agent(config, *, app_config) so non-LangGraph callers can bind an explicit AppConfig without changing the public graph ABI
  • add regression tests for both the public graph factory signature and explicit internal app-config injection

Context

Fixes the LangGraph Server load failure reported on #2612: #2612 (comment)

Validation

  • uv run pytest -q tests/test_lead_agent_model_resolution.py tests/test_run_worker_rollback.py
  • uv run ruff check packages/harness/deerflow/agents/lead_agent/agent.py tests/test_lead_agent_model_resolution.py

@greatmengqi greatmengqi force-pushed the fix/pr2612-langgraph-signature branch from ea6d8b9 to ca82e2e Compare April 30, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the public lead-agent graph factory to the LangGraph Server–compatible make_lead_agent(config) ABI while still enabling non-LangGraph callers to inject an explicit AppConfig via an internal implementation.

Changes:

  • Reverted make_lead_agent to a single-argument config signature and delegated to an internal _make_lead_agent(..., *, app_config).
  • Added regression tests to lock the public factory signature and ensure explicit AppConfig injection avoids ambient get_app_config() reads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
backend/packages/harness/deerflow/agents/lead_agent/agent.py Restores LangGraph-compatible factory signature and moves injectable implementation behind _make_lead_agent.
backend/tests/test_lead_agent_model_resolution.py Adds tests for public factory signature and explicit AppConfig injection behavior.

@WillemJiang WillemJiang merged commit 8b61c94 into main May 1, 2026
15 checks passed
@WillemJiang WillemJiang deleted the fix/pr2612-langgraph-signature branch May 1, 2026 07:43
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.

3 participants