Skip to content

feat(dsh): support session stdio MCP servers - #650

Merged
stamp-build[bot] merged 2 commits into
mainfrom
agent/otter/dsh-session-mcp
Nov 6, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
agent/otter/dsh-session-mcp

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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


DSH previously refused every SessionOptions.mcpServers entry. It now accepts stdio command/args through native MCP client plugins in the existing private invocation patch. Native model requests advertise the tools; scripted-provider tool calls execute through DSH's MCP client, and results reach both subsequent requests and OAR records. This addresses the command/args path reported by @⁠Ancienttwo in #646.

Each OAR session owns its DSH process. User configuration stays intact, concurrent sessions do not inherit each other's entries, and resume requires entries to be supplied again. Native namespace collisions reject session opening. HTTP and nonempty MCP env/headers remain explicitly refused until their persistence boundary is audited; this uses the existing mcpServerCredentials declaration. Names must satisfy DSH's native format without renaming.

The initial failure probes exposed a necessary startup check: DSH's global loader barrier settles even when a plugin fails. OAR now also waits for each requested native plugin fiber and requires ACTIVE state. Missing methods, inactive plugins, failed commands and collisions cannot silently open a session without the requested tool. Failed startup and disposal terminate the owned MCP children. Bridge JS still imports no DSH package, and there is no ACP exchange or bundled DSH dependency.

Reproducible probe and selected results include native tool results, resupplied/omitted resume and the distinction between unchanged user configuration and ordinary DSH session/cache writes. Persistence of command/args is also unaudited: do not move tokens into args. The native ACTIVE enum check fails closed if DSH changes its value; the latest-version vendor probe covers this dependency.

Validation on Linux:

  • DSH 0.2.1-rc.5 and 0.2.2-rc.1 each pass all 21 native vendor cases and 18 behavior cases, with one capability skip.
  • New cases cover literal arguments and cwd, live session isolation, configured servers, resume, actual child cleanup after dispose and failed open, missing commands and namespace collisions. Startup failure controls failed before the per-plugin check.
  • Full check: 3,568 unit tests after rebasing over fix(codex): preserve completed messages and native metadata #648 and 18 mock behavior cases. Build and clean packed-package consumption pass. Unit controls also cover early typed refusal and missing/inactive native loader capabilities.

Windows and macOS results await this PR's CI. Task #184; separate from the 0.89.0 release. No package version or CI gate change.

@stamp-build
stamp-build Bot merged commit 2882915 into main Nov 6, 2026
78 of 79 checks passed
@stamp-build
stamp-build Bot deleted the agent/otter/dsh-session-mcp branch November 6, 2026 04:48
stamp-build Bot added a commit that referenced this pull request Nov 6, 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_687bf0a2c20c3d85d7291ceff84b402b"><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 cancelled fake login process can leave its shared JSON state empty or
truncated because it rewrites that file in place. The five login
fixtures now write a sibling temporary file and replace the published
state only after the write completes. A killed writer leaves the
previous complete snapshot available to the strict reader; write errors
still fail and the existing fixture-directory cleanup removes abandoned
temporary files.

The regression starts each fake CLI, pauses its first save after
truncation or a partial write, then kills that process and checks the
entire previous snapshot. All ten cases fail against the old writers and
pass with this change. Existing login/logout deadlines, PID requirements
and process-liveness assertions are unchanged, including refusal to
treat an unpublished PID as cleanup evidence.

This was investigated after [PR #650's Windows
check](https://github.com/botiverse/oar/actions/runs/42158919897/job/127699626246)
failed with `Unexpected end of JSON input` in the Claude deadline case.
The fixture was unchanged from main. That run did not retain the
interrupted file or a write checkpoint, so the precise cause of that CI
occurrence remains unconfirmed; this PR fixes a separately reproduced
fixture defect and changes no product code.

Validation:
- Ten deterministic interruption regressions: fail before the fix, pass
after it.
- Login, logout and CLI login suite: 143 passed on Linux.
- Full `CI=1 pnpm run check`: passed (3,569 unit tests and 18 mock
behavior cases).
- Windows and macOS verification will come from this PR's CI.

Co-authored-by: Otter <[email protected]>
stamp-build Bot added a commit that referenced this pull request Nov 6, 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_038a3f19ff5c2d6bb704961ba32d1148"><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 -->

DSH sessions can attach stdio MCP servers, and commands an ACP agent runs through OAR now take that agent's OOM score.

## DSH: session MCP servers (#650, fixes #646)
- `SessionOptions.mcpServers` now accepts stdio `command` and `args` on DSH, through native MCP client plugins in OAR's private invocation patch. The model sees and calls the tools, and resume needs the entries supplied again.
- A server that fails to start refuses the open, where DSH's own loader would otherwise continue without it. A native namespace collision also refuses, and the user's configuration is not changed.
- HTTP entries and non-empty `env` or `headers` stay refused. **Do not move tokens into `args`:** persistence of command and args has not been audited either.
- Verified on Linux with DSH 0.2.1-rc.5 and 0.2.2-rc.1 and a local provider, and by CI on macOS and Windows with the pinned 0.2.1-rc.5. No real account was used.

## ACP terminals take the agent's OOM score (#652)
- A host that wraps a runtime's command to raise its OOM score now gets that score on reverse terminal commands too. These are started by OAR, so they used to keep the host's score, and a runaway command under a protected host stayed protected.
- Linux only, with no option. OAR changes the launch only when the agent's score differs from its own. With equal scores, or if either score cannot be read, the command starts as before. If the kernel refuses the write, the command keeps the host's inherited score.
- Real Grok 1.0.70, Kimi 2.4.1 and CodeBuddy 2.179.3 sent reverse terminal requests and now run them at the agent's score. OpenCode 1.19.5 and Antigravity CLI 1.5.0 ran the probe's command in their own processes. This covers the measured command paths, not every tool a runtime has.

## Tests
- The fake login CLIs now publish their state atomically, so a killed writer cannot leave half a file (#651).

🤖 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.

0 participants