mcpserver: add a save_model_profile admin tool #728

Merged
admin merged 1 commits from mcp/save-model-profile into dev 2026-10-25 04:33:35 +00:00
Owner

Part of #650: the model-profile tool that #721 left out until #722 landed.

save_model_profile (offered with --admin)

It works the same way as the #721 setters:

  • Partial update: it reads the saved profile through ListModelProfiles and changes only the fields given (name, provider, url, model, active). An agent can change a profile's model, or switch the planner to it, without resetting anything else.
  • New profiles: an ID that isn't saved yet starts a new profile. The node still requires a name and a provider.
  • No keys: the tool never takes a key and always sends keep_api_key, as set_model does. The saved key stays while the provider and address stay the same, and has_api_key in the reply shows whether one is set.
  • Masked addresses: the base_url that list_model_profiles returns, with credentials masked since #722, can be given back unchanged. The node then keeps the stored address.

The reply is the node's own ModelProfile, in the same form as the read tools.

Tests

TestAModelProfileIsSavedWithOnlyWhatIsGiven covers:

  • a field change that keeps the rest of the profile
  • an explicit active: false
  • a new profile, saved without a key
  • a node failure on the read and on the save

The fake node refuses any save that doesn't ask to keep the key. The tool count with --admin is now 62, and settings.go is at 100% coverage.

Docs

The tool counts are updated in docs/development.md and apps/sisyphusd/README.md (62 tools, 14 admin). The admin lists in the README and in skills/sisyphus/SKILL.md include the new tool.

Part of #650: the model-profile tool that #721 left out until #722 landed. ## `save_model_profile` (offered with `--admin`) It works the same way as the #721 setters: - **Partial update:** it reads the saved profile through `ListModelProfiles` and changes only the fields given (`name`, `provider`, `url`, `model`, `active`). An agent can change a profile's model, or switch the planner to it, without resetting anything else. - **New profiles:** an ID that isn't saved yet starts a new profile. The node still requires a name and a provider. - **No keys:** the tool never takes a key and always sends `keep_api_key`, as `set_model` does. The saved key stays while the provider and address stay the same, and `has_api_key` in the reply shows whether one is set. - **Masked addresses:** the `base_url` that `list_model_profiles` returns, with credentials masked since #722, can be given back unchanged. The node then keeps the stored address. The reply is the node's own `ModelProfile`, in the same form as the read tools. ## Tests `TestAModelProfileIsSavedWithOnlyWhatIsGiven` covers: - a field change that keeps the rest of the profile - an explicit `active: false` - a new profile, saved without a key - a node failure on the read and on the save The fake node refuses any save that doesn't ask to keep the key. The tool count with `--admin` is now 62, and `settings.go` is at 100% coverage. ## Docs The tool counts are updated in `docs/development.md` and `apps/sisyphusd/README.md` (62 tools, 14 admin). The admin lists in the README and in `skills/sisyphus/SKILL.md` include the new tool.
rvnminers-A-and-N left a comment
Owner

I read this against SaveModelProfile in api/local.go and found nothing to change:

  • Changing the address drops the key. KeepApiKey: true copies the saved key only when sameService holds for the same ID. An admin agent that points an existing profile at another url or provider gets has_api_key: false back, so it can't send the saved key somewhere new.
  • A masked URL round-trips. If the agent leaves url out, the masked base_url from ListModelProfiles goes back unchanged, and modelAddress resolves it to the address the node holds. The tool description says this.
  • Bad input is refused. A new profile with no name or provider fails with InvalidArgument from the API, not from the tool.

The counts add up (28 + 11 + 14 + 9 = 62) in the README, development.md and the test.

I read this against `SaveModelProfile` in `api/local.go` and found nothing to change: - **Changing the address drops the key.** `KeepApiKey: true` copies the saved key only when `sameService` holds for the same ID. An admin agent that points an existing profile at another `url` or provider gets `has_api_key: false` back, so it can't send the saved key somewhere new. - **A masked URL round-trips.** If the agent leaves `url` out, the masked `base_url` from `ListModelProfiles` goes back unchanged, and `modelAddress` resolves it to the address the node holds. The tool description says this. - **Bad input is refused.** A new profile with no name or provider fails with `InvalidArgument` from the API, not from the tool. The counts add up (28 + 11 + 14 + 9 = 62) in the README, `development.md` and the test.
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#728