Skip to content

fix(agent-server): prioritize source workspace results - #1961

Open
dvd233 wants to merge 1 commit into
bytedance:mainfrom
dvd233:fix/contextual-selector-source-priority
Open

fix(agent-server): prioritize source workspace results#1961
dvd233 wants to merge 1 commit into
bytedance:mainfrom
dvd233:fix/contextual-selector-source-priority

Conversation

@dvd233

@dvd233 dvd233 commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Addresses the workspace search ordering bug reported in #1100.

When both source files and generated output match a contextual-selector query, source results under a src path segment are now ranked first before applying the existing relevance ordering and result limit. This prevents a large dist directory from pushing the source file out of the default 20 results.

Generated artifacts remain searchable:

  • Queries that explicitly target dist keep the existing relevance ordering.
  • Searches without a matching source result also keep the existing relevance ordering.

This PR intentionally covers only the ordering bug from #1100. It does not implement the separate AgentOptions switch for gitignored files mentioned under "Other", so it does not automatically close the issue.

Test plan

  • Added 3 workspace-search regression tests: source priority under the 20-result limit, explicit dist queries, and no-source relevance preservation.
  • Regression test fails on origin/main as expected (1 failed, 2 passed) and passes on this branch (3 passed).
  • Agent server tests excluding the unrelated baseline SQLite fixture: 44 passed.
  • tsc --noEmit -p tsconfig.json.
  • pnpm --dir multimodal --filter @tarko/agent-server build on Node 24 / pnpm 9.10.0. The build retains the existing optional MongoDB gcp-metadata warning.

The full suite's 19 SQLite tests already fail identically on origin/main under Windows because the shared test setup combines a mocked /tmp prefix with an absolute Windows temp path; this change does not touch SQLite storage.

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

@netlify

netlify Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 923675e
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/6a962e30d9996f0008d3566c
😎 Deploy Preview https://deploy-preview-1961--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit 923675e
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/6a962e30ff8d4c0008429c96
😎 Deploy Preview https://deploy-preview-1961--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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