Files
skillshare/website/docs/reference
Willie 8f55e58999 feat(ui): edit other Agents' MCP options in the server dialog (#580)
* feat(mcp): write per-Agent native fields from the source

Some MCP settings have no portable form, such as Codex's
default_tools_approval_mode or Claude Code's per-server timeout. Sync
kept them only while an entry survived, so a recreated entry (for
example after a rename) lost them, and every machine needed them added
by hand again.

A server's `options` now holds these fields per Agent, and sync writes
them as given. The field ledger that piOptions used is extended to
every Agent, so sync removes an option it wrote once the source drops
it, and reports a conflict when the Agent changed it since.

Options are refused when they could break the entry or leak a secret:
fields Skillshare writes (including portable names some Agents rename),
values a native format cannot write back (null, arrays of tables),
options.pi (piOptions covers Pi), disabled entries, and credentials as
plain text, since the Agent's file may be committed.

The dashboard has no editor for options yet but keeps them on save.

Refs: #578

* fix(mcp): close gaps in per-Agent options found in review

- A credential option passed if it merely contained "${", so text around
  a reference, or another Agent's syntax, was written out as plain text.
  It must now be a whole-value reference in the Agent's own syntax, and
  Codex and Antigravity options, which read no references, cannot hold one.
- The Kilo Code project check looked only at portable env references, so
  an {env:VAR} in options reached a project file Kilo refuses to load.
- A replace resolution left the dropped-option conflict in place, so the
  plan stayed blocked; replace now lets the source win and prunes those
  fields.
- Adopting an entry that already matched skipped writing its options until
  a later sync; the takeover now writes them.

* fix(mcp): refuse numeric credentials and constrain option values in the schema

- YAML reads an unquoted secret such as clientSecret: 123456 as a number,
  which the credential check skipped, so sync wrote it out as plain text.
  A mapping under a sensitive name such as credentials also hid its
  plainly named fields. Sensitivity now carries down through mappings and
  lists, and a number under a sensitive name is refused.
- The schema allowed any value inside an Agent's options, so editors
  accepted null or nested lists that LoadSource then rejects. A recursive
  optionValue definition now matches the runtime rules.

* feat(ui): edit other Agents' MCP options in the server dialog

The dialog only carried options through unchanged, so setting a field
such as Codex default_tools_approval_mode or Claude Code timeout still
meant editing mcp.yaml by hand. One Agent picker with a JSON editor keeps
the dialog short however many Agents are ticked; ticked Agents come first,
and an unticked Agent that still has settings stays listed so they can be
cleared. Anything but a JSON object blocks saving; the server checks the
fields themselves.

* fix(ui): offer every Agent in the options picker and document the editor

- The picker listed targets from the order, which includes accounts, so a
  ticked account produced an options key the server refuses, and the
  Agent the account writes to was not offered. Options are keyed by Agent,
  so every Agent but Pi is offered, ticked ones first.
- An unticked Agent left the list as soon as its text was emptied, so its
  settings could not be cleared and retyped.
- The editor was hidden on the Skillshare tab although its server takes
  options too, and hidden invalid text could block Save there.
- The docs still said the dashboard had no options editor.

* fix(ui): open the options editor on a ticked account's Agent

The picker ranked Agents by the ticked targets, which hold account names,
so a server reaching only codex-work opened the Claude editor and what was
typed there was saved under options.claude. The MCP page now provides
each account's Agent, and the ranking uses it.

The retype test now asserts the saved options rather than the editor
staying visible.

* fix(ui): show the server's refusals of Agent options in the dashboard language

The dialog leaves field rules to the server, but its refusals (a field
Skillshare writes, a plain-text credential, a credential in an Agent that
reads no references, an unsupported value) reached the dialog in English.
describeError now maps each to a translated message naming the Agent and
field. The other option errors cannot come from the dialog: it offers no
Pi, no non-Agent key, and no options on an off switch.
2026-10-18 00:09:18 +08:00
..