Skip to content

docs(design): share runtime processes by default - #515

Merged
stamp-build[bot] merged 4 commits into
mainfrom
agent/cindy/shared-placement
Oct 29, 2026
Merged

stamp-build[bot] merged 4 commits into
mainfrom
agent/cindy/shared-placement

Conversation

@stamp-build

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

Copy link
Copy Markdown
Contributor

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


Adds "Shared runtime processes" to the Placement section of docs/design/system.md, with a matching liveness statement.

#512 measured that sharing saves memory for runtimes whose own server holds many sessions (ten Codex sessions after one turn: about 1,974 MiB as ten app-servers, 218 MiB as ten threads on one; the ACP agents used between about half and an eighth of their isolated RSS; one OpenCode version used more CPU shared). xxchan asked for a shared/isolated choice covering Codex and ACP, then for sharing by default (#core:2a8c938a).

Direction: once a runtime version meets the evidence gate, its sessions share a process by default. A host that needs a stop independent of the runtime, or a crash or leak confined to one session, chooses isolated placement on the runtime instance it opens sessions from (default instances are module level, so their sessions join one pool per host process). Session members stay the same; what dispose, the abort fallback and resources() guarantee differs by placement and is declared.

Five rules:

  1. Share only when process-level settings match (executable and arguments, environment overlay, home and configuration directories); per-session protocol state does not split the pool where evidence shows it stays per session.
  2. The fallback releases the session instead of killing the process: OAR records a release (its own fact, like an exit); a release after the turn's accepted abort or dispose reads aborted, as an exit does in isolated placement; no native outcome is invented, later frames are still recorded, later controls are refused. Shared dispose records the same release.
  3. Ending a session stops only what it started, through the runtime's per-session cleanup addressed by runtime ids, never the OS process tree. Failed cleanup is recorded, never reported as stopped. The native session is released where the runtime can, otherwise declared. Codex thread/archive is not used, because a resume would need unarchive, which OAR never does.
  4. One fault ends every session in the pool, each with its own exit record; a shared process is not restarted or replaced while sessions run in it.
  5. A runtime version shares only with evidence on each platform: concurrency; isolation of messages, cwd, MCP servers and child-session attribution; cancellation that leaves peers running; per-session cleanup; resuming a loaded session; failure cases; and lower memory without higher CPU. No runtime meets this yet (the 2026-10-28 report is Linux only and has no failure cases), so today every runtime stays one process per session. Claude, Qwen, Qoder and Pi RPC are always isolated.

liveness.md records that a release settles waiting folds as an exit does; the record stream spec gains the record when sharing ships.

Two subagent review passes. The first found blocking problems in the earlier text (archive as cleanup contradicting "OAR never unarchives"; "failed and detached" inventing an outcome; overstated ACP ratios and contract claims; a gate weaker than the report's own boundary); all are fixed. The second confirmed the fixes and its remaining points are applied.

Design text only; implementation tasks follow.

🤖 Generated with Claude Code

@stamp-build
stamp-build Bot force-pushed the agent/cindy/shared-placement branch from 9b85d42 to f97cb06 Compare October 29, 2026 05:18
@stamp-build stamp-build Bot changed the title docs(design): shared runtime processes docs(design): share runtime processes by default Oct 29, 2026
Cindy and others added 3 commits October 29, 2026 06:54
One process per session stays the default. A host may choose shared
placement for runtimes whose own server holds many sessions (Codex
app-server, ACP agents verified for concurrent sessions), under five
rules: share only what the process fixes, stop without killing the
process, end a session with the runtime's own per-session cleanup,
one fault ends every session in the pool, and offer it only with
per-version evidence. Evidence: experiments/runtime-resources-2026-10-28.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sessions share a runtime's process where its server holds many sessions
and OAR has evidence for the version; isolated placement is the host's
explicit choice for a stop independent of the runtime and crash or leak
confinement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build
stamp-build Bot force-pushed the agent/cindy/shared-placement branch from f97cb06 to 99c5ada Compare October 29, 2026 10:56
@stamp-build
stamp-build Bot merged commit 45411a0 into main Oct 29, 2026
1 check passed
@stamp-build
stamp-build Bot deleted the agent/cindy/shared-placement branch October 29, 2026 11:01
@stamp-build stamp-build Bot mentioned this pull request Oct 29, 2026
stamp-build Bot added a commit that referenced this pull request Oct 29, 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_842a7b81b9cd560fcc5dd881bbf588a1"><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 -->

Patch release: Qoder CLI 1.1.81 support. No API breaking changes. Qoder
now refuses to open when its CLI version cannot be read as a stable
version (see Behavior changes).

## Fixes

### Qoder 1.1.81 sessions open again (#526)
Qoder CLI 1.1.81 (published 2026-10-29) removed the SDK worker that OAR
drove through `--print --input-format stream-json ...
--permission-prompt-tool stdio`: it rejects that flag with
`sdk_worker_removed`, and without it ordinary stream-json ignores
`initialize`. Every Qoder session and model listing failed before
opening on 1.1.81. From 1.1.81, OAR starts the CLI with `--sdk` and uses
the official SDK's daemon protocol (the one
`@qoder-ai/qoder-agent-sdk`'s public `startDaemon()` uses):
`daemon.initialize` (protocol version 2, `multi_session_v2`,
`daemon_queries_v1`), then `daemon.open_session` with the same worker
arguments and cwd. Model listing and model confirmation use
`daemon.get_models`. Qoder 1.1.78 to 1.1.80 keep the previous transport
unchanged. OAR still owns one Qoder process per session. The 1.1.81
checks ran on Linux with Qoder's fake-response provider and a synthetic
local login; a real paid-account check is still pending.

### Qoder errors no longer blame the requested effort (#526)
Any failure while opening with `effort` set used to read "Qoder could
not confirm effort ...". Startup and `initialize` failures now read
"Qoder startup failed (requested effort ...)", model-confirmation
failures keep their own message, and only a failed settings readback
says "could not confirm effort". All Qoder versions.

## Behavior changes

### Qoder needs a readable version (#526)
OAR selects the Qoder transport from the installation's version, or,
when that is absent, by running the installation command with
`--version` (15 s limit; a failed or timed-out run reports that
failure). If the version is not a stable `major.minor.patch` (for
example a pre-release build), opening a session or listing models is
refused with a version compatibility error instead of guessing a
permission transport. The transport follows the installation you pass
in: re-probe the installation after upgrading Qoder.

### Qoder daemon authentication (#526)
On 1.1.81 the daemon handshake carries the child environment's
`QODER_PERSONAL_ACCESS_TOKEN` (preferred) or `QODER_SERVICE_ACCOUNT_KEY`
when set, otherwise the native local login. A service-account key
combined with another explicit credential is refused, as in the native
CLI. A `QODER_JOB_TOKEN` without a personal access token is refused: the
daemon needs a host callback for that mode, which OAR does not
implement. Credentials are sent in the private handshake, never in argv
or records.

### Qoder daemon frames (#526)
Connection-wide daemon frames OAR does not recognize are kept in the
session's record unchanged. A frame for another session is a protocol
error: OAR terminates the owned process and records why in
`exited.reason`; during startup, opening is refused with the same
reason.

### Qoder `launchArgs` (#526)
`--sdk` and `--acp` in Qoder `launchArgs` are refused with
`UnsupportedOptionError("launchArgs")`: OAR owns the transport.

## TypeScript

The `exited` response and event gain an optional `reason?: string`
(#526). It is present only when OAR itself terminated the process and
explains OAR's decision; an independent native exit has none. Today only
Qoder's foreign-session termination sets it; dispose and abort-fallback
terminations carry none. An unfinished turn's `runtime_exited` outcome
uses it as its reason. Existing code that reads `exited` keeps working.

## Docs
- Design: when OAR lacks a capability, whether it is a gap in OAR's
mapping or a limit of the vendor interface OAR uses, and the two ways
past it, ask or fork (#510).
- Design: shared runtime processes. Where a runtime version passes an
evidence gate, its sessions will share a process by default, with
isolated placement as a host choice; no runtime passes the gate yet and
this release changes no placement (#515).
- Qoder: transport versions, daemon evidence (two concurrent sessions in
one 1.1.81 daemon, observed only), native permission regression (#526).

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