fix: thread app config through client and sync providers#2688
Open
greatmengqi wants to merge 1 commit into
Open
fix: thread app config through client and sync providers#2688greatmengqi wants to merge 1 commit into
greatmengqi wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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_configthroughDeerFlowClientagent construction (model, middleware, prompt, tools, checkpointer). - Extend sync checkpointer/store providers to accept
app_configand maintain per-config cached instances (plus cleanup). - Add regression tests ensuring explicit
app_configbypasses ambientget_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 |
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
AppConfigthrough model, prompt, middleware, tools, and checkpointer compositionapp_configsupport to sync checkpointer/store providers instead of forcing global config lookupTesting