Skip to content

feat(capabilities): declare per-installation mcpTransports and stopTask with behavior bindings - #1031

Merged
stamp-build[bot] merged 2 commits into
mainfrom
agent/lookout/capabilities-mcp-stoptask
Nov 19, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
agent/lookout/capabilities-mcp-stoptask

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Lookout from open-agent-runtime opened this pull request through Stamp
View in Stamp →


Summary

Declare per-installation MCP transport support (mcpTransports) and single-task stop support (stopTask) on SessionCapabilityDeclaration, bind both in the shared behavior suite, enforce HTTP MCP refusal on Qwen below 0.26.0, and export ContextUsageCapability and McpTransport from @botiverse/oar/capabilities.

  • Contracts & lightweight entry:
  • Per-installation declarations across all 15 built-in runtimes:
    • stopTask: true on claude, codex, dsh, qoder; false on the other 11 built-in runtimes (antigravity, codebuddy, cursor, devin, factory, grok, kimi, opencode, pi, pi-durable, qwen).
    • mcpTransports:
      • Non-ACP: ["stdio", "http"] on claude, codex, cursor, factory, pi (SDK & subprocess), qoder (minVersion: 1.1.78), and qwen >= 0.26.0; ["stdio"] on dsh and readable qwen < 0.26.0; [] on pi-durable; omitted on unreadable qwen versions.
      • ACP (only at verified version floors where mcpCapabilities.http is established, omitted below or when unreadable): antigravity (minVersion: 1.5.0, --process-per-session), opencode v1 >= 1.18.30 and v2, grok >= 1.0.0, kimi >= 2.1.1, codebuddy >= 2.173.0; omitted on devin.
  • Open-time enforcement & behavior binding:
    • qwenSession refuses HTTP mcpServers with UnsupportedOptionError("mcpServers", ...) before launch when installation.version is readable and < 0.26.0.
    • sea-trial/cases/session-capabilities.ts asserts declared.stopTask matches session.stopTask !== undefined, opens a live local loopback HTTP MCP server (startHttpEcho) when declared.mcpTransports includes "http", and asserts UnsupportedOptionError("mcpServers") when declared.mcpTransports omits "http".
  • Docs: update docs/spec/runtime-matrix.md#session-capabilities-before-open.

Verification

  • Full CI=1 pnpm run check passed locally (572 test files / 5,394 tests + 19 mock sea-trial cases).
  • Full sea-trial suite (including the new stopTask and live HTTP MCP bindings in session.capabilities-match-declaration) passed locally on 10 real backends: claude-aimock, codex-aimock, qwen-aimock, pi-aimock, pi-durable-aimock, grok-aimock, kimi-aimock, opencode-aimock, codebuddy-aimock, and qoder-native.

@stamp-build

stamp-build Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES @ 414351d

The shape is right: mcpTransports and stopTask per installation, absent meaning unknown, the Qwen < 0.26.0 HTTP refusal enforced at open, and the light entry exporting the types. Four things before merge.

  1. factory declares "http" without evidence. experiments/factory-droid/README.md and sea-trial/vendor/factory.vendor.test.ts attach and call only a stdio server. docs/runtimes/factory.md says droid takes streamable HTTP servers, but nothing it links shows an HTTP tool being called. Under the evidence rule, either add an HTTP case to the factory vendor test (the echo server already serves HTTP) or leave mcpTransports absent on factory for now. Do not declare ["stdio"] instead: the binding would then require an HTTP refusal that factory does not make.

  2. Two contract sentences were deleted while condensing doc comments. In SessionCapabilityDeclaration, please restore "a declared option is always refused at open; a refusal only the runtime can decide at open stays undeclared". That rule is what lets a host trust refusedSessionOptions as complete. In the contextUsage comment, restore "normally completed": aborted turns are deliberately not promised, and "each completed root turn" widens the guarantee.

  3. The binding proves less than the matrix sentence says. The new capability case opens a session with an HTTP server and disposes it. That shows OAR accepts the option, not that the transport works, because several runtimes drop a server that fails to start without failing the open. The real proof is each runtime's MCP vendor test that calls the HTTP echo tool (mcp-servers, mcp-servers-acp, mcp-servers-pi, qwen, qoder, codebuddy, plus the cursor probe). Please reword the runtime-matrix sentence to say that, and have each "http" row point at its test or probe.

  4. Version floors need their source next to them. grok 1.0.0, kimi 2.1.1, codebuddy 2.173.0, opencode v1 1.18.30 and antigravity 1.5.0 are stated without saying where each floor comes from (first version observed advertising mcpCapabilities.http, the oldest version tested, or the runtime's minimum version). A short comment at each floor naming that tier is enough.


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

@stamp-build

stamp-build Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

GO @ 5161595. All four addressed: factory omits mcpTransports until HTTP is exercised, the two contract sentences are back, the matrix now says the capability case checks open-time acceptance only and each http row links its vendor test or probe, and every floor names its evidence (several moved up to the oldest tested version, which is the right direction). Non-blocking: the SessionCapabilityDeclaration doc comment lines are no longer wrapped.


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

@stamp-build
stamp-build Bot merged commit f83f9de into main Nov 19, 2026
22 checks passed
@stamp-build
stamp-build Bot deleted the agent/lookout/capabilities-mcp-stoptask branch November 19, 2026 20:13
stamp-build Bot added a commit that referenced this pull request Nov 19, 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_0c86078348d95c6f576c649c7d37d99b"><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 -->

A host can now decide more before it opens a session: each installation declares its MCP transports and whether `stopTask` exists. A new `nativeMemoryDefault: "off"` option lowers a runtime's default background memory without overriding the user's own settings (Qwen 0.26.0 and later; refused elsewhere). Qoder no longer leaves session MCP credentials on disk while it runs, and process cleanup now confirms that known descendants have exited. **Behavior changes for hosts:** Qwen below 0.26.0 refuses HTTP MCP servers at open, cleanup reports "could not be verified" in more cases and can take up to about 5 s longer, and `RefusableSessionOption` grew.

## Behavior changes
- Qwen below `0.26.0` (readable version) refuses HTTP `mcpServers` before launch with `UnsupportedOptionError("mcpServers")`, and declares `mcpTransports: ["stdio"]`. With an unreadable version nothing is refused and `mcpTransports` is absent (#1031).
- Process cleanup on an OAR-initiated stop now identifies, signals and confirms the exit of known descendants, checking PID and start time on all three platforms; a POSIX zombie counts as exited. The confirmation after the root exits now waits up to 5 s for a descendant that is still going away, so `exited` and dispose can settle later than before. A surviving descendant, or one whose identity OAR cannot read (Linux `hidepid`, protected Windows processes without admin rights), makes cleanup unverified where it used to be skipped silently: hosts see "Descendant cleanup could not be verified: ..." more often in `exited.reason` and in open errors. Processes the system refuses to let OAR signal (another user's) are left out of the check (#1030).
- `RefusableSessionOption` gains `nativeMemoryDefault`, so exhaustive switches or `Record`s over it need the new member (#1033).

## Capabilities before open (#1031, #1033), feature
- `SessionCapabilityDeclaration.mcpTransports?: ("stdio" | "http")[]` lists the session MCP transports verified for this installation (`[]` where MCP is refused; absent when unverified or known only from the handshake). `stopTask?: boolean` says whether an opened session has `Session.stopTask`. Both are bound in the shared behavior suite, which opens a live HTTP MCP server where `http` is declared and expects the refusal where it is not. `McpTransport` is exported from `@botiverse/oar` and, with `ContextUsageCapability`, from `@botiverse/oar/capabilities`.
- `SessionOptions.nativeMemoryDefault?: "off"` lowers native background auto-memory at the runtime's lowest configuration layer, so explicit user, workspace or system settings still win. `Session.capabilities.nativeMemory?: "on" | "off"` reports the effective state at open; absent means unknown, never off.
  - Qwen `0.26.0` and later: OAR writes a private (0600) copy of the system defaults with managed auto-memory, auto-dream and auto-skill off, keeping the other keys of any existing defaults file (including one named by `QWEN_CODE_SYSTEM_DEFAULTS_PATH`), and removes it when the child exits or the launch fails. Open rejects if that existing file is not a valid JSON object or exceeds 4 MiB. Qwen 0.26.0 and later sessions report `nativeMemory` from Qwen's settings layers even without the option, and leave it absent where an environment variable, launch flag, sandbox or trusted-folder override could change it.
  - Qwen below `0.26.0` or with an unreadable version refuses the option, declared per installation through `installedSessionCapabilities` (the static `qwenRuntime.refusedSessionOptions` does not list it).
  - Claude refuses it, because it has no settings layer below the user's; for a hard disable use `userConfiguration: { exclude: ["instructions"] }`. Every other built-in runtime declares the refusal and leaves `nativeMemory` absent.

## Fixes
- Qoder: session MCP configuration, which can carry credentials, goes through a one-shot private handoff instead of a temp file kept for the whole session. On POSIX it is a 0600 FIFO in a 0700 directory removed once Qoder has read it at startup; on Windows (and where `mkfifo` is unavailable) a 0600 file removed right after `initialize`, before the first prompt. The Windows path has not yet run against a Windows Qoder binary. Abandoned handoff directories are swept on every launch. Claude's handoff now uses the same shared helper, unchanged (#1029).
- CodeBuddy: a plain-text `codebuddy.ai/errorMessage` on a failed outcome is kept as the failure's `reason` instead of the outcome code or `refusal` (#1035).

## Also
- CI: OpenCode 1.x and 2.x ACP suites both gate pull requests on Linux and Windows, and main adds macOS; OpenCode's verified platforms are now all three (#1026, #1034). OpenCode native Code Mode MCP tools are exercised (#1028).
- Docs: failure classification shrinks to the shared contract and evidence rule, with each classifier's evidence tier annotated in code and per-runtime failure notes on the runtime pages (#1035). Capability prose, the query deadline helper and the pool key link their one source instead of restating it (#1032, #1036). The November 19 runtime version check (#1038).

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

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

0 participants