Skip to content

fix(sdk): parse git URLs consistently across schemes and suffixes - #6379

Merged
VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/git-url-parsing
Nov 2, 2026
Merged

VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/git-url-parsing

Conversation

@yftx293

@yftx293 yftx293 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

Fixed the git URL parsing from #6348. I reviewed the diff and the tests; every accepted source should parse to the same repository regardless of how its URL is spelled.


AGENT:

Why

Three URL spellings were mis-parsed:

  • ssh://git@host:2222/org/repo.git was not recognised as a git URL at all (is_git_url knew user@host:path but not the ssh:// scheme), so a standard clone URL was rejected as unparseable.
  • github:owner/repo.git gained a second suffix (repo.git.git), because the shorthand appended .git unconditionally.
  • https://github.com/owner/repo.git/ also gained a second suffix, because normalize_git_url checked .git before stripping the trailing slash.

Summary

  • Recognise ssh:// in is_git_url.
  • Drop an existing .git suffix before adding one in the github: shorthand, and strip the trailing slash before the suffix check in normalize_git_url.
  • Port the pinned tests test_parse_ssh_scheme_url, test_parse_github_shorthand_with_git_suffix and test_parse_https_url_with_git_suffix_and_trailing_slash from the worktree-test-edge-cases branch (commit f2fcf6e) without their xfail(strict=True) markers, per the [Bug]: Edge-case tests expose ~70 bugs across the SDK, agent server, tools and workspaces #6348 menu's acceptance criteria.

Issue Number

Part of #6348 (menu sub-items: "is_git_url does not recognise the ssh:// scheme", "the github: shorthand appends .git unconditionally", "normalize_git_url checks the .git suffix before stripping a trailing slash")

How to Test

uv run pytest tests/sdk/extensions/test_fetch.py -k "ssh_scheme or git_suffix"

Before this change all three fail (two produce repo.git.git, one rejects the URL); after, all three pass and tests/sdk/extensions/ is 166 passed. tests/sdk/git/ has 21 pre-existing failures on Windows at this commit (git diff CRLF handling), identical with and without this change. ruff check/format on the touched files are clean.

Type

  • Bug fix

Notes

None.

@VascoSch92
VascoSch92 enabled auto-merge (squash) November 2, 2026 17:52
@VascoSch92
VascoSch92 merged commit 7d610c6 into OpenHands:main Nov 2, 2026
39 checks passed
onatozmenn added a commit to onatozmenn/software-agent-sdk that referenced this pull request Nov 3, 2026
Keep main's .git suffix handling from OpenHands#6379 in parse_extension_source and
drop the duplicate shorthand test, since both already landed on main.

Co-authored-by: openhands <openhands@all-hands.dev>
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.

2 participants