Skip to content

fix(index): resolve workspace_root for IndexMcpServer registration#6134

Merged
bug-ops merged 1 commit into
mainfrom
fix/6129-index-workspace-root-silently
Jul 12, 2026
Merged

fix(index): resolve workspace_root for IndexMcpServer registration#6134
bug-ops merged 1 commit into
mainfrom
fix/6129-index-workspace-root-silently

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • apply_code_retrieval (src/agent_setup.rs) hardcoded std::env::current_dir() when registering IndexMcpServer, silently ignoring [index] workspace_root whenever index.mcp_enabled = true — unlike the sibling apply_code_indexer (background indexer/watcher) path, which resolved workspace_root correctly.
  • Extracted the existing resolution logic into a shared resolve_workspace_root(config: &IndexConfig) -> PathBuf helper so both call sites now resolve workspace_root identically (config value when set, current_dir() fallback only when unset).
  • Added 2 unit tests covering both branches of the helper.

Closes #6129

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 13064 passed, 0 failed
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • Targeted regression: 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.md updated (row 687, IndexMcpServer)

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
@github-actions github-actions Bot added documentation Improvements or additions to documentation bug Something isn't working size/M Medium PR (51-200 lines) labels Jul 12, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 12, 2026 13:58
@bug-ops
bug-ops merged commit 40aa604 into main Jul 12, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6129-index-workspace-root-silently branch July 12, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index.workspace_root silently ignored when index.mcp_enabled=true

1 participant