Skip to content

fix(extensions): match github: source scheme case-insensitively - #4117

Draft
jpshackelford wants to merge 1 commit into
mainfrom
fix/github-scheme-case-insensitive
Draft

fix(extensions): match github: source scheme case-insensitively#4117
jpshackelford wants to merge 1 commit into
mainfrom
fix/github-scheme-case-insensitive

Conversation

@jpshackelford

@jpshackelford jpshackelford commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

parse_extension_source() matches the GitHub shorthand scheme case-sensitively (source.startswith("github:")). Mobile keyboards and browser autocapitalization frequently turn a typed github:owner/repo into Github:owner/repo (or GitHub: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 as SourceType.LOCAL. Fetching then fails with a confusing Local 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 the owner/repo remainder verbatim (repo names and refs are case-sensitive, so a blanket .lower() would be wrong).

if source[:7].lower() == "github:":
    repo_path = source[7:]
    ...

Tests

Added regression tests to tests/sdk/extensions/test_fetch.py:

  • test_parse_github_shorthand_case_insensitive_schemeGithub: / GitHub: / GITHUB: all classify as GITHUB -> https://github.com/owner/repo.git
  • test_parse_github_shorthand_preserves_remainder_caseGitHub:Owner/RepoName preserves Owner/RepoName case

Full 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

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:243fe1e-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-243fe1e-python \
  ghcr.io/openhands/agent-server:243fe1e-python

All tags pushed for this build

ghcr.io/openhands/agent-server:243fe1e-golang-amd64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-golang-amd64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-golang-amd64
ghcr.io/openhands/agent-server:243fe1e-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:243fe1e-golang-arm64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-golang-arm64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-golang-arm64
ghcr.io/openhands/agent-server:243fe1e-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:243fe1e-java-amd64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-java-amd64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-java-amd64
ghcr.io/openhands/agent-server:243fe1e-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:243fe1e-java-arm64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-java-arm64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-java-arm64
ghcr.io/openhands/agent-server:243fe1e-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:243fe1e-python-amd64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-python-amd64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-python-amd64
ghcr.io/openhands/agent-server:243fe1e-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:243fe1e-python-arm64
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-python-arm64
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-python-arm64
ghcr.io/openhands/agent-server:243fe1e-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:243fe1e-golang
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-golang
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-golang
ghcr.io/openhands/agent-server:243fe1e-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:243fe1e-java
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-java
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-java
ghcr.io/openhands/agent-server:243fe1e-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:243fe1e-python
ghcr.io/openhands/agent-server:243fe1e20b9910dd768edf55d76583a99c4ac898-python
ghcr.io/openhands/agent-server:fix-github-scheme-case-insensitive-python
ghcr.io/openhands/agent-server:243fe1e-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim

About Multi-Architecture Support

  • Each variant tag (e.g., 243fe1e-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 243fe1e-python-amd64) are also available if needed

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>
@github-actions

Copy link
Copy Markdown
Contributor

Python API breakage checks — ✅ PASSED

Result:PASSED

Action log

@github-actions

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result:PASSED

Action log

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL35788999072% 
report-only-changed-files is enabled. No files were changed during this commit :)

@all-hands-bot

Copy link
Copy Markdown
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.

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.

3 participants