Fix McpExecutor kag_project_config initialization for MCP HTTP store_…#736
Merged
caszkgui merged 1 commit intoOpenSPG:masterfrom Jan 28, 2026
Merged
Fix McpExecutor kag_project_config initialization for MCP HTTP store_…#736caszkgui merged 1 commit intoOpenSPG:masterfrom
caszkgui merged 1 commit intoOpenSPG:masterfrom
Conversation
whfcarter
approved these changes
Jan 28, 2026
Collaborator
whfcarter
left a comment
There was a problem hiding this comment.
I have reviewed the changes and I am fine with it.
Collaborator
|
LGTM |
caszkgui
approved these changes
Jan 28, 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.
Background
When configuring an external knowledge base with MCP support (e.g. Baidu Map MCP example), the solver uses
mcp_executorto call an MCP tool via a Python script specified bystore_path.In this scenario,
store_pathcan be an HTTP URL (e.g. a hostedmap.pyscript). During runtime, the following error is raised when the MCP tool is invoked:Root cause
In
kag/solver/executor/mcp/mcp_executor.py, the initialization order inMcpExecutor.__init__is:However,
download_data()usesself.kag_project_configwhenstore_pathis an HTTP URL:So when
store_pathstarts withhttp://orhttps://,download_data()is called beforeself.kag_project_configis set, which leads to:Fix
Change the initialization order in
McpExecutor.__init__:KAGConfigAccessor.get_config(...).self.kag_project_config.self.download_data(store_path)so thatdownload_data()can safely useself.kag_project_config.ckpt_dir.In pseudocode:
This ensures that both local paths and HTTP URLs for
store_pathwork correctly.Impact
mcp_executor.store_pathis an HTTP URL.store_pathvalues.How I tested
examples/baiduexample.mcp_executorwith an HTTPstore_pathpointing tomap.py.AttributeError: 'McpExecutor' object has no attribute 'kag_project_config'.