fix(index): resolve workspace_root for IndexMcpServer registration#6134
Merged
Conversation
apply_code_retrieval hardcoded std::env::current_dir() for the IndexMcpServer registration path, ignoring [index] workspace_root entirely, while the sibling apply_code_indexer path resolved it correctly. Extracted the existing resolution logic into a shared resolve_workspace_root helper so both call sites resolve workspace_root identically. Closes #6129
bug-ops
enabled auto-merge (squash)
July 12, 2026 13:58
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
apply_code_retrieval(src/agent_setup.rs) hardcodedstd::env::current_dir()when registeringIndexMcpServer, silently ignoring[index] workspace_rootwheneverindex.mcp_enabled = true— unlike the siblingapply_code_indexer(background indexer/watcher) path, which resolvedworkspace_rootcorrectly.resolve_workspace_root(config: &IndexConfig) -> PathBufhelper so both call sites now resolveworkspace_rootidentically (config value when set,current_dir()fallback only when unset).Closes #6129
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 13064 passed, 0 failedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"cargo nextest run -p zeph --features "desktop,ide,server,chat,pdf,scheduler" --bins -E 'test(apply_code_retrieval) or test(apply_code_indexer) or test(resolve_workspace_root)'— 7/7 passed.local/testing/coverage-status.mdupdated (row 687, IndexMcpServer)