fix(clawhub): forward ownerHandle on install to resolve ambiguous slugs (#1284) - #1285
Closed
andyst-dev wants to merge 1 commit into
Closed
andyst-dev wants to merge 1 commit into
andyst-dev wants to merge 1 commit into
Conversation
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.
Fixes #1284
Problem
The ClawHub skill installer cannot install any skill whose slug is shared by more than one publisher. ClawHub's
/api/v1/downloadreturns409 Conflictfor ambiguous slugs unless anownerHandleis supplied, butClawHubInstallRequestonly carriedslug, soPOST /api/clawhub/installalways failed for e.g.weather(4 publishers).Fix
Thread an optional publisher handle through the whole install path:
ClawHubInstallRequestgainsowner_handle: Option<String>— accepts bothownerHandle(what the UI/ClawHub api surface uses) andowner_handle, defaulting toNonefor legacy slug-only installs.ClawHubClient::install_with_owner_handleandinstall_with_optionsnow take an optional owner and build the download URL with&ownerHandle=<handle>appended when present (URL-encoded, empty string treated as absent → identical to current behaviour for unique slugs).clawhub_installroute forwardsreq.owner_handleso the dashboard can disambiguate.Tests
crates/openfang-api/src/types.rs: parses bothownerHandleandowner_handle, and legacy slug-only request still defaults toNone.crates/openfang-skills/src/clawhub.rs:clawhub_download_urlbuilds the plain URL when no owner, appends&ownerHandle=when present, and skips an empty owner.cargo build -p openfang-skills -p openfang-api --lib: clean.cargo test -p openfang-skills -p openfang-api --lib clawhub: 13 passed (2 new in api, 11 in skills incl. 3 new URL cases).Note: this is the same direction as my earlier #1274 (closed, never merged) but it also wires the API route, which #1274 omitted — the write-up in #1284's repro (
POST /api/clawhub/installreturning 409) only works once the route forwards the handle. If a maintainer rejects ambiguity-disambiguation entirely, this can be dropped; otherwise it completes the loop the UI needs.