fix(cli): reload MCP config after project selection - #966
fix(cli): reload MCP config after project selection#966luantaraschi wants to merge 8216 commits into
Conversation
Source: CodebuffAI/freebuff-private@455596ee766ba73118788120f3ec9e353cbcf153
Source: CodebuffAI/freebuff-private@b1da43dfd83fb07493538a794012650c31a48539
Source: CodebuffAI/freebuff-private@0f2b495d355a0090347dcf2502fa179946ed89b3
Source: CodebuffAI/freebuff-private@648fbe7abb907b73dbbce79e60350545f12f2a5e
Source: CodebuffAI/freebuff-private@5cfb8e29aafd1373ebff2fc729d30c02ded8762e
Source: CodebuffAI/freebuff-private@7b02bcf9edb2e755cde3c6901a4171dac6c1b8c7
Source: CodebuffAI/freebuff-private@29c1c7b1abef99b25fec4cb90c5d6017b2c1c71c
Source: CodebuffAI/freebuff-private@52921bfce62c02c522dbfbd4aaeebb2df65136e7
Source: CodebuffAI/freebuff-private@c28e04fe81c1b7a6eaf13b407cbb145990a5cdaf
Source: CodebuffAI/freebuff-private@5676fb7cbf3d00fd0c9c3538d0259566dc668940
Source: CodebuffAI/freebuff-private@50bac2d3d963004ba6059a2795ff6a35c67381ac
Source: CodebuffAI/freebuff-private@ad1083b367a3fc29a6f612442f9870482a7185bc
Source: CodebuffAI/freebuff-private@c8249b5ccd9a1b2be9379672e92ffef10ff4897f
Source: CodebuffAI/freebuff-private@4b86502de1ed4882f15674ac14f7e84be3d9b58e
Source: CodebuffAI/freebuff-private@c7290ad48d71bb54682bd20d48863b741b35fcfc
Source: CodebuffAI/freebuff-private@2a09095ca7d9326fc5c4d3b3549d4772592711a5
Source: CodebuffAI/freebuff-private@866435ce7c3e6a3a5fc981dc03bed20c6b9c2eb0
Source: CodebuffAI/freebuff-private@84a23adc880c1e23633156dc004110ffecd03593
Source: CodebuffAI/freebuff-private@796b3e0b97cd7ad767e1d1708f597825c4b1c90b
Source: CodebuffAI/freebuff-private@23aaf9ef7774a9c7ed917aeff1cb126e83132468
Source: CodebuffAI/freebuff-private@1d362ea933a1a93f7064d82f4890ec402c2015a8
Source: CodebuffAI/freebuff-private@0dfe68ca3146fef7ece681786a7b6f966e05df57
Source: CodebuffAI/freebuff-private@022a380f3badd9850407e53b2a6a4cb6575f2035
Source: CodebuffAI/freebuff-private@e77ec9b87dba4de75ba19fb254c17fb16d718dc9
Source: CodebuffAI/freebuff-private@1a0b1105f13b283e66e72e5ee646cb99386cfbd1
Source: CodebuffAI/freebuff-private@8c44ea347507795dec3b5044cf5177f76c96d410
Source: CodebuffAI/freebuff-private@c853800b120a14823cc734eb920264d839feb376
Source: CodebuffAI/freebuff-private@ffa95ba73cba74ef367f26740fe81ed06b7a3f85
Source: CodebuffAI/freebuff-private@a89e78c516c43e1cd9b48913e3db8ebd90ab089f
Source: CodebuffAI/freebuff-private@dd137f0f66364db6bd1666c2d1126cb6d9f7e48f
Source: CodebuffAI/freebuff-private@d1b2f0391c7d840ee20faf545ffdce0f9dc67685
Source: CodebuffAI/freebuff-private@a921e43c182e08d16612f2f054b34a34d6cce014
Source: CodebuffAI/freebuff-private@893daab93cdaf672061a81a5be163d7504919208
Source: CodebuffAI/freebuff-private@acf40ca98f1be4ed62c07abb261cfb267dce5364
Source: CodebuffAI/freebuff-private@2fd0ee2c027ea71c2814908aac00e9db07a8da3c
Source: CodebuffAI/freebuff-private@9f88777e422eb21d18fb9497b53228e5c24815b0
Source: CodebuffAI/freebuff-private@40759dcc4e86eea7874d3762dc744e0ac16ca42b
Source: CodebuffAI/freebuff-private@f9d585f7951f6f58bd55527a3474c1c4bb1a3ae3
Source: CodebuffAI/freebuff-private@7b1a370bc0bc45722e94e0cc0ead5ef2e213c62f
Source: CodebuffAI/freebuff-private@67a8bb39d0a85e467e91cb03a9cde41e566d2a01
Source: CodebuffAI/freebuff-private@6282027bf68035afa9da4ad9352ab3a673f197e4
Source: CodebuffAI/freebuff-private@1cae9492a65f772e22fad41d9ec391dcd89a16fc
|
This looks like the stronger fix for #957 because the regression test exercises the actual activateProject() flow and verifies that the selected project's MCP server reaches the base agent definition. PR #973 appears to address the same root cause with overlapping changes. Before merging, could we confirm that this PR also clears every derived local-agent cache that depends on the previous cwd/project root? If yes, I would suggest merging #966 and closing #973 as a duplicate to avoid two competing fixes. |
|
Thanks for catching this. The local agent registry has two derived caches that depend on the previous working directory: I also expanded the regression test to warm the caches in the launch project, switch projects through Validation on the new head (
This incorporates the cache-reset part of #973 while keeping the project-picker coverage in this PR. |
|
Perfect, thanks for the thorough follow-up. Clearing both cwd-dependent caches and testing the full activateProject() transition addresses the concern. The added assertion that the old project's agent is absent is especially valuable. This now seems like the right PR to merge for #957. I’d suggest closing #973 as a duplicate once a maintainer has reviewed this update. |
|
Good catch and clean fix. The root cause is real: The added test in Two things worth double-checking before porting:
No forbidden paths touched, no scope creep — solid, focused bug fix. |
|
Both checked. On the first one, there is no third cache. The module keeps five mutable ones: On the second one, you were right that the skip path had no coverage. Added a test for it: with |
|
Apologies — this PR was auto-closed by GitHub when we force-pushed a history rewrite of this repository (repository maintenance; every commit SHA changed). That was not a judgment on this PR, and GitHub does not allow us to reopen it because the commits it was based on no longer exist in the new history. If you'd like to continue with this change: rebase your branch onto the new Sorry for the churn, and thanks for contributing. |
|
No problem, and thanks for explaining what happened rather than leaving it to look like a silent close. Recreated as #1179, rebased onto |
Summary
.agents/mcp.jsonis loaded before the client is recreated.--agentoverride behavior.Fixes #957
Testing