Skip to content

fix(glob): handle absolute patterns across search backends - #1546

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev
Jul 14, 2026
Merged

fix(glob): handle absolute patterns across search backends#1546
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Normalize absolute Glob patterns into a static search directory plus a relative pattern before invoking a backend.
  • Keep local paths outside the workspace on the local rg / walk fallback chain, while preserving Flashgrep for canonical paths inside the workspace.
  • Fall back to local search when local workspace-search fails.
  • Preserve remote workspace containment after normalization and report the effective remote match base.
  • Cover absolute-root extraction and local/remote regression cases.

Type and Areas

Type:

Bug fix / regression fix

Areas:

Rust core, tool execution, workspace search

Motivation / Impact

An absolute pattern such as C:/.../terminal-transcripts/session/*.log was previously passed directly to rg --glob while searching from the workspace, so existing transcript files were reported as missing.

Local absolute patterns now search from their static parent directory. Remote absolute patterns remain constrained to the active remote workspace, and remote shell results report the correct matches_relative_to base for downstream tools.

Verification

  • pnpm run fmt:rs
  • cargo test -p tool-runtime extract_glob_base_directory_preserves_absolute_roots -- --nocapture
  • cargo test -p bitfun-core glob_tool -- --nocapture — 13 passed
  • cargo check --workspace — passed; existing Windows unsafe-operation warnings remain in desktop/WebDriver code
  • git diff --check

Reviewer Notes

  • Local backend order is Flashgrep for paths inside the canonical workspace, then local rg, then the internal walk fallback when rg is unavailable or fails in the supported fallback cases.
  • External local paths intentionally bypass Flashgrep; remote paths are revalidated against the remote workspace before either Flashgrep or shell fallback can run.
  • No migration or compatibility action is required.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above.
  • User-facing Glob guidance and schema copy are updated; no locale resources are involved.

@wsp1911
wsp1911 marked this pull request as ready for review July 14, 2026 07:05
@wsp1911
wsp1911 merged commit 901fdef into GCWing:main Jul 14, 2026
4 checks passed
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