Skip to content

fix: thread app config through client and sync providers#2688

Open
greatmengqi wants to merge 1 commit into
mainfrom
fix/explicit-app-config-client-provider
Open

fix: thread app config through client and sync providers#2688
greatmengqi wants to merge 1 commit into
mainfrom
fix/explicit-app-config-client-provider

Conversation

@greatmengqi
Copy link
Copy Markdown
Collaborator

Summary

  • thread the client-owned AppConfig through model, prompt, middleware, tools, and checkpointer composition
  • add explicit app_config support to sync checkpointer/store providers instead of forcing global config lookup
  • add regression tests for client and sync provider explicit-config behavior

Testing

  • uv run pytest -q tests/test_client.py tests/test_checkpointer.py tests/test_checkpointer_none_fix.py tests/test_lead_agent_prompt.py tests/test_lead_agent_skills.py tests/test_invoke_acp_agent_tool.py tests/test_subagent_executor.py tests/test_run_worker_rollback.py
  • uv run ruff check packages/harness/deerflow/client.py packages/harness/deerflow/runtime/checkpointer/provider.py packages/harness/deerflow/runtime/store/provider.py tests/test_client.py tests/test_checkpointer.py
  • uv run ruff format --check packages/harness/deerflow/client.py packages/harness/deerflow/runtime/checkpointer/provider.py packages/harness/deerflow/runtime/store/provider.py tests/test_client.py tests/test_checkpointer.py

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

This PR threads a client-owned AppConfig through DeerFlow’s sync client composition path and adds explicit app_config support to the sync checkpointer/store providers to reduce reliance on ambient/global config lookups.

Changes:

  • Pass app_config through DeerFlowClient agent construction (model, middleware, prompt, tools, checkpointer).
  • Extend sync checkpointer/store providers to accept app_config and maintain per-config cached instances (plus cleanup).
  • Add regression tests ensuring explicit app_config bypasses ambient get_app_config() lookups for the sync checkpointer and client wiring.

Reviewed changes

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

Show a summary per file
File Description
backend/packages/harness/deerflow/client.py Threads self._app_config into model/tool/prompt/middleware/checkpointer creation paths.
backend/packages/harness/deerflow/runtime/checkpointer/provider.py Adds app_config parameter support and unified database.* fallback when checkpointer isn’t configured.
backend/packages/harness/deerflow/runtime/store/provider.py Adds app_config parameter support and per-config caching + cleanup for the sync store.
backend/tests/test_client.py Adds a regression test asserting app_config is passed into client dependencies during agent creation.
backend/tests/test_checkpointer.py Adds regression tests ensuring explicit app_config bypasses ambient config loading and supports unified DB sqlite backend.

Comment on lines +112 to +117
def _build_store_from_app_config(app_config: AppConfig) -> tuple[BaseStore, object | None]:
if app_config.checkpointer is not None:
ctx = _sync_store_cm(app_config.checkpointer)
return ctx.__enter__(), ctx

return _default_in_memory_store(), None
Comment on lines +217 to 223
resolved_app_config = app_config or get_app_config()
if resolved_app_config.checkpointer is None:
yield _default_in_memory_store()
return

with _sync_store_cm(config.checkpointer) as store:
with _sync_store_cm(resolved_app_config.checkpointer) as store:
yield store
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.

2 participants