fix: keep lead agent graph factory signature compatible#2678
Merged
WillemJiang merged 1 commit intomainfrom May 1, 2026
Merged
fix: keep lead agent graph factory signature compatible#2678WillemJiang merged 1 commit intomainfrom
WillemJiang merged 1 commit intomainfrom
Conversation
ea6d8b9 to
ca82e2e
Compare
ca82e2e to
3d254cd
Compare
Contributor
There was a problem hiding this comment.
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_agentto a single-argumentconfigsignature and delegated to an internal_make_lead_agent(..., *, app_config). - Added regression tests to lock the public factory signature and ensure explicit
AppConfiginjection avoids ambientget_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
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make_lead_agent(config)signature_make_lead_agent(config, *, app_config)so non-LangGraph callers can bind an explicitAppConfigwithout changing the public graph ABIContext
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.pyuv run ruff check packages/harness/deerflow/agents/lead_agent/agent.py tests/test_lead_agent_model_resolution.py