Repository navigation
fix(config): preserve loaded MCP settings - #2193
Merged
assafelovic merged 1 commit intoOct 10, 2026
Merged
Conversation
menotbobbybrown
pushed a commit
to menotbobbybrown/gpt-researcher
that referenced
this pull request
Oct 11, 2026
load_config returned DEFAULT_CONFIG itself (or a shallow copy), so dict and list defaults were shared across every Config. GPTResearcher calls cfg.set_verbose() on init, which wrote {'verbose': ...} into the process-wide DEFAULT_CONFIG['LLM_KWARGS'], leaking one run's setting into all later runs. load_config now returns a deep copy, which also makes the per-list MCP copies from assafelovic#2193 unnecessary.
Co-authored-by: Cursor <[email protected]>
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.
ConfigloadsMCP_SERVERSandMCP_ALLOWED_ROOT_PATHS, then replaces both with empty lists. This makes the stored settings disappear andget_mcp_server_config()return{}for a configured server.Keep the loaded values and shallow-copy the two lists so modifying one default
Configinstance still cannot affect another instance orDEFAULT_CONFIG. Nine regressions cover file/env loading and precedence, explicit empty overrides, named lookup, malformed rows, default-list isolation and the publicGPTResearcher.cfgpath.Fixes #2192.
Validation:
main, the nine new cases give 5 failures and 4 passing controls; all nine pass with the fix.The offline suite used the repository's current command, with its network guard enabled:
On macOS with Homebrew Python 3.14, this command also needed process-only
NO_PROXY='*': the same three existing Nebius constructor tests crash after fork on unchangedmainwithout it. No test or CI flags were changed. Python 3.12/3.13 skip the existing PDF module when WeasyPrint native libraries are unavailable; Python 3.14 runs those cases. The remaining skip is the upstream obsolete security-helper suite, and the four deselections are the existing CI live cases.Live MCP connections and model research were not run; this change restores stored configuration and lookup, without changing automatic server connection or root-path enforcement.