[Feature] Rename ACP extension methods to the reserved `_` prefix and advertise them under `_meta` in `agentCapabilities`
Description
ACP reserves method names that start with _ for custom methods, and says extensions should advertise themselves under _meta in capability objects. Nanocoder's ACP agent has four custom request methods with bare names (renameSession, timeline/list, timeline/revert, retryTurn), and it advertises none of its extensions.
I'd like to:
- Add
_-prefixed names for these methods, following the_nanocoder/...style Nanocoder already uses for_nanocoder/sessionTitleChanged. - Keep the bare names working as deprecated aliases for a while.
- Advertise the extensions under
_metainagentCapabilities, listing the exact method names, so clients can detect support and use the advertised names without guessing from the Nanocoder version.
Tracked from Nano-Collective/nanocoder-desktop#12 (item 7). The gap was first noted as finding 2 ("extension methods are not declared as capabilities") in Nano-Collective/docs#122. Related: #1889, #1891 and #1892, which add more extension methods and should follow whatever naming this settles.
Use Case
- Protocol compliance. ACP's extensibility rules say custom methods start with
_, so they can't collide with methods added to the protocol later. A baretimeline/listcould clash with a future standard method. - Capability detection. A client such as Nanocoder Desktop has to guess from the version whether
timeline/listorrenameSessionexists, or call it and interpret the error. Today an unknown method fails with a generic error, so a client can't reliably tell "unknown method" from a real failure. Advertised capabilities let a client check first, which is what the ACP docs recommend. - Consistency. Nanocoder already uses
_nanocoder/sessionTitleChangedfor a notification andnanocoder/...keys in_meta. The four request methods are the exception.
This is a nice-to-have for the desktop, which can work around it with an adapter that tries the prefixed name first and the bare name second. It is not blocking.
Proposed Solution
- New names. For example:
_nanocoder/renameSession_nanocoder/timeline/list_nanocoder/timeline/revert_nanocoder/retryTurn
- Deprecated aliases. Keep the bare names working for at least one release, log a one-time deprecation notice when one is used, and remove them in a later release that is announced in the changelog.
- Advertise the exact names. In
getAgentCapabilities(), add_metawith a Nanocoder entry listing the supported extension requests and notifications, for example_meta: {nanocoder: {extMethods: [...], extNotifications: ['_nanocoder/sessionTitleChanged']}}. Clients should take the method names from this list as they are, and never build them by adding a prefix. - Unknown methods. Return the standard "Method not found" (-32601) for an unrecognized custom request, as ACP says, so a client can tell "not supported" from "failed". Today it throws a plain
Error. - Update the VS Code extension to call the new names when they are advertised and fall back to the bare names otherwise.
- Docs. Update
docs/features/acp.md, which mentionsrenameSession, to list the new names, the aliases and the advertised capabilities.
Alternatives Considered
- Do nothing. Clients keep guessing from the Nanocoder version, and bare names stay at risk of colliding with future protocol methods.
- Rename without aliases. Simpler, but it breaks every existing client, including older versions of the VS Code extension.
- Advertise without renaming. Fixes detection but leaves the reserved-name problem.
- A different namespace, such as
_nanocoder.dev/...like the ACP example_zed.dev/.... A domain-style name is more collision-proof, but Nanocoder already uses_nanocoder/...forsessionTitleChanged, so I'd keep that.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] This feature aligns with the project's goals (local-first AI assistance)
Current behavior, checked against main at fc01e23:
source/acp/acp-agent.ts(~L712-829):extMethodhandlesrenameSession,timeline/list,timeline/revertandretryTurnby bare name. Any other method throwsError('Unknown extension method: ...').@agentclientprotocol/sdk1.4.0 (the version inpnpm-lock.yaml) sends and routes custom method names exactly as given.extMethod(method)callsrequest(method), and incoming requests reachextMethod(message.method, ...)unchanged. Nothing adds or strips a_, so these names are on the wire as bare names.source/acp/acp-agent.ts(~L490): the agent already sends_nanocoder/sessionTitleChanged, and responses use_metakeys such asnanocoder/artifacts,nanocoder/usageandnanocoder/artifact.source/acp/acp-capabilities.ts(~L25):getAgentCapabilities()returnsloadSession,providersandsessionCapabilities, with no_meta.plugins/vscode/src/acp-client.ts(~L513, L562): the VS Code extension callsextMethod('renameSession', ...)andextMethod('retryTurn', ...).source/acp/acp-agent.spec.tsreferences these methods in about 46 places.docs/features/acp.mddocumentsrenameSession.- ACP's extensibility page: custom methods use the
_prefix, an unrecognized custom request should return "Method not found", and extensions should be advertised under_metain capability objects. The root level of spec-defined types is reserved.
Implementation Notes (optional)
In extMethod, normalize the incoming name first: strip a leading _nanocoder/ if present, then dispatch on the existing branches, and log a deprecation notice when a bare name is used. The advertised list can be built from the same table that dispatches, so the two never drift.
Open questions for maintainers:
- Exact names.
_nanocoder/timeline/listor_nanocoder/timelineList? Another option is a plain_renameSession. Whatever is chosen, the advertisement states it, so clients don't have to guess. - Shape of the advertisement. One
nanocoderobject underagentCapabilities._metawith the method lists, or one flag per feature? - Alias lifetime. One minor release, or longer to give the VS Code extension and third-party clients time?
- Should notifications be listed too?
_nanocoder/sessionTitleChangedis already prefixed. Listing it in the advertisement lets clients know whether to expect it. - Should the advertisement carry a version, so later additions (for example the method proposed in #1892) are discoverable?
Acceptance criteria:
- [ ] The four methods respond to their
_nanocoder/...names with the same results as before. - [ ] The bare names still work and log a one-time deprecation notice.
- [ ]
initializereturnsagentCapabilities._metalisting the exact supported extension methods and notifications. - [ ] An unknown custom request returns "Method not found" (-32601).
- [ ] The VS Code extension uses the new names when advertised and falls back to the bare names otherwise.
- [ ]
docs/features/acp.mdlists the new names, the aliases, and the advertised capabilities. - [ ]
_nanocoder/sessionTitleChangedand the existingnanocoder/..._metakeys are unchanged.
Test plan:
- ACP spec: each method answers on the new name and on the bare alias, with identical results.
- ACP spec: the deprecation notice is logged once per bare name.
- ACP spec:
initializeadvertises the expected_metaentry, and every advertised name is handled. - ACP spec: an unknown
_-prefixed request returns -32601. - VS Code extension: renaming a session and retrying a turn work against an agent that advertises the new names and against one that does not.
Out of scope: adding new extension methods (#1889, #1891, #1892), changing what any method does, and renaming _meta keys on responses or the existing notification.