Skip to content

[codex] structure workspace search failures#3352

Merged
juliusmarminge merged 3 commits into
mainfrom
codex/structure-workspace-search-errors
Jun 20, 2026
Merged

[codex] structure workspace search failures#3352
juliusmarminge merged 3 commits into
mainfrom
codex/structure-workspace-search-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • capture thrown FileFinder create/search/scan failures as typed errors with exact causes
  • add query and effective page-size context to search failures
  • retain compatibility reason details while keeping domain messages independent of opaque failure text

Verification

  • vp test apps/server/src/workspace/WorkspaceSearchIndex.test.ts (2 tests)
  • vp check (passes with 20 pre-existing warnings)
  • vp run typecheck

Sensitive-context follow-up\n- workspace search failures retain query length and effective page size rather than the raw query\n- cwd, reason, and exact thrown cause behavior remain unchanged


Note

Low Risk
Localized error-handling and observability changes in workspace search; behavior on success is unchanged aside from shorter public error messages.

Overview
Workspace search index errors are now typed and safer to log. FileFinder.create, mixedSearch, scanFiles, and isScanning are wrapped in Effect.try so thrown failures become tagged errors with an optional cause; native ok: false results still set reason but leave cause unset.

Search failures carry queryLength and pageSize instead of the query string, and user-facing message strings no longer embed reason (details stay on the error fields). waitForScan is generalized with an onFailure hook so create vs refresh can map isScanning throws to the right error type.

New Effect/Vitest coverage asserts cause preservation, returned-error handling, and that secrets in queries never appear on errors or messages.

Reviewed by Cursor Bugbot for commit 897e185. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Structure workspace search failures by catching raw exceptions as typed errors

  • Wraps FileFinder.create, mixedSearch, scanFiles, and isScanning in Effect.try so unexpected thrown exceptions are converted into WorkspaceSearchIndexCreateFailed, WorkspaceSearchIndexSearchFailed, or WorkspaceSearchIndexRefreshFailed instead of propagating as raw defects.
  • Adds optional cause field to all three error classes, and adds queryLength/pageSize fields to WorkspaceSearchIndexSearchFailed for contextual debugging.
  • Removes the internal reason detail from error message getters so sensitive query content is not exposed in error messages.
  • Adds tests in WorkspaceSearchIndex.test.ts covering error shaping, cause inclusion/exclusion, and message sanitization for create, search, and refresh operations.
  • Behavioral Change: error messages for all three failure types are now generic (no reason text); exceptions that previously escaped as defects are now surfaced as structured typed errors.

Macroscope summarized 897e185.

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Jun 20, 2026
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5b7f4370-ccaa-48ee-845c-88fedcf477e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/structure-workspace-search-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds structured error handling around native FileFinder calls, wrapping potential exceptions in typed errors with diagnostic context. The changes are defensive improvements to error reporting with no functional behavior changes beyond better exception handling.

You can customize Macroscope's approvability policy. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 15:14

Dismissing prior approval to re-evaluate cdf3c1a

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/structure-workspace-search-errors branch from cdf3c1a to ecaab88 Compare June 20, 2026 15:27
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 16:10

Dismissing prior approval to re-evaluate 897e185

@juliusmarminge
juliusmarminge merged commit c8454ad into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/structure-workspace-search-errors branch June 20, 2026 19:01
sukar0972 pushed a commit to sukar0972/moreCode that referenced this pull request Jun 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit c8454ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant