Skip to content

fix(sweep): repo-detection fallback regex also accepts ssh:// github remotes - #2504

Merged
carlos-alm merged 1 commit into
mainfrom
fix/issue-2363-sweep-ssh-remote-regex
Aug 14, 2026
Merged

fix(sweep): repo-detection fallback regex also accepts ssh:// github remotes#2504
carlos-alm merged 1 commit into
mainfrom
fix/issue-2363-sweep-ssh-remote-regex

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Problem

/sweep's repo-slug-detection fallback (.claude/skills/sweep/SKILL.md) only matches git@github.com:owner/repo and https://github.com/owner/repo remote URL forms — it silently rejects ssh://git@github.com/owner/repo, a valid, real-world GitHub remote form. The OLD (buggy, .git-suffix-retaining) regex this replaced happened to accept it too, via a permissive .*github\.com[:/] prefix — so this is a genuine regression, not just a pre-existing gap.

Greptile caught this exact gap on PR #2362 (porting the same fallback pattern into /resolve) and it was fixed there before merge. /sweep — the original source of this pattern (PR #2185) — still has the unfixed version.

Fix

Add ssh://git@github\.com/ as a third alternative in the anchored prefix group, exactly matching /resolve's already-fixed copy:

-     | sed -nE 's#^(git@github\.com:|https://github\.com/)([^/]+/[^/]+)/?$#\2#p' \
+     | sed -nE 's#^(git@github\.com:|https://github\.com/|ssh://git@github\.com/)([^/]+/[^/]+)/?$#\2#p' \

Closes #2363

Test plan

  • Verified all 6 remote URL forms (scp-style SSH, HTTPS, ssh://, each with/without .git suffix) resolve to the correct owner/repo slug via the fixed regex
  • lint-skill.sh shows only pre-existing warnings/errors unrelated to this line (missing frontmatter fields, missing sections — out of scope, not introduced by this change)
  • No source code or test infrastructure covers this markdown-embedded pattern (confirmed by checking PR fix(skills): resolve's repo-detection fallback regex retains .git suffix #2362, which fixed the identical gap in /resolve with no accompanying test) — matches existing precedent

…remotes

The two-pass sed fallback only matched git@github.com: and https://github.com/
remote URL forms, silently rejecting the valid ssh://git@github.com/owner/repo
form that the old, more permissive regex used to accept. Mirrors the same fix
already applied to /resolve's copy of this pattern (PR #2362).

Closes #2363

docs check acknowledged
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends /sweep repository detection to support GitHub remotes using the ssh://git@github.com/owner/repo form.

  • Adds the ssh://git@github.com/ prefix to the fallback regex.
  • Preserves existing handling for SCP-style SSH, HTTPS, optional trailing slashes, and .git suffix removal.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new anchored regex alternative captures the same owner/repository slug shape as the existing HTTPS form, while the following pipeline stage continues to remove an optional .git suffix.

Important Files Changed

Filename Overview
.claude/skills/sweep/SKILL.md The narrowly scoped regex change correctly accepts the additional GitHub SSH URL form without changing existing matches.

Reviews (1): Last reviewed commit: "fix(sweep): repo-detection fallback rege..." | Re-trigger Greptile

@carlos-alm
carlos-alm merged commit 24cce42 into main Aug 14, 2026
43 of 45 checks passed
@carlos-alm
carlos-alm deleted the fix/issue-2363-sweep-ssh-remote-regex branch August 14, 2026 15:38
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

follow-up: /sweep's repo-detection fallback regex also rejects ssh:// GitHub remotes

1 participant