feat(sdk/go): expose target_uri skill scoping (parity with #2813)#2897
Merged
Merged
Conversation
…#2813) volcengine#2813 promoted account-shared skills (viking://agent/skills) to a first-class, scoped capability and shipped a target_uri param across the Python SDK (all 7 skill methods), the Rust CLI, and the server skills router. The Go SDK skill methods were the only client left without it, so Go adopters cannot scope skill operations to user-vs-agent roots and must drop to Python/CLI. Add an optional TargetURI field to the six skill option structs plus a new DeleteSkillOptions, and thread target_uri through every skill method matching the Python SDK + server placement exactly: - query param: ListSkills, GetSkill, DeleteSkill - JSON body: AddSkill, FindSkills, ValidateSkill, UpdateSkill target_uri is sent only when set (nil omits it), mirroring the Python "if target_uri is not None" semantics and the server default-root fallback. Like the Python SDK, skills send target_uri as-is (no client-side normalization; only find/search normalize). DeleteSkill previously took no options; it now takes a variadic opts ...*DeleteSkillOptions so existing DeleteSkill(ctx, name) callers keep compiling. The change is source-compatible across the module. Adds TestSkillRequestsScopeTargetURI (asserts query-vs-body placement for all 7 methods) and TestSkillRequestsOmitTargetURIWhenUnset (asserts omit for all 7). go test ./... and go vet ./... pass.
qin-ctx
approved these changes
Jun 30, 2026
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.
What
#2813promoted account-shared skills (viking://agent/skills) to a first-class, scoped capability and shipped atarget_uriparameter across:add_skill/list_skills/find_skills/validate_skill/get_skill/update_skill/delete_skill)crates/ov_cli)target_uriThe Go SDK was the only client left without it. Today Go adopters cannot scope skill operations to user-vs-agent roots and have to drop down to Python/CLI to reach account-shared skills.
This PR brings the Go SDK to parity.
Change
Adds an optional
TargetURI anyfield to the six skill option structs plus a newDeleteSkillOptions, and threadstarget_urithrough every skill method matching the Python SDK + server placement exactly:ListSkills,GetSkill,DeleteSkillAddSkill,FindSkills,ValidateSkill,UpdateSkilltarget_uriis sent only when set (anilTargetURIomits it), mirroring the Python SDK'sif target_uri is not Nonesemantics and the server's default-root fallback (_agent_skills_roottreats absent/empty as the default root). The field type matches the existingTargetURI anyconvention already used byFindOptions/SearchOptionsintypes.go.Note: unlike retrieval
Find/Search(which client-side normalize vianormalizeTarget), the skills methods sendtarget_urias-is and let the server resolve it — this matches the Python SDK in#2813exactly (skill methods passtarget_uriraw; onlyfind/searchcall_normalize_target_uri).DeleteSkillpreviously took no options. To carry the scope without breaking existingDeleteSkill(ctx, name)callers, it now takes a variadicopts ...*DeleteSkillOptions(only the first value is used); the other six methods gainTargetURIas a plain additive struct field. So the change is source-compatible — no existing call site needs to change.Verification
TestSkillRequestsScopeTargetURIasserts query-vs-body placement oftarget_urifor all 7 methods.TestSkillRequestsOmitTargetURIWhenUnsetassertstarget_uriis omitted (no body key / no query param) for all 7 methods when unset, so existing callers are unaffected.go test ./...andgo vet ./...pass;gofmtclean.Per-method transport (query vs body) was verified against the server router so the chosen location is the one the server actually reads, not an assumption —
openviking/server/routers/skills.py:FindSkillsRequest.target_uri,ValidateSkillRequest.target_uri,UpdateSkillRequest.target_uri, andaddreads it from the request body (matching Pythonadd_skill'srequest_data)list_skills,get_skill,delete_skilltaketarget_uri: Optional[str] = Noneas a query parameterField names were verified against live
main(sdk/go/types.go,sdk/go/skills.go) and the merged#2813Python diff — not guessed.