Repository navigation
feat(agentstudio): add providers commands via official SDK - #290
Open
cmarguta-alg wants to merge 2 commits into
Open
cmarguta-alg wants to merge 2 commits into
cmarguta-alg wants to merge 2 commits into
Conversation
Sibling module under agentstudio. Create and update are deferred because they handle provider secrets. Co-authored-by: Cursor <cursoragent@cursor.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 85 |
| Duplication | 79 |
TIP This summary will be updated as you push new changes.
Author
|
Status: 🟢 pass · 🔴 fail · 🟡 inconclusive (unable to test full functionality due to missing required data) Personal QA Agent — retest of #290 (
|
| Check | Status | Notes |
|---|---|---|
task build |
🟢 | |
go test ./pkg/cmd/providers/... ./pkg/cmd/agentstudio ./pkg/cmd/root -count=1 |
🟢 | Includes create/update packages |
| Subcommands list/get/create/update/delete/models | 🟢 | Completion matches |
Scenario 1 create --json with a dummy apiKey |
🟡 | API 422 Invalid API key provided. No real LLM key in env, so a successful create of a new provider was not run |
Scenario 1 list / get / catalog models |
🟢 | Prior run + this run. After delete, list is empty with pagination 1/20 |
Scenario 1 models <provider-id> |
🟢 | Prior run against Anthropic (14 model names) |
Scenario 2 update --name then --json '{"name":…}' |
🟢 | Renamed Anthropic → qa-pr290-renamed → restored Anthropic. providerName stayed anthropic |
Scenario 2 rotate input.apiKey via --json |
🟡 | Same as create: dummy key is rejected; no live key to rotate to |
Create/update validation (missing --json, invalid JSON, missing name/input, bad providerName, --json+--name, empty {}) |
🟢 | |
Scenario 3 delete without --confirm in non-TTY |
🟢 | Confirm required; get still succeeded |
Scenario 3 delete --confirm while an agent still referenced the provider |
🟢 | API 422 Cannot delete provider because it is still used by the following agents: renamed-bot. CLI surfaces it |
Scenario 3 delete --confirm after that agent was removed |
🟢 | Exit 0; subsequent get 404; list empty |
| Interactive delete prompt | 🟡 | Non-TTY; --confirm / -y tested |
Leftover agent renamed-bot was deleted only so provider delete could complete. App now has 0 providers.
Security / DX notes (not 🔴)
--jsonputs the LLM key on argv (shell history). Matches the PR warning.list/getstill printinput.apiKey(short/masked string in this API).- Dummy keys are rejected at create time (422), so we could not leave a throwaway provider to delete instead of the real one.
— Personal QA Agent
Create takes the full provider object (name, providerName, input). Update patches name and/or input; provider type cannot change. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Adds
algolia agentstudio providersso you can list, get, create, update, delete, and inspect models for Agent Studio LLM providers through the official Go SDK.🤷 Why
#289 shipped agents and #288 shipped conversations. Providers is the next sibling under
agentstudio. Create/update take an inline--jsonobject becauseinputvaries by provider type (apiKey,baseUrl, Azure fields).🔍 How
algolia agentstudio providerswith list/get/create/update/delete/models.createrequires--json(name,providerName,input).updatetakes--nameor a JSON patch (nameand/orinput).providerNamecannot be patched.modelswith no args lists models by provider type.models <provider-id>lists models for that configured provider.deleterequires--confirmoff TTY.IDs in examples are UUID-shaped. No file reads. Anthropic keys must be workspace-scoped; Agent Studio does not send
anthropic-workspace-id.🧪 Testing
Stacked on #288. Merge #289 then #288 first, or check out this branch which includes them.
Reads need
settings. Writes neededitSettings(admin keys skip the CLI ACL check). Replace<APP_ID>with an Agent Studio app. Provider IDs are UUIDs. Pass--application-idif the selected profile app does not resolve. Anthropic keys must be scoped to a single workspace.Quick checks
task build go test ./pkg/cmd/providers/... ./pkg/cmd/agentstudio ./pkg/cmd/root -count=1 ./algolia agentstudio providers --help ./algolia agentstudio providers create --help ./algolia agentstudio providers update --helpExpect tests green,
providersbesideagentsandconversations, and subcommandslist,get,create,update,delete,models.Scenario 1 — create, list, get, models
Action: create a provider, then list/get/models.
Expectation:
createreturns JSON withidandproviderName: "openai".listincludes that id.getmatches.modelswith no ID is an object keyed by type;models <provider-id>is a JSON array of model names.Scenario 2 — update name and input
Action: rename, then rotate the key.
Expectation: first update changes
name. Second accepts the newinput.getshows the new name.providerNameis unchanged.Scenario 3 — delete confirmation (failure mode)
Action: delete without
--confirmin a non-TTY, then with--confirm.Expectation: the first command errors with
--confirm required when non-interactive shell is detectedand the provider still exists. The second exits 0.getthen fails because the provider is gone.lw-oct-agent-studio-2).--jsonwill contain an API key; avoid committing real keys.