Repository navigation
feat(acp): prefix extension methods with _nanocoder/ and advertise them - #1909
Conversation
ACP reserves the _ prefix for custom methods. Answer renameSession, timeline/list, timeline/revert and retryTurn as _nanocoder/<name>, keep the bare names as deprecated aliases that log a one-time notice, and list the exact method and notification names under agentCapabilities._meta.nanocoder. An unrecognised custom request now fails with Method not found (-32601). The VS Code extension uses the advertised names and falls back to the bare ones. Closes Nano-Collective#1893
nc-review: comments — 2 important, 4 nits@addyCooks — a few things worth a look, none blocking. The PR prefixes Nanocoder's four ACP extension request methods with 🟠 important · The new deprecation-notice test replaces const logger = getLogger();
const original = logger.warn;
logger.warn = ((message: string) => { warnings.push(message); }) as typeof logger.warn;It is declared as a plain Fix: mark this test 🟠 important ·
const ACP_EXT_NOTIFICATIONS = ['_nanocoder/sessionTitleChanged'];while the agent actually sends it from Fix: export the notification name as a constant (e.g. ⚪ nit · The PR adds a Fix: extend ⚪ nit ·
Fix: add a case where ⚪ nit ·
Fix: return a copy, e.g. ⚪ nit · The extension hard-codes This is not a hard break today (a rename would silently degrade the extension to the bare names, which still work as aliases), but it is exactly the "two places that must be kept in sync" pattern this PR set out to remove on the agent side. Fix: import 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
…tests Export the session title notification name and use it both where it is sent and in the advertised list, copy the advertised notification list like the method list, and have the VS Code client build the names it looks up from the shared prefix and method list instead of repeating the literals. Tests: run the logger-patching deprecation test serially so the bare-name calls in other tests cannot land in its window, reuse makeHandshakenClient in the VS Code spec, and cover an agent that advertises only some of the extension methods.
# Conflicts: # docs/features/acp.md
Description
ACP reserves method names starting with
_for custom methods and says extensions should advertise themselves under_metain capability objects. Nanocoder's four custom requests used bare names (renameSession,timeline/list,timeline/revert,retryTurn) that could clash with future protocol methods, and nothing was advertised, so a client had to guess from the version._nanocoder/renameSession,_nanocoder/timeline/list,_nanocoder/timeline/revertand_nanocoder/retryTurn, with the same results as before.initializereturnsagentCapabilities._meta.nanocoder.extMethodsandextNotificationswith the exact names, so clients can detect support and use the advertised names as they are.-32601) instead of a plain error._nanocoder/sessionTitleChangedand the existingnanocoder/..._metakeys are unchanged.Closes #1893
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist