Skip to content

fix(search): hosted results are rooted at the session's checkout, not the first machine's folder - #168

Merged
escott- merged 1 commit into
mainfrom
fix/hosted-search-checkout-root
Oct 12, 2026
Merged

escott- merged 1 commit into
mainfrom
fix/hosted-search-checkout-root

Conversation

@escott-

@escott- escott- commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Problem

Hosted search showed every hit under another machine's folder. On a machine where the contextstream checkout is /data/dev/maker/contextstream, results came back as /home/core/dev/maker/contextstream/..., and local_enrichment reported missing_root for /home/core/dev/maker/contextstream.

scoped_session_folder_path (mcp-tools/src/domains/search.rs) keeps the session's folder only when the local folder mapping or the local index names the project being searched. A hosted gateway can read neither, so it dropped the folder, and resolve_effective_folder_path fell back to the project's stored path: the folder of whichever machine first indexed the project.

Change

scoped_session_folder_path also accepts the project init resolved for the session's folder (state.project_id). A session scoped to a different project still never roots results; test_scoped_session_folder_path_ignores_cross_project_session_root still covers that.

Verification

  • New test test_hosted_session_folder_roots_results_for_its_own_project: the session folder wins over a stored root from another machine.
  • cargo clippy -p mcp-tools --all-targets -- -D warnings: clean.
  • cargo test -p mcp-tools: 1576 + 6 pass.

Related: #167 (the bridge never syncing checkouts on hosted machines). Same incident, separate change.

Owner decision cc199133 holds mcp-server releases until the Agent Coach Kit work is done.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

… the first machine's folder

On a hosted gateway, search dropped the folder the session named in init
unless a local mapping or index on the gateway named the project, which a
hosted gateway can never read. Results were then rooted at the project's
stored path, the folder of whichever machine first indexed it: on a machine
with the checkout at /data/dev/maker/contextstream every hit came back as
/home/core/dev/maker/contextstream/... and local enrichment reported
missing_root for that folder.

scoped_session_folder_path also accepts the project init resolved for the
session's folder (state.project_id). A session scoped to another project
still never roots results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@escott-
escott- merged commit df67c10 into main Oct 12, 2026
0 of 9 checks passed
@escott-
escott- deleted the fix/hosted-search-checkout-root branch October 12, 2026 21:48
escott- added a commit that referenced this pull request Oct 12, 2026
901a2fc named the private API crate's route file in a test comment, and
#168 used developer checkout paths (/data/dev/maker/..., /home/core/dev/
maker/...) in a search test. public_boundary.py rejects both, so the
release gate failed on main. The comment now says the routes come from
the API's v1 route table, and the test uses /srv/checkouts/acme-web and
/home/first-machine/src/acme-web. The assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: escott- <escott05@gmail.com>
escott- added a commit that referenced this pull request Oct 12, 2026
Bumps the workspace, npm package, MCP Registry metadata and the boundary
self-test to 1.0.21. Adds the 1.0.21 changelog: the hosted gateway no
longer reads or writes its own disk for a caller's path (339f5d5) and
never replaces its own binary (ddcae54); per-request tool surfaces on the
gateway (5c42d4b); hosted search rooted at the session's checkout (#168);
the hooks lose the hidden attribution block (4879e0b); the sync bridge
links the checkouts agents work in (#167); entity visibility, filing and
reply fixes (901a2fc); whole-word skill matching (6bbf26b); stdio resume
and closed-pipe fixes (#166); the setup review-card gap (074c45f); opt-in
coaching turns (053d961; its API route eb4430485 is in the live backend);
and quinn-proto 0.11.19 in Cargo.lock (87d6488). No open PRs were left out.

Checked on ovh-desktop against main 87d6488 plus this change:
- cargo fmt --all --check
- cargo clippy --locked --workspace --all-targets -- -D warnings
- cargo test --locked --workspace --all-targets: 3223 passed, 0 failed,
  21 ignored
- account_connection_smoke: 9 tests
- cargo audit --deny warnings (403 crates, no advisories) and cargo deny
  --locked check (duplicate warnings only)
- on a clean archive: release_contract metadata and resolve-version for
  tag v1.0.21, public_boundary, the four script tests, the adoption and
  grounding tests, npm test (6 passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: escott- <escott05@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant