Skip to content

fix(install): record a per-skill source every host can install again - #863

Merged
runkids merged 2 commits into
mainfrom
runkids/fix-discovery-source-roundtrip
Nov 11, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/fix-discovery-source-roundtrip

Conversation

@runkids

@runkids runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Closes #859

What and why

install <repo> -s <skill> records one source string per skill. Project mode shares that string through .skillshare/config.yaml, and install -p on another machine parses it again. The string was built by joining the repository and the skill path with a single /, which the parser cannot split on every host:

  • GitLab and Bitbucket paths have no fixed depth, so without .git the parser takes every segment as the repository.
  • file:// URLs split only on //.

Bitbucket was not in the issue's table; it fails the same way.

Typed source Recorded before Recorded now
file:///srv/skills file:///srv/skills/x file:///srv/skills//x
https://gitlab.com/team/skills https://gitlab.com/team/skills/x https://gitlab.com/team/skills.git/x
https://bitbucket.org/team/skills https://bitbucket.org/team/skills/x https://bitbucket.org/team/skills.git/x
GitHub, other hosts, sources typed with .git, SSH, web URLs (/-/tree/..., /src/...) unchanged

Agents picked out of a repository use the same builder, so their recorded source changes the same way. AgentRepoSource recovers the repository from both forms.

Consumers of the string that needed to follow:

  • install <repo> -s <skill> --update compares the recorded source to decide whether the folder is the same skill. It still accepts a record in the old form, but only when the recorded repo_url and subdir agree: on these hosts the old string can also name a repository of its own. The next install rewrites the record, and the project config follows it.
  • The dashboard's install dialog rebuilt the old form to mark discovered skills as installed and to leave them unselected. It now accepts each form the server writes.
  • ai_docs/tests/move_installed_skill_runbook.md asserted the old file:// string in two steps.

Tests

  • internal/install: a round-trip test parses 16 typed sources (GitHub, generic host, GitLab with subgroups, a configured gitlab_hosts host, GitLab and Bitbucket web URLs, a Bitbucket workspace named src, Azure DevOps, SSH, file://), builds the per-skill source and parses it back to the same repository, path and branch. A second test covers the old form: accepted for the same repository, refused for a repository installed from the same URL.
  • ui: the install dialog leaves a skill unselected when it is installed under the .git/ form. It failed before the dialog change.
  • make check passes. All UI tests pass (108 files, 884 tests); tsc -b and eslint on the changed files are clean.
  • Manual run of the issue's file:// steps in the devcontainer image: the config records file://.../skills//x and install -p on a fresh clone installs it. A record edited back to the old form is rewritten by install ... -s x --update.

Not run: GitLab and Bitbucket against a real repository (parser tests only), the website build, the move runbook itself, and a dashboard screenshot (logic-only change).

Not covered

  • Records already written in the old form are not repaired by update; it fails for them as it did before this change. Tracked in update fails for skills recorded with a per-skill source the parser cannot split (records from before #859) #862. Running install <repo> -s <skill> --update once rewrites the record.
  • When that rewrite changes the source string of a pinned project skill, its lock pin is taken again.
  • In the dashboard, a source typed without a scheme (gitlab.com/team/skills) still does not match the recorded https:// source. This was the case before this change.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

`install <repo> -s <skill>` joined the repository and the skill path with
a single "/". GitLab and Bitbucket URLs have no fixed depth, so the parser
read the result as a longer repository path, and file:// URLs only split
on "//". The recorded string is what a project's config.yaml shares, so
`install -p` on a fresh clone tried to clone a repository that does not
exist.

Whole-repo file:// sources now join with "//", and GitLab or Bitbucket
sources typed without ".git" or a web URL marker join with ".git/". The
other hosts keep their form.

`install --update` still recognises a record in the old form, but only
when its recorded repository and path agree, because on these hosts the
same string can also name a repository of its own. The dashboard's
install dialog matched installed skills by rebuilding the old form, so it
now accepts each form the server writes.

Closes #859
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:08:49.205601Z b52e12a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e661692aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// GitLab and Bitbucket paths have no fixed depth: without ".git" or a web
// URL marker the parser takes every segment as the repository.
case source.webHost != "" && !strings.HasSuffix(repo, ".git") && !hasWebURLMarker(source.webHost, repo):
return repo + ".git/" + skillPath

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update hub-result matching for the new recorded source format

For a supported Hub entry with source https://gitlab.com/team/skills and skill selector pdf, installing now records https://gitlab.com/team/skills.git/pdf, but InstallDialog.tsx's isInstalledResult still requires an exact source match or a ${source}/ prefix. Neither matches the new format. Consequently, both the search row and preview continue offering Install after installation, and clicking it again attempts a duplicate installation and produces an already-exists warning. Update this consumer alongside the discovery-selection matcher so GitLab and Bitbucket Hub results recognize the new recorded sources.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in b52e12a. The scenario holds: isInstalledResult accepted only an exact source or a <source>/ prefix, so a GitLab or Bitbucket hub entry with a skill selector kept showing Install after the skill was recorded as <source>.git/<skill>.

The matcher now also accepts the .git/ join (the / prefix already covers the // join used for SSH and file://). This is the same class as the discovery-list matcher changed in the first commit; I checked the rest of the dashboard and the Go code and found no other place that matches a recorded source by prefix.

Covered by a new test in ui/src/components/InstallDialog.test.tsx ("shows a hub entry as installed when its skill is recorded under the source the server writes for its host"), which failed before the change.

A hub entry that names a repository and a skill was matched against the
installed skills by an exact source or a "<source>/" prefix. A GitLab or
Bitbucket repository typed without ".git" is now recorded as
"<source>.git/<skill>", so the search row and the preview kept offering
Install, and a second install hit the already-exists warning.

The matcher now accepts the ".git/" join as well. This is the same class
as the discovery list fixed in the previous commit: both rebuild the
recorded source in the dashboard. No other dashboard or Go code matches a
recorded source by prefix.
@runkids

runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: b52e12a437

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids
runkids merged commit 3872cb5 into main Nov 11, 2026
9 checks passed
@runkids
runkids deleted the runkids/fix-discovery-source-roundtrip branch November 11, 2026 15:15
runkids added a commit that referenced this pull request Nov 11, 2026
#861 and #863 added a parseOpts parameter to runCheck and renderAgentCheck, the same functions that take exitCode here. Keep both parameters at every call site.
runkids added a commit that referenced this pull request Nov 11, 2026
…e fix (#866)

Before #863, `install <repo> -s <skill>` recorded "<repo>/<path>" as the
skill's source. GitLab, Bitbucket and file:// sources parse that string as
another repository, so every path that parsed the recorded source failed
for those skills: `update` of a single skill, `install <name> --update`,
the dashboard update, and the local-changes diff. #863 only changed what
new installs record.

The record still holds the repository and the path, so RecordedSource
rebuilds the source from them when the written string parses as a
different repository, and the reinstall writes the record back in the
form that parses.

In project mode the config entry that declared the old string follows the
rewritten record, because teammates install from the config. An entry a
teammate changed stays as it is, and so does a record a batch update only
respelled. The config is reloaded first: `update --prune` saves it through
another copy, and saving the stale one brought pruned skills back.

`hub draft` and `hub index` published the old string as it was written;
they now publish the source that installs the skill.

Closes #862
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.

install -s records a per-skill source that GitLab and file:// sources cannot install again

1 participant