Skip to content

fix(sdk): strip leading slash from glob patterns before matching#1846

Merged
Maahir Sachdev (maahir30) merged 2 commits intomainfrom
leading-slash-fix
Mar 12, 2026
Merged

fix(sdk): strip leading slash from glob patterns before matching#1846
Maahir Sachdev (maahir30) merged 2 commits intomainfrom
leading-slash-fix

Conversation

@maahir30
Copy link
Contributor

  • Glob patterns with a leading / (e.g., /foo/**/*.md) never matched any files because the matching is done against relative paths. pattern.lstrip("/") normalizes the pattern so both sides are consistent.
  • Added two unit tests covering leading-slash patterns.

@github-actions github-actions bot added deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: XS < 50 LOC labels Mar 12, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title fix: strip leading slash from glob patterns before matching fix(sdk): strip leading slash from glob patterns before matching Mar 12, 2026
Copy link
Collaborator

@eyurtsev Eugene Yurtsev (eyurtsev) left a comment

Choose a reason for hiding this comment

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

Do we have a test for composite backend?

@github-actions github-actions bot added size: S 50-199 LOC and removed size: XS < 50 LOC labels Mar 12, 2026
@maahir30 Maahir Sachdev (maahir30) merged commit 073893c into main Mar 12, 2026
27 checks passed
@maahir30 Maahir Sachdev (maahir30) deleted the leading-slash-fix branch March 12, 2026 20:27
james8814 pushed a commit to james8814/deepagents that referenced this pull request Mar 13, 2026
…gchain-ai#1846)

- Glob patterns with a leading `/` (e.g., `/foo/**/*.md`) never matched
any files because the matching is done against relative paths.
`pattern.lstrip("/")` normalizes the pattern so both sides are
consistent.
- Added two unit tests covering leading-slash patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants