Skip to content

feat(sdk/go): expose target_uri skill scoping (parity with #2813)#2897

Merged
qin-ctx merged 1 commit into
volcengine:mainfrom
r266-tech:feat/gosdk-skills-target-uri
Jun 30, 2026
Merged

feat(sdk/go): expose target_uri skill scoping (parity with #2813)#2897
qin-ctx merged 1 commit into
volcengine:mainfrom
r266-tech:feat/gosdk-skills-target-uri

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

What

#2813 promoted account-shared skills (viking://agent/skills) to a first-class, scoped capability and shipped a target_uri parameter across:

  • the Python SDK — all 7 skill methods (add_skill/list_skills/find_skills/validate_skill/get_skill/update_skill/delete_skill)
  • the Rust CLI (crates/ov_cli)
  • the server skills router — every endpoint accepts target_uri

The 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 any field to the six skill option structs plus a new DeleteSkillOptions, and threads target_uri through every skill method matching the Python SDK + server placement exactly:

Method Transport
ListSkills, GetSkill, DeleteSkill query param
AddSkill, FindSkills, ValidateSkill, UpdateSkill JSON body

target_uri is sent only when set (a nil TargetURI omits it), mirroring the Python SDK's if target_uri is not None semantics and the server's default-root fallback (_agent_skills_root treats absent/empty as the default root). The field type matches the existing TargetURI any convention already used by FindOptions/SearchOptions in types.go.

Note: unlike retrieval Find/Search (which client-side normalize via normalizeTarget), the skills methods send target_uri as-is and let the server resolve it — this matches the Python SDK in #2813 exactly (skill methods pass target_uri raw; only find/search call _normalize_target_uri).

DeleteSkill previously took no options. To carry the scope without breaking existing DeleteSkill(ctx, name) callers, it now takes a variadic opts ...*DeleteSkillOptions (only the first value is used); the other six methods gain TargetURI as a plain additive struct field. So the change is source-compatible — no existing call site needs to change.

Verification

  • New TestSkillRequestsScopeTargetURI asserts query-vs-body placement of target_uri for all 7 methods.
  • New TestSkillRequestsOmitTargetURIWhenUnset asserts target_uri is omitted (no body key / no query param) for all 7 methods when unset, so existing callers are unaffected.
  • go test ./... and go vet ./... pass; gofmt clean.

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:

  • body: FindSkillsRequest.target_uri, ValidateSkillRequest.target_uri, UpdateSkillRequest.target_uri, and add reads it from the request body (matching Python add_skill's request_data)
  • query: list_skills, get_skill, delete_skill take target_uri: Optional[str] = None as a query parameter

Field names were verified against live main (sdk/go/types.go, sdk/go/skills.go) and the merged #2813 Python diff — not guessed.

…#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 qin-ctx merged commit 11b2b63 into volcengine:main Jun 30, 2026
2 of 3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants