Repository navigation
Replace hand-rolled executable resolution with the which package - #8
Merged
Merged
Conversation
resolveExecutable shelled out to `which` on POSIX and spawned powershell Get-Command on Windows (with a .ps1-sibling fallback and a 15s timeout for cold runners — installation.test.ts paid ~5s per Windows CI run for it). The which package does the same PATH+PATHEXT walk in pure JS with no child process, so the platform branches, the env-var handoff, and the ExecFileSyncLike/ExecutableResolveOptions test seam all disappear, along with the powershell regression test that existed only to pin that seam. Co-Authored-By: Claude Fable 5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 11, 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_721b47cf35cd6b34f746ca38e595ce01"><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 --> Cursor now accepts `SessionOptions.mcpServers`, so every OAR runtime except Pi Durable can take MCP servers per session. Antigravity still refuses entries that carry credentials. Raft needs this to attach its managed MCP through OAR on every runtime (#oar-raft:fb90875b, Raft task #8). ## Change - `cursorMcpServers` maps the list to the SDK's `mcpServers` record. Stdio entries become `{type: "stdio", command, args, env}` and http entries become `{type: "http", url, headers}`. The record is sent on `Agent.create` and again on `Agent.resume`. - Names are checked before the SDK is loaded (empty, repeated, reserved), the same as on every other runtime. - The Cursor session now opens through `withSessionCredentials`, like the other runtimes. Entry `env` and header values are redacted from records, errors and control answers. Before this, Cursor sessions had no session credential redactor, because they took no credentials. - Docs: the `cursor.md` session MCP section is rewritten, and `runtime-matrix.md` drops the refusal and adds a Cursor row to the MCP table. ## Evidence `experiments/cursor-mcp.ts` was run twice on xxwork by the Otter in #all (SDK 1.3.1, Linux x64, `gpt-5.4-nano`, an existing login). The run used one stdio and one http entry of the repo's echo MCP server, each with a synthetic credential. ```json {"open":{"status":"finished","stdio":true,"http":true,"toolCallDeltaNamesEcho":true,"credentialLeaked":false},"resume":{"status":"finished","stdio":true,"http":true,"toolCallDeltaNamesEcho":true,"credentialLeaked":false}} ``` - Raw deltas: `tool-call-started/completed` carry `toolCall.args.toolName: "echo"`, and `providerIdentifier` is `echo` or `remote`. - Each echo carried the fingerprint of its entry's credential, so `env` and the `Authorization` header reached the servers. - After both runs, neither credential was found as plain text in Cursor's local storage: `~/.cursor` (agent `index.db`, `store.db`, WAL), `~/.config/cursor`, and its caches. Antigravity is different: it keeps them, which is why it still refuses credentialed entries. - Not observed: whether the SDK sends a local agent's entries to Cursor's servers, any other encoding on disk, and macOS/Windows. The docs say so. Unit tests: `tests/cursor/cursor-mcp-servers.test.ts` covers mapping on create and resume, absent or empty lists, refused names, and redaction of a credential echoed in an SDK error. `tests/refused-session-options.test.ts` lists are updated. `pnpm run check` is green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Cindy <[email protected]>
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.
必要性
resolve.ts之前自己实现 PATH 解析:非 Windows 上 spawn 一次which二进制,Windows 上 spawnpowershell.exe跑 Get-Command(外加.ps1兄弟文件回退、OAR_RESOLVE_TARGET环境变量传参、15s 冷启动超时)。这是两条子进程路径 + 一个只为测试存在的注入缝(ExecFileSyncLike/ExecutableResolveOptions)。[email protected]用纯 JS 做同样的 PATH+PATHEXT 遍历,不 spawn 任何进程,所以平台分支、注入缝、以及专门钉住 powershell 传参方式的回归测试全部消失。94 行 → 6 行。实证
installation.test.ts在 Windows 上要 5112ms(mac 427ms / ubuntu 224ms),差额就是 powershell 冷启动。换成纯 JS 解析后这块应该掉到与其它平台同量级。变更
resolve.ts:整体替换为which.sync(name, { nothrow: true })包装(94 行 → 6 行)executable/index.ts:删掉ExecFileSyncLike/ExecutableResolveOptions类型导出tests/process.test.ts:删掉 powershell 注入缝回归测试,收窄 importpackages/oar/package.json+ lockfile:which@^2.0.2(dep)、@types/which@^2.0.2(devDep)🤖 Generated with Claude Code