Skip to content

feat(mcp): pass host tool annotations through serveMcpTools - #593

Merged
stamp-build[bot] merged 2 commits into
mainfrom
feat/mcp-tool-annotations
Nov 5, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
feat/mcp-tool-annotations

Conversation

@stdrc

@stdrc stdrc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Host tools can declare MCP annotations and have them appear unchanged in tools/list. HostTool.annotations includes title, readOnlyHint, destructiveHint, idempotentHint, and openWorldHint; tools without annotations keep the existing response shape.

OAR passes through the host's declarations and does not validate or act on them. The runtime matrix describes their possible effect on native approval and preserves the original Codex 0.161.0 observation as version-specific evidence. It does not advise hosts to mark destructive or open-world tools otherwise.

This continues @⁠stdrc's original implementation and retains Richard Chien as the author of that commit. The follow-up addresses the review: add annotations.title, keep the public JSDoc runtime-neutral, clarify host responsibility, and retain the current main lockfile when rebasing.

Validation: full CI=1 pnpm run check (3,182 unit tests and 18 mock behavior cases), build, and clean packaged installation passed. The MCP regression checks all five annotations, including false booleans, and their absence when omitted. Native Codex approval regression remains a separate follow-up, task #146, after this PR merges.

Edited by Otter (agent, via Stamp): Maintainer Cindy asked Otter to take over this existing PR, preserve Richard Chien/stdrc authorship, address her November 1 review, and rebase for renewed review. The branch now contains that revision; this description documents its final scope and validation.

@stamp-build

stamp-build Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Thanks, the direction is right and I'd like to take it: annotations is a standard MCP Tool field, and passing what the host declares through unchanged, without OAR validating or acting on it, fits how serveMcpTools treats inputSchema. Requested changes before approval (reviewed at dbc9162):

  1. Lockfile: thanks for restoring it in dbc9162; that was why every CI job failed at pnpm install --frozen-lockfile. The cause is on our side: the repo pins [email protected], but a stale auto-install-peers=false in .npmrc gets picked up by other pnpm versions. We'll clean that up separately.
  2. Match MCP's ToolAnnotations shape. The spec type also has title?: string. Without it, "sent unchanged" is true only for a subset, and a host can't pass a display title.
  3. Keep the public type's doc runtime-neutral. Codex's approval rule will change with Codex versions, and the JSDoc on HostTool is the wrong place to track it. Something like "MCP tool annotations, passed unchanged in tools/list; runtimes may use them, for example to decide whether a call needs approval (see the runtime matrix)" is enough, with the Codex observation kept in docs/spec/runtime-matrix.md as you have it.
  4. Say that annotations are the host's claims. Please add one sentence to the runtime-matrix paragraph: a runtime may skip its approval for a tool based on these hints, so a host should only mark what is true. The PR's "Out of scope" note about marking a destructive tool non-destructive to get past approvalPolicy: "never" is a real limitation, but the docs shouldn't read as a recommendation to do that.

Not blocking: the Codex probe is from 0.161.0, several releases back. We'll add a Codex vendor case (unannotated tool refused, readOnlyHint: true tool called, under a read-only sandbox with approvalPolicy: "never") as a follow-up, so the daily runtime check notices if Codex changes this.

Once 2 to 4 are in and CI is green at the new head, I'll approve.


Cindy commented through Stamp · server open-agent-runtime · reviewed head dbc9162
View in Stamp →

stamp-build Bot added a commit that referenced this pull request Nov 2, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_e28319d72feeeb8eaed22e558d17fd9e"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

Weekly maintenance pass 2026-11-02, spec pages.

- Adds the missing Qwen, Qoder and CodeBuddy rows across spec tables (refused options, env, structured output, session names, additional directories, disallowed tools, launch args, install, update, inventory, attribution, login), each checked against the runtime's `options.ts`, `launch.ts`, `install.ts`, `projection.ts` or `index.ts`.
- `acp-shared-connection.md`: opens with the current admission status (no native runtime admitted; OpenCode withdrawn in 0.83.0, #587; Grok product refused) and keeps the experimental adapters in their own section; release and exit rules link to `record-stream.md#placement-and-release`.
- Drift fixed: `input_queued` sources (Claude and Qoder), `exited {code, reason?}`, `withdraw` list, local auth readers in orientation, CI backends in the spec README.
- Duplicate statements removed (Windows budget, late-result identity rule kept once, `carries` validity owned by `conversation.md`).

Excluded on purpose: the served-tools section of `runtime-matrix.md` (#593), and the Cursor compaction and SDK version text #509 changed. Written and then independently verified against `origin/main` by a second pass that restored dropped qualifiers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
Codex outside its full-access sandbox requires approval for an MCP call, which approvalPolicy never refuses,
unless the tool is marked readOnlyHint, or destructiveHint false and openWorldHint false. Without annotations a
host cannot combine a restricted Codex with its own tools.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build
stamp-build Bot force-pushed the feat/mcp-tool-annotations branch from dbc9162 to 7ee7510 Compare November 5, 2026 09:05
@stamp-build
stamp-build Bot force-pushed the feat/mcp-tool-annotations branch from 7ee7510 to adaa95e Compare November 5, 2026 09:06
@stamp-build
stamp-build Bot merged commit 08e4336 into main Nov 5, 2026
37 checks passed
@stamp-build
stamp-build Bot deleted the feat/mcp-tool-annotations branch November 5, 2026 15:54
stamp-build Bot added a commit that referenced this pull request Nov 5, 2026
<!-- stamp:review:v1 -->
<sup><img
src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp"
width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from
open-agent-runtime opened this pull request through
Stamp</sup><br><sup><a
href="https://stamp.build/review?receipt=prc_bccd3887c4fb3b70dd7b2e1eda803b1b"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img
src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg"
width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp
→</a></sup>

---
<!-- /stamp:review:v1 -->

Antigravity's native ACP interface ships in agy CLI 1.5.0. This replaces
the separate `agy_acp_server` runtime with `agy acp
--dangerously-skip-permissions --process-per-session`, keeping the
public runtime id `antigravity`.

Thanks to `@⁠M4n5ter` for identifying the official `agy acp` entrypoint
and contributing the earlier [PR
#620](#620). That report also
records a real-account `agy 1.5.0` / `gemini-4-argon` / `low` session
with two turns and a successful third turn after resume. I have not
independently reproduced that account result; the validation below uses
isolated local providers.

This is a breaking migration for 0.88.0. Hosts must install stable CLI
1.5.0+ and replace old server overrides. Non-empty tool-denial lists are
refused because the native CLI ignores the old filter; MCP tool-list
changes are now `none`. Model, effort, append and MCP settings must be
passed again on resume. Credential-bearing MCP entries and extra
directories remain refused based on native persistence and cwd evidence.
Consumer login stays deliberately absent under the vendor's account
policy; the docs recommend provider API keys and preserve the old
service stores.

The revised adapter addresses the native CI failures and review
findings:

- Model selection waits for its native answer and configuration
notification before applying effort. Effort then requires both its
answer and notification to confirm the requested value within the
existing deadline. Missing or contradictory confirmation rejects open.
No retry or weaker assertion is used. The original spontaneous late-low
case did not reproduce in 450 local native pairs, so its actual provider
setting remains unknown. An explicit delivery-only control reverses the
two unchanged native notifications: all 10 pairs end with low readback
while their provider requests carry HIGH. Ordered native controls pass
150 pairs and a separate 10 provider requests. The report distinguishes
these evidence types.
- A replacing steer's early original answer cannot end the loop. A
replacement failure owns the outcome only after earlier prompt answers
arrived. A steer rejected while the original request is still pending
cannot turn that original request's later success into failure.
Regressions cover both orders; the rejection test completes the original
without sending a third prompt.
- Antigravity, Kimi and OpenCode require a native list entry confirming
saved cwd before resume/load. Unlisted existing sessions and absent ids
receive the same typed cwd refusal. Listing authentication, process-exit
and generic RPC errors retain their existing classification and native
cause, with no resume/load call. All three native profiles have
regressions for those failures. The breaking changes name all three
runtimes. Native agy can resume an unprompted session omitted by
listing, and load can accept an absent id; neither establishes missing
history.
- Version parsing accepts only a bare stable CLI release, rejecting
extra notices (including the unproven Update available form), VS Code's
version/hash/architecture output and prereleases. An old executable only
on PATH does not block installation into an empty official location; old
official copies and pinned overrides retain actionable configuration
refusals. Shell-profile edits are documented side effects but their
writability is not an installation prerequisite.
- Directory comparison preserves filesystem aliases and normalizes
native `/D:/path` to `D:\path` only on Windows. The previous Windows CI
confirmed this exact native shape in four failed resume cases; their
success assertions remain unchanged. New units distinguish different
drives/directories, UNC and literal percent characters, without changing
POSIX interpretation. The previously approved head passed native macOS
and Windows checks, including these resume cases. This rebased head has
a fresh CI run.

Required CI installs pinned official CLI 1.5.0 archives, verifies
SHA-512, and runs native behavior and vendor suites in the three
existing `check` jobs. It adds no job; the current main baseline has 36
required checks. The manual sharing-evidence workflow uses the same
installer and native tool schemas. Its failed cwd-isolation observation
remains a failure: native shared placement is not admitted, and child
frames remain opaque.

Validation on main `5848d4d8`: full check (3,279 unit tests and 18 mock
cases), both builds, clean package consumption, all 15 behavior backends
and all 12 Antigravity vendor cases passed. CodeBuddy behavior used the
newly pinned native 2.179.3. Prior native Kimi (11), OpenCode v1 (10)
and Grok (20) vendor results remain applicable to the unchanged adapter
patches. Mutation controls cover Windows path normalization, listing
error classification, unsupported version notices, configuration
confirmation, native close, steer ownership and installation migration.
Tests use isolated homes and local scripted providers. Separate tasks
#176 and #177 track the two steer error races and stale configuration
updates; they are not claimed fixed here.

The rebase follows #593 and #619. Its only conflict was the Antigravity
runtime page: the November 4 initialize-only observation remains linked
as dated evidence, alongside the November 5 migration controls. Product
and test patches match the previously approved head, which passed all 35
checks, including native Windows and macOS cases. All 36 checks on the
rebased head now pass, including the native Windows and macOS runs (CI
run 42062136694).

[Report, selected native evidence, repeatable probes and host migration
notes](https://github.com/botiverse/oar/blob/90660104dae25e326b557b94b004deba0f603f94/experiments/antigravity-cli-acp-2026-11-05.md).
Reliable child identity, real-account behavior and structured compaction
completion are not claimed. Package versions and release tags are
unchanged by this PR.

---------

Co-authored-by: Otter <[email protected]>
stamp-build Bot added a commit that referenced this pull request Nov 5, 2026
<!-- stamp:review:v1 -->
<sup><img
src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp"
width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from
open-agent-runtime opened this pull request through
Stamp</sup><br><sup><a
href="https://stamp.build/review?receipt=prc_77fb6ec44138ee45aeca0d1dcdb1b316"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img
src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg"
width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp
→</a></sup>

---
<!-- /stamp:review:v1 -->

Codex's handling of host tool annotations was covered only by an older
manual probe. This adds native vendor regressions under `approvalPolicy:
never`: an unannotated host tool is refused in a read-only session, a
`readOnlyHint: true` tool actually runs and returns its result to the
model, and a subsequent native `apply_patch` write is still refused.

A second session sends the identical calls with full access and verifies
both handlers run and the file is written. Both cases assert the native
policy readback, tool outcomes, provider-visible results and filesystem
effects. The runtime matrix links the regression and preserves the
original versioned observation. Product code, CI configuration and
timeouts are unchanged.

Validation: Codex 0.166.0 on Linux with a scripted local provider, no
login or model quota. Both new cases and three existing MCP/approval
cases pass. Removing annotation forwarding makes both new cases fail.
`CI=1 pnpm run check` passes (3,236 unit tests and 18 mock behaviors).
Both new cases also passed on Windows in the first CI attempt. That job
failed only because the existing `input-dropped.vendor` test exceeded
its 60-second limit; the same test passed on the unchanged base Windows
run and in an isolated Linux run. The failure log and artifacts are
retained, but contain no per-stage trace for that case, so the cause is
not established. The single Windows Codex job rerun passed on the
unchanged head. All 36 CI checks now pass, including the native
regressions on Linux, macOS and Windows. The retained first-attempt
failure remains unexplained; the rerun is not evidence of a causal fix.

Raft task 146, following merged PR #593.

Co-authored-by: Otter <[email protected]>
@stamp-build stamp-build Bot mentioned this pull request Nov 5, 2026
stamp-build Bot added a commit that referenced this pull request Nov 5, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_62138ffbcbca4522b115265aa4095fac"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

Antigravity moves to its official `agy acp` entrypoint (breaking), and this release adds the DSH runtime, bounded record retention, opt-in cleanup of an aborted Codex turn's processes, and automatic answers to Codex's runtime requests.

## Breaking: Antigravity uses native `agy acp` (#622)
- The public runtime id stays `antigravity`. It now runs `agy acp --dangerously-skip-permissions --process-per-session` instead of the separate `agy_acp_server`.
- **Hosts must install stable agy CLI 1.5.0 or newer** and replace any old server override.
- Non-empty `disallowedTools` is now refused, because the native CLI ignores the old filter. MCP tool-list changes are now `none`.
- Model, effort, append and MCP settings must be passed again on resume.
- Credential-bearing MCP entries and extra directories stay refused. Login stays absent under the vendor's account policy; use provider API keys.
- Sessions and history from the old server are not migrated, so old session ids do not resume.
- **Also affects Kimi and OpenCode:** the shared resume check now refuses before resuming, with `UnsupportedOptionError("cwd")`, when it cannot confirm the saved directory. Absence from the session list no longer reports `SessionNotFoundError`.
- Thanks to M4n5ter, who identified the entrypoint and contributed the earlier #620. That report's real-account session was not independently reproduced; this PR's validation used isolated local providers.

## New runtime: DSH (DeepSeek Harness) (#634)
- One owned `dsh` process per session, through a small private bridge plugin. OAR does not change the user's configuration and only generates a private patch; DSH itself still creates its profile and writes logs and caches.
- Version floor `0.2.1-rc.5`, plus a method inventory: a missing native method makes its control absent or refused.
- Supported: open, resume, prompt, steer, queue and withdraw, abort, dispose, model and effort with read-back, usage, child attribution, `listModels`.
- Refused until probed: `systemPrompt`, `appendSystemPrompt`, `mcpServers`, `disallowedTools`, `launchArgs`, `serviceTier`, `additionalDirectories`, `outputSchema`, `name`, `userConfiguration: "exclude"`, `goals`, `endTurnProcessesOnAbort`, images. Login, auth status and account usage are absent.
- Verified with loopback providers, and with a real DeepSeek key on Linux (0.2.2-rc.1, 0.2.1-rc.5). First-party plans are not verified. Platform coverage is in `docs/runtimes/dsh.md`.

## Bounded record retention (#630)
- Opt-in `SessionOptions.retainedBytes`. Omitted, nothing changes.
- Past the limit, the oldest frames lose `native` (now `null`) and their events' tool input and output, and carry `elided: true`. `seq`, frame types, event kinds, usage and text stay, so `status()` and `usage()` are unchanged.
- Observers receive every record complete first. A host wanting full history persists it.
- The record count and text are not bounded. Tool parts built from trimmed frames carry `elided: true`.

## Codex: end an aborted turn's processes (#633)
- Opt-in `SessionOptions.endTurnProcessesOnAbort`. After a turn started by OAR's `prompt()` with a usable baseline reports `interrupted`, OAR ends the processes that turn started, with a start-identity check before any signal. Inputs drained from the queue, goal continuations and compaction are out of scope.
- The app-server, its helpers, stdio MCP servers and earlier background commands survive.
- A fast command caught in the baseline, one started after the snapshot, or a process that already left the tree can survive.
- It would rather not kill than kill wrongly: if a process-table read fails or is unfinished, nothing is ended and the reason is recorded in a `cleanup` response, which comes after the turn's end. On Windows nothing is ended. Refused with shared placement and on every other runtime.
- `SessionCleanup` `completed` and `failed` gain optional `signalled`: kills actually sent, not proof of exit.

## Codex: runtime requests are answered (#629)
- A request Codex sent the client during a turn (approval, user input, MCP elicitation, dynamic tool call) was recorded and never answered, so the turn hung. OAR now records it, answers at once with a native refusal, or `-32601` for anything else, and records the answer.
- **Host-visible:** `app_answered` now follows `app_request`, and `app_request_cancelled` no longer appears on Codex.

## Host tool annotations (#593)
- `HostTool.annotations` (`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) reach `tools/list` unchanged. OAR neither validates nor acts on them. Credit: Richard Chien (stdrc). A native Codex regression pins the observed behaviour (#641).

## Kimi account usage (#637)
- Unreadable or invalid quota responses now reject with a safe reason instead of reporting `available`, empty windows or 0% used. Damaged windows are omitted and valid ones kept.
- Only a missing file means `credentials_missing`; other credential read failures reject. Fixes #635 and #636.

## Evidence and tests
- Native evidence refreshed and CodeBuddy pinned to 2.179.3 (#619). A Windows directory removal retry in a Codex test (#639).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
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