fix(extensions): match github: source scheme case-insensitively - #4117
Draft
jpshackelford wants to merge 1 commit into
Draft
fix(extensions): match github: source scheme case-insensitively#4117jpshackelford wants to merge 1 commit into
jpshackelford wants to merge 1 commit into
Conversation
Mobile keyboards and browser autocapitalization frequently turn a typed "github:owner/repo" into "Github:owner/repo" / "GitHub:owner/repo". The case-sensitive scheme check in parse_extension_source() missed those, so the source fell through to the relative-local-path branch (it contains "/" and no "://") and failed later with a confusing "path does not exist" error. Match the github: scheme case-insensitively while preserving the owner/repo remainder verbatim (repo names are case-sensitive). Adds regression tests for mixed-case schemes and remainder-case preservation. Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
Contributor
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Contributor
Collaborator
|
[Automatic Post]: It has been a while since there was any activity on this PR. @jpshackelford, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. This comment was created by an AI agent (OpenHands) on behalf of the user. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
parse_extension_source()matches the GitHub shorthand scheme case-sensitively (source.startswith("github:")). Mobile keyboards and browser autocapitalization frequently turn a typedgithub:owner/repointoGithub:owner/repo(orGitHub:owner/repo).Because the capitalized form misses the
github:branch, it falls through to the relative-local-path branch (it contains/and no://) and is misclassified asSourceType.LOCAL. Fetching then fails with a confusingLocal extension path does not exist: …/Github:owner/repo— giving the user no hint that capitalization was the real problem.Fix
Match the
github:scheme case-insensitively, normalizing only the scheme token and preserving theowner/reporemainder verbatim (repo names and refs are case-sensitive, so a blanket.lower()would be wrong).Tests
Added regression tests to
tests/sdk/extensions/test_fetch.py:test_parse_github_shorthand_case_insensitive_scheme—Github:/GitHub:/GITHUB:all classify asGITHUB->https://github.com/owner/repo.gittest_parse_github_shorthand_preserves_remainder_case—GitHub:Owner/RepoNamepreservesOwner/RepoNamecaseFull file passes:
43 passed.Related
This is the backend/root-cause half of a two-part fix. The frontend trigger (the marketplace source input allowing autocapitalization) is fixed in a companion PR: OpenHands/OpenHands#15273. The two layers are complementary — this parser fix protects every entry path (paste, deep-links, marketplace catalog entries, API callers), while the frontend PR stops the mangling at the source for the specific field users reported.
This PR was created by an AI agent (OpenHands) on behalf of the user.
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:243fe1e-pythonRun
All tags pushed for this build
About Multi-Architecture Support
243fe1e-python) is a multi-arch manifest supporting both amd64 and arm64243fe1e-python-amd64) are also available if needed