Repository navigation
docs(unstable-v2): say which description fields may contain Markdown - #2974
Merged
Merged
Conversation
The content page made every display string except text content and plan entry content plain text, and named the `description` of a command or config option as an example. Those descriptions are prose that a person or a model writes, and they already arrive with code spans and links. The `description` of an authentication method, a command or skill, a config option and each of its values, a permission request, and a subagent may now contain Markdown, like a text block. The schema descriptions say "May contain Markdown.", as a plan entry's `content` does. Notice, auth account, elicitation and resource link descriptions stay plain text. A notice is shown in compact places such as a toast, an auth account description is a short label, and the other two follow MCP's shapes.
Merged
benbrandt
added a commit
to agentclientprotocol/claude-agent-acp
that referenced
this pull request
Nov 21, 2026
Updates `@agentclientprotocol/sdk` from 2.8.0 to 2.9.0 (schema v1.34.1 and v2.0.0-beta.2), and follows the protocol rules that changed for what the adapter already serves. The adapter compiles against 2.9.0 unchanged. The behavior rules are in the protocol docs, so I read the protocol repo from the last reviewed commit to `schema-v2.0.0-beta.2`, which is 90 commits. Each change below is its own commit. ## Changes ### The bump - SDK 2.9.0 dispatches one incoming message per event-loop task, in the order received. Two v2 tests asserted a `running` state right after a permission answer, before the in-process test client had read it. They now wait for it. The adapter sends that update before it returns the decision, as before. - ACP made plan operations and subagent sessions stable in v1 and moved v2 to Preview. The adapter already serves them as specified, so only words change: the README section is "ACP v2 (Preview)", the subagent docs link the protocol page instead of the RFD, and comments no longer say "draft". - The README says how long the `idempotencyKey` of a prompt that Claude Code does not store is known: until `session/close` or the end of the connection. ### The text items of a v2 tool call stay apart v2 now says that adjacent text blocks form one continuous text, which a Client joins without a separator (agentclientprotocol/agent-client-protocol#2885). The adapter's text items in a tool call's content are separate paragraphs: one per AskUserQuestion question, per reported finding, or per block of a tool result. Joined, two fenced error blocks would run into each other. `v2ToolCallPatch` in `src/v2/tool-call.ts` now ends each text item that another text item follows with a blank line. v1 is unchanged. ### A v2 Glob title is plain text v2 now says that a tool call `title` is plain text, which a Client should not render as Markdown (agentclientprotocol/agent-client-protocol#2887). A Glob title wrapped its path and pattern in backticks, which such a Client shows literally. A v2 client gets them as they are. v1 states no format, so a v1 client keeps the code spans. ### An empty `systemPrompt.content` is rejected on v1 too A Client must not send an empty `content` list, and an Agent may reject one with `-32602` (agentclientprotocol/agent-client-protocol#2912). SDK 2.9.0 rejects it on v2 in the schema. On v1 it reached the session. With `override`, Claude Code then got an empty custom prompt, which is also what the Claude Agent SDK sends when its `systemPrompt` option is omitted. `clientSystemPrompt` now rejects it, so both versions answer the same. This is a behavior change for a v1 client that sent `content: []`. ### A stale usage origin is removed (v2) The top-level `_meta` of a v2 `usage_update` is now a metadata patch: a Client keeps each key until an update replaces it or sets it to `null` (agentclientprotocol/agent-client-protocol#2933). `_claude/origin` went only with a result that had an origin, so a Client kept `{ kind: "task-notification" }` for every later result. The next result without an origin now sends `"_claude/origin": null`. `_claude/model` and `_claude/rateLimit` are the last ones reported, which is what a Client keeping them means. ## Already compliant, checked - Cancellation: a prompt that came before a `session/cancel` and is not inserted gets `-32800`, a prompt after it is held and not rejected, the cancelled work's final updates come before its `idle` with `cancelled`, and listed background work keeps running. - Permissions: the `optionId` is matched against the options offered, and an unknown option or outcome, an error response and a withdrawn request all leave the tool unapproved. - `replay_complete`: the hold starts with the request, each replayed child gets its own marker, and the children's current states follow the root's marker. - `idempotencyKey`: a stored message keeps its key across restarts, and an error leaves the key unused. - An MCP server that fails to start does not fail the session. The user gets a notice. - A prompt with a content type the adapter did not advertise gets `-32602` before it is inserted. - Plan operations and subagent updates go to a v1 client only when it advertises `plan` or `subagents`, and to every v2 client. - `status` is a patch field on a v2 `compaction_update` now. The adapter still sends it on every update. - Elicitations are session-scoped and carry no `requestId`, which the new scope validators require. - The SDK no longer answers `tool_call/cancel` and `terminal/cancel` by default. The adapter has its own handlers. - The v1 `auth/status` response passes the response validation that SDK clients now run. ## Not covered - **Relative stdio MCP `command` on v2.** v2 asks an Agent to reject one with `-32602`. The check belongs in the SDK's `assertSupportedMcpServers`: agentclientprotocol/typescript-sdk#361. The adapter gets it with the SDK release that has it, and a test case for it is ready. - **Markdown in descriptions.** agentclientprotocol/agent-client-protocol#2974 lets several `description` fields contain Markdown. The remote login method's description keeps its code span. - **Replayed subagents.** #1685 sends a replayed child's configuration after the replay, and #1686 answers requests that name a replayed child with `-32602`. - **Relayed MCP forms.** A form with an empty `enum`, `oneOf` or `anyOf` goes to a v2 client as the MCP server sent it. Only a non-conforming server sends one, and the Client's `-32602` already ends in `cancel` for the server. - **A cancel during an open turn** reports `cancelled` also when Claude Code's result was not aborted. v2 now says that the stop reason of work that had already ended stands. - Still open from earlier bumps: a Markdown plan's `path`, and v2 skills. ## Tests `npm run build`, `npm run check` and `npm run test:run` pass (4,417 tests). The whole suite also passes against the real Claude Code CLI on this branch merged with #1685 and #1686 (4,459 passed, 9 skipped).
benbrandt
added a commit
to agentclientprotocol/claude-agent-acp
that referenced
this pull request
Nov 21, 2026
Updates `@agentclientprotocol/sdk` from 2.9.0 to 2.9.1 (schema v2.0.0-beta.3). The release has two changes, and both come from the review for #1687. ## A relative stdio MCP `command` is rejected on v2 ACP v2 requires the `command` of a stdio MCP server to be an absolute path, and an Agent rejects a relative one with `-32602`. SDK 2.9.1 does that in `assertSupportedMcpServers` (agentclientprotocol/typescript-sdk#361), which the adapter already calls for `session/new`, `session/resume` and `session/fork` on v2. So this needs no adapter code. A v2 client that sends a bare command name, such as `npx`, now gets `-32602` with `{ name, command }` before anything is created, resumed or copied. It has to send the full path. v1 does not require an absolute path and is unchanged. The SDK accepts a path that is absolute in POSIX or in Windows syntax, because it does not know which machine the Agent runs on. A path in the other system's syntax passes the check and fails when Claude Code starts the server, like any missing executable. - The existing test of rejected MCP server lists is now an `it.each` with the relative `command` as a second case, over new, resume with and without replay, and fork. - The doc comment of `v1McpServers` and the README's v2 section say it. ## Markdown in descriptions The schema change is description text only: the `description` of an authentication method, a command, a config option and each of its values, a permission request and a subagent may contain Markdown on v2 (agentclientprotocol/agent-client-protocol#2974). The adapter already sends Markdown in some of them, such as the remote login method's ``Run `claude /login` in the terminal``, so nothing changes. ## Tests `npm run build`, `npm run check` and `npm run test:run` pass (4,434 tests). Against the real Claude Code CLI, the whole suite ran with 4,461 passed and one suite not run: the `tsc` step in the `beforeAll` of "ACP subprocess integration" hit its 10 second limit twice, on a machine with a load average above 50. That suite's five tests pass when it runs alone.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#2887 made every string shown to users plain text, except text content blocks and a plan entry's
content. The content page named thedescriptionof a command or config option as an example of plain text.That went too far for descriptions. They are prose that a person or a model writes, and they already arrive with Markdown in them:
Run `claude /login` in the terminal.A Client that follows the current text shows the backticks literally.
Changes
These
descriptionfields may now contain Markdown, like a text block:AuthMethodAgent,AuthMethodTerminalCommand,Skill,OtherAvailableCommandSessionConfigOption,SessionConfigSelectOptionRequestPermissionRequestSubagentUpdatedescriptionas an example. A new sentence lists the description fields that may contain Markdown, with a plan entry'scontent.contentdoes. So do the accessor and builder methods that repeat the field's description.The page changes are in the stable pages and their
draft/copies. Skills are only on the draft pages. The schema change is description text only. It regeneratesschema/v2/schema.json,schema/v2/schema.unstable.jsonand bothschema.mdxpages. v1 is unchanged: it states no format for these strings.Why this split
The rule from #2887 still holds: text that a person or a model writes is Markdown, and labels that the Agent assembles in code are plain text. The descriptions above are on the first side of it. Titles and names stay plain text.
Four
descriptionfields stay plain text:titleanddescriptionare plain text by the Session Notices RFD, because a Client can show a notice in a compact place such as a toast.The cost is the one #2887 named. An Agent that builds one of these descriptions from raw values, such as a path, now has to escape it.
This adds no rendering rule of its own. "Like a text block" points at the text content rules, so a Client that cannot render Markdown where it shows a description, such as a one-line menu entry, is in the same position as with any other text.
Implementations
Checked against the Claude Agent adapter only. It passes command and skill descriptions and the subagent description through as Claude Code gives them, sends Claude Code's decision reason as the permission explanation, and its remote login method's description has a code span. I did not check how Clients render these fields today.
Checks
npm run generateandnpm run checkpass.