Skip to content

Scope skill remove --mcp to named agents - #525

Open
xsh310 wants to merge 1 commit into
xshen/skill-removefrom
xshen/skill-per-agent-remove
Open

Scope skill remove --mcp to named agents#525
xsh310 wants to merge 1 commit into
xshen/skill-removefrom
xshen/skill-per-agent-remove

Conversation

@xsh310

@xsh310 xsh310 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an --agents option to ucode skill remove --mcp so a schema can be removed from a chosen subset of configured agents and kept on the rest, mirroring ucode mcp remove --agents. This is the core bug fix in the series.

The bug

Before per-agent scopes, an all-agent add wrote a shared layer while a per-agent remove edited a separate one, so they did not compose: skill add --mcp X (all) followed by skill remove --mcp --agents claude was a silent no-op, and often printed a misleading "nothing to remove". Now that developer scope is a single per-agent map, the two operations act on the same layer.

How

  • remove_skills_command(agents=None) forwards agents to setup_mcp_clients, which scopes the client set. The picker offers only those clients' schemas and removal edits only their maps; other agents keep the schema and are not re-registered.
  • The "nothing to remove" note names the scope when --agents was given.
  • cli.py: skill remove gains the --agents option; without it, removal stays global.

Tests

  • test_mcp.py: add-all then remove --agents claude removes the schema for claude only and re-registers only claude; the picker is offered only the named clients' scope; an empty named scope is a no-op.
  • test_cli.py: --mcp forwards agents=None; --mcp --agents claude,codex forwards the parsed set.

uv run pytest tests/test_mcp.py tests/test_cli.py tests/test_lint.py is green.

Manual verification (installed build)

This is the headline fix, so I verified the exact previously-failing sequence end to end. In the sandbox (installed build 0.1.0+91.g5c0dc1e, stub claude/codex binaries recording registrations, offline auth via DATABRICKS_BEARER), shared.skills had been added to both agents. Then I invoked remove_skills_command(agents={"claude"}) with the picker stubbed to select shared.skills:

Check Result
Picker input Offered only the named client's scope: {claude:[shared.skills, claude.only]}
State after shared.skills removed from claude only: {claude:[claude.only], codex:[shared.skills]}
Registrations Only claude re-registered; codex untouched

Before this change the same sequence was a silent no-op (add wrote a shared layer, per-agent remove edited a different one). It now removes for the named agent while the other keeps the schema.

Stacking

Fourth in the stacked per-agent skills series, based on xshen/skill-remove (#524). Reviewing the diff against that base shows just this change. It rebuilds behavior originally designed by Arthur Jenoudet on the current per-client-map state model.

This pull request and its description were written by Isaac.

@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from a26bb75 to 6d166ed Compare September 8, 2026 05:43
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from 6d166ed to 028efbe Compare September 8, 2026 18:25
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from 028efbe to a24eacd Compare September 8, 2026 19:09
@xsh310
xsh310 marked this pull request as ready for review September 8, 2026 21:09
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from a24eacd to baf9215 Compare September 8, 2026 22:12
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from baf9215 to 2811860 Compare September 8, 2026 22:16
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from 2811860 to 1683deb Compare September 8, 2026 22:58
Give `ucode skill remove --mcp` an `--agents` option so a schema can be removed
from a chosen subset of configured agents and kept on the rest, mirroring
`ucode mcp remove --agents`. `remove_skills_command` takes an optional `agents`
set and forwards it to `setup_mcp_clients`, which scopes the client set; the
picker then offers only those clients' schemas and removal edits only their maps.

This closes the compose gap: `skill add --mcp X` (all agents) followed by
`skill remove --mcp --agents claude` now removes X from claude while codex keeps
it, and the schema is actually offered instead of the false "nothing to remove".

Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from 1683deb to 46532a9 Compare September 8, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant