Skip to content

feat(grok): add an experimental shared adapter and routing evidence - #585

Merged
stamp-build[bot] merged 3 commits into
mainfrom
agent/otter/grok-shared-adapter
Oct 31, 2026
Merged

stamp-build[bot] merged 3 commits into
mainfrom
agent/otter/grok-shared-adapter

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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


Grok 1.0.70 starts configured stdio MCP children in the ACP process HOME when sharing, whereas isolated sessions start them in the session directory. Both session-supplied and native user-configuration controls reproduce the difference. Session options cannot rule out configured servers, so the public Grok runtime remains isolated under auto and refuses explicit shared with option placement. No native runtime is enabled for sharing by this change.

The candidate adapter remains available only to explicit experiment compositions. It requires exact native 1.0.70 installation/initialize versions and fully qualified startup paths, rejects stdio MCP session options, and keeps custom inputs on the independent path. HTTP-only controls use disposable configuration. Windows drive-relative and root-relative paths are refused; pnpm relative PATH entries also prevent candidate sharing.

The shared ACP router accepts Grok's native subagent_spawned parent/child pair as ownership evidence. Completed subagent results only check that established relationship. Parent ownership is checked against the carrying root; accepted links are removed on owner disposal. Child requests have a one-second ingress deadline independent of any in-flight session/new; the frame count/byte limits remain bounded. Default OpenCode routing keeps its existing request pause. Regressions cover cross-root forged spawn/completion, grandchildren, completion before spawn and the OpenCode pending-new path. Twelve Linux native samples observed spawn 68-83 ms before child output, including five-second children, so this allowance does not wait for tool completion.

Real candidate sharing behavior and lifecycle controls move to grok-sharing-experiment.yml, outside default CI. Its steps depend on successful installation and upload only the Grok artifacts. Native lifecycle controls inject the actual diagnostic callback and require no conflict/expired diagnostics. No native initialization deadline is increased. The earlier Windows lifecycle timeouts remain missing successful evidence, not a passing result.

The manual shared-runtime evidence workflow gains actual child cwd/environment controls for Grok and OpenCode, including session/user stdio MCP, user/project hooks/plugins and terminal tools. Missing observations or differences fail the step and preserve evidence. All 24 Linux cohorts completed; each runtime/version comparison fails for the observed cwd mismatch. OpenCode's separate production withdrawal is already in PR #587. The evidence report, normalized selection and rebuild script retain all observations; no macOS/Windows result is inferred. The workflow can select exact OpenCode 2.2.3 or 2.2.5 and child-environment-only runs. It does not grant admission.

Validation:

  • Full CI=1 pnpm run check on base ddec7e5: 2,948 tests and 18 mock behaviors passed. Package builds passed before rebasing the documentation fixes and release version bump from 2c67f52; runtime, test, workflow and evidence files are unchanged by those rebases.
  • Before rebasing onto the OpenCode withdrawal, the unchanged shared machinery revision passed all 14 ordinary behavior backends. CodeBuddy was rerun with its correct pinned executable after a local path error caused an unavailable skip in the first batch; that skip was not counted as coverage.
  • Grok candidate behavior: 17 passed; native shared/isolated lifecycle: 2 passed; MCP/hook environment controls: 8 passed. New shared timing assertions use the real router's diagnostics.
  • Removing the production refusal causes all three public placement regressions to fail with actual shared placement. Four routing mutations from the original implementation were caught, and the requested additional adversarial cases pass.
  • Ten Python evidence-selection checks passed. The selected 24 cohorts rebuild byte-for-byte from the raw observations, which have been shared with the reviewer. Both workflow files parse successfully.

Three-platform validation of the new native controls remains manual and pending. Public refusal and synthetic regressions remain in the required CI gate. Cindy owns the release; this change does not bump package versions.

@stamp-build stamp-build Bot changed the title feat(grok): enable admitted shared ACP sessions feat(grok): retain an experimental shared adapter with production sharing refused Oct 31, 2026
stamp-build Bot added a commit that referenced this pull request Oct 31, 2026
…ple (#587)

<!-- 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_4cb28792c4d1423d748ad6c6b9d2518b"><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 -->

Configured OpenCode plugins can start child processes in the ACP
process's working directory. Eight native Linux controls on 2.2.3 and
2.2.5 show the same difference: user/project plugins inherit HOME when
shared and the session directory when isolated.
`ctx.location.directory`, tool cwd and the synthetic environment marker
remain correct. Since configured plugins are not observable from
SessionOptions, an options-only restriction cannot make sharing
equivalent.

OpenCode now always opens an isolated process for `auto`; explicit
`shared` throws `UnsupportedOptionError` with option `placement` and the
reason above. This withdraws the formerly enabled 2.2.3/2.2.5 cells on
all platforms. It changes default placement and is intended for the next
minor release. Hosts that explicitly select isolated placement keep
their existing behavior.

The exact-version checks, directory ownership and lifecycle mechanisms
remain behind an explicit experiment composition. Their unit regressions
stay in ordinary CI; real shared behavior/lifecycle controls move to a
manual workflow. The existing real isolated cleanup CI stays in place.
The manual plugin comparison records both cohorts and fails for a
mismatch or missing evidence. No public package option or environment
variable bypasses the refusal.

The report and reproducible selected observations are in
`experiments/sharing/opencode-plugin-environment-2026-10-31.md`; current
design, spec, runtime and evidence documents reflect the withdrawal. The
raw eight JSON files were shared with Cindy in Raft and independently
verified. These new observations cover Linux x64 only; no new
macOS/Windows plugin result is claimed. Grok's separate revision remains
PR #585.

Validation:
- Full `CI=1 pnpm run check` (2,881 tests and 18 mock behaviors) and
package builds passed.
- Public Runtime regressions cover previously admitted versions, a newer
version, empty/session HTTP MCP inputs, distinct isolated process IDs
and typed explicit-sharing refusal.
- Existing candidate mechanism tests remain; the real isolated cleanup
regression and shared/isolated candidate lifecycle controls pass on
native 2.2.5.
- The selected data reconstructs byte-for-byte from the eight original
observations. Missing/error observations fail comparison. Removing the
production refusal makes all three public regression cases fail with
shared placement instead of isolated.

Co-authored-by: Otter <open-agent-runtime+otter@agents.stamp.build>
@stamp-build
stamp-build Bot force-pushed the agent/otter/grok-shared-adapter branch from 13a757a to 1290d0d Compare October 31, 2026 22:25
@stamp-build stamp-build Bot changed the title feat(grok): retain an experimental shared adapter with production sharing refused feat(grok): add an experimental shared adapter and routing evidence Oct 31, 2026
@stamp-build
stamp-build Bot merged commit 9c1cf87 into main Oct 31, 2026
36 checks passed
@stamp-build
stamp-build Bot deleted the agent/otter/grok-shared-adapter branch October 31, 2026 22:41
@stamp-build stamp-build Bot mentioned this pull request Nov 2, 2026
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_1fb2c3e99ea3c8907bcc12da1ca1dd98"><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 -->

Minor release: Cursor's optional peer moves to `@cursor/sdk` 1.2.0 and Cursor sessions now report native compaction. A cancellation no longer waits behind a queued process-table read nobody is waiting for (all platforms; most visible on Windows, where reads are slow).

## Behavior changes for hosts

### Cursor SDK 1.2.0 and native compaction (#509)
- The optional peer is now exactly `@cursor/sdk` 1.2.0 (was 1.1.0), and `@botiverse/oar-cli` depends on 1.2.0. A host that hands the SDK to `createCursorRuntime({ sdk: () => import("@cursor/sdk") })` must install 1.2.0. Hosts that do not use Cursor are unaffected.
- Cursor sessions emit the existing `compaction_started` and `compaction_ended` events from the SDK's `run.stream()` summary status: `running` starts, `completed` ends `completed`, `error` ends `failed`. Cursor reports no trigger or reason. A run aborted without a final summary records no compaction end, and a summary error does not change the turn's outcome. No new event type or manual compaction control.
- Every `run.stream()` message is also recorded verbatim as a `cursor/stream/<type>` frame. Only summary statuses add events, so text, tools and usage are still counted once.
- The exported `CursorSdk` type's run now has `stream()`. A host that passes its own SDK object or test double typed as `CursorSdk` must implement it.
- After `run.wait()` settles, the stream gets two seconds to drain. If it stays open, OAR records a `cursor/stream_unclosed` frame, stops reading it and ends the turn normally; late values cannot enter a later turn. A stream failure is recorded as `cursor/stream_failed` with the message redacted like Cursor login diagnostics.

### Process-table reads for expired callers (#596, #597)
- A queued process-table read whose callers have all reached their deadline is skipped instead of run. The batcher serves every platform: the one-second cancellation observation has a deadline everywhere, and on Windows so do the five-second capture, revalidation and background preparation reads. Before, an abandoned read could hold the queue, so a second cancellation shortly after the first could spend its one-second observation budget waiting and leave its tool cleanup unverified. A read already started still completes, and a late result still never counts as identity evidence for a caller that timed out. A request without a deadline always runs. Windows background preparation's existing five-second budget now also covers time spent queued: if it expires before the read starts, the read is skipped and preparation records a timeout.
- A failure while starting a queued read no longer leaves the read in the queue.

### Grok explicit shared placement (#585)
- The refusal message for an explicit `shared` request on `grokRuntime` changed; it is still `UnsupportedOptionError` with `option: "placement"` on every version and platform. Match on `option`, not on the text. The experimental Grok shared adapter added here is internal and unreachable from `grokRuntime` (`auto` stays isolated); only the composition under `experiments/sharing`, where its evidence lives, enables it.

## Docs
- Weekly maintenance pass (#598, #599, #600, #601): spec tables, the package README and runtime pages now cover Qwen, Qoder and CodeBuddy where they were missing, and statements that had drifted from the code are corrected (steer, `withdraw`, `resources()`, login and status coverage, Claude and Codex details, Kimi status and login floor). All pages state that no native runtime is admitted to shared placement.
- Qwen's runtime page documents how Qwen renames reused tool-call ids and suppresses identical replays (#590, #592).

## Tests and CI
- CodeBuddy CI pin 2.179.1 and Qwen 0.26.5 verification (#590); Qwen tool-call id regressions (#592); interrupt tests separated from forced-exit timing (#591); the cancellation-queue regression waits out its expired read before the next control (#595); CodeBuddy installation smoke keeps its result when temporary-directory cleanup fails (#597); pnpm `autoInstallPeers` set in `pnpm-workspace.yaml` and the stale `.npmrc` removed (#594); Grok shared-adapter tests respect the candidate's platforms (#602).

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

Co-authored-by: Cindy <open-agent-runtime+cindy@agents.stamp.build>
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