Repository navigation
feat: add command inventories and fix query process cleanup - #351
Merged
Merged
Conversation
Merged
xxchan
added a commit
that referenced
this pull request
Oct 11, 2026
Release OAR and CLI 0.56.0. This PR changes only the two package version fields. **Added: a `commands` inventory** (#348, #351) - `Runtime.commands(installation, { cwd, timeoutMs })` and `oar commands [runtime]` list a runtime's native slash commands for a workspace, separate from `skills()`. Each entry has `name` (the native invocation name, without a leading slash), and where the runtime reports them `description`, `source`, `argumentHint` and `aliases`. - pi: commands registered by extensions, under pi's own invocation names (two extensions registering the same name list as `name:1` and `name:2`), and prompt templates with their argument hints. The result is `partial` when an extension or resource failed to load. - claude: the command list from claude's own initialize answer, projected to the fields above only; no account fields. Project skills can appear here too. - Other runtimes return `unsupported`. Neither reader sends a model request or returns a command's body. This is the catalog at startup, not commands a session adds later. - Inventory starts the runtime in that `cwd` the way the runtime itself would, which can run that workspace's code (pi loads the project's extensions). This was already true for `skills`, `tools` and `mcpServers`. Do not inventory a directory you do not trust. **Fixed: inventory, model listing and account usage no longer leave runtime processes behind** (#351) - claude's inventory, model listing and account-usage queries and grok's inventory ended only their direct child on Windows, often an npm `.cmd` launcher, leaving the real runtime process running with its working directory locked. On POSIX a descendant that had left the process group (for example a detached process started by a stdio MCP server) was also left running (verified on Linux; macOS uses the same process-group code). They now end the whole process tree, as sessions already did, and return only after it exits. Other places OAR ends a process on Windows are tracked in #352. **Behavior changes** - `RuntimeInventories` gains a required `commands` reader. Runtimes built with `defineRuntime` get an `unsupported` one automatically; a host that constructs a `Runtime` object by hand must add `commands`. - `CommandEntry` is exported from both contract entries. Validation: #351 passed all 17 checks on its final head, and its merged tree equals its CI tree. Lookout verified it with no account against pi 1.1.0 and claude 2.1.296: colliding extension commands, prompt templates with and without argument hints, a changed `cwd`, a failing extension (`partial: true`), timeouts, the CLI output, no account data or command bodies in claude's result while a fake account was configured, no model request, no process left behind (including a detached grandchild of a stdio MCP server that 0.55.0 left running on Linux), and `unsupported` from every other runtime. After this PR passes CI and merges, tag its exact squash commit as `v0.56.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
xxchan
pushed a commit
that referenced
this pull request
Oct 12, 2026
…run workspace code claude gives argumentHint "" for a command without one; it is now absent, as on pi (rowrow already dropped it). The inventory spec says plainly that a reader starts the runtime in cwd as a session would, so it can run that workspace's code: do not inventory an untrusted directory. Both from Lookout's check of #351. Co-Authored-By: Claude Opus 5.5 <[email protected]>
xxchan
added a commit
that referenced
this pull request
Oct 12, 2026
…run workspace code (#357) Two follow-ups from Lookout's check of #351 (0.56.0): - **Empty argument hint:** claude reports `argumentHint: ""` for a command without one; pi leaves the field out. OAR now leaves it out on claude too, so hosts see one shape. The existing command test feeds an empty hint and expects none. - **Inventory runs workspace code:** `docs/spec/inventory.md` now says that every reader starts the runtime in `cwd` the way a session would, so it can load and run that workspace's code (pi's project extensions, a configured stdio MCP server), and that a host should not inventory a directory it does not trust. This was already true for `skills`, `tools` and `mcpServers`; Lookout confirmed pi runs a project extension during `commands()`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 12, 2026
Release OAR and CLI 0.57.0. This PR changes only the two package version fields. Most of this release comes from comparing OAR with the Claude Agent SDK and the codex SDK (#342): in common host scenarios OAR should be no worse than a runtime's own SDK. **Added: `listModels` names the default model and each model's provider** (#347, #355) - `ModelEntry.default: true` marks the model a session uses when no `model` is set, where the runtime says so: codex's configured model (`config/read` for the host's cwd, when it is listed), else codex's catalog `isDefault`; a new ACP session's current model on grok, kimi and antigravity; the default saved in pi's settings (global plus the project at the host's cwd). claude, cursor and opencode mark none, because they cannot say which model an unset session runs. OAR never picks one. - `ModelEntry.provider: { id, displayName? }` for runtimes with several providers: pi (with pi's display name, omitted when it only repeats the id) and opencode (`providerID`), so hosts never parse `id`. **Added: host-set limits and schemas have their own failure classes** (#339, #356) - `limit_reached`: claude stopped at `--max-turns` or `--max-budget-usd` (result subtypes `error_max_turns`, `error_max_budget_usd`). - `output_schema`: the runtime could not produce output matching `SessionOptions.outputSchema` (claude `error_max_structured_output_retries`, grok `structuredOutputError`). Both used to be `unknown`. - `failureAdvice` says not to retry either until the host changes the limit or schema; `failureText` words them. - A claude error result's `reason` is now its subtype followed by claude's own `errors` text (`error_max_turns: Reached maximum number of turns (2)`). **Added: reasoning tokens** (#345, #362) - `TokenTotals.reasoning`: the part of `output` the runtime reports as reasoning, on codex (`reasoningOutputTokens`), grok, pi, pi-durable and cursor. It is already inside `output`, so do not add it again. Unreported stays absent and a reported 0 stays 0; it accumulates, survives resume baselines and `withChildren`, and replays the same from JSON records. claude and the other ACP runtimes report none. **Fixed: claude `launchArgs` that collide with OAR's own flags are refused** (#336, #356) - `--continue`/`-c`, `--resume`/`-r`, `--session-id`, `--fork-session`, `--permission-mode`, `--print`/`-p`, `--input-format`, `--output-format` and `--json-schema` (also in `--flag=value` form) are refused at open with an `UnsupportedOptionError` naming the option to use. Before, `--continue` made claude exit, `--fork-session` left `Session.id` on the old id, and `--permission-mode` was silently overridden. Each argument is compared whole, so a value equal to one of these flags is refused too. **Changed: `oar mcp` returns structured results** (#304, #360) - `run`, `wait` and `list` declare an `outputSchema` and return `structuredContent` alongside the JSON text, for clients that call tools from code (OpenCode v2's `execute`, codex code mode). - `wait` now returns `{ reports }` and `list` returns `{ agents, unread }` (both were top-level arrays; `list` carries the unread reports as a field instead of a text note). **Fixed: `session_linked` once per edge** (#324, #361) - A child session's lineage is emitted on the first frame that names it, not on every frame that repeats it (OpenCode v2 repeated it on every child frame). The graph was already deduplicated; a resumed session's new stream reports the edge again once. **Fixed: inventory** (#351, #357) - claude's commands no longer carry an empty `argumentHint: ""`. - The inventory spec says plainly that a reader starts the runtime in `cwd` as a session would, so it can run that workspace's code: do not inventory an untrusted directory. **Behavior changes** - `FailureClass` gains `limit_reached` and `output_schema`; `ModelEntry` gains `default` and `provider`; `TokenTotals` gains `reasoning`. Hosts with an exhaustive `switch` or `Record` need the new cases. - `oar mcp` `wait` and `list` return objects, not arrays. - claude error reasons are longer; claude `launchArgs` with the flags above are refused. Validation: every PR passed all 17 checks on its final head (#358 and #359 change only Markdown and one comment). #355 and #356 merged with trees equal to their CI trees; #357, #360, #361 and #362 merged after typecheck, lint and the full unit suite passed locally on top of the PRs merged before them. Verified against real runtimes with mock providers and no account: codex 0.162.1 default under four configurations, pi with two providers and saved defaults, grok, kimi and opencode listings; claude 2.1.296 launchArgs refusals (claude not started), `--max-turns`, `--max-budget-usd` and exhausted schema retries; grok schema errors; the built `oar mcp` returning structured `list` and `wait`; codex 0.162.1 reasoning counts of 3 then 7 across a resume; `session_linked` once on OpenCode v2, codex and grok recordings. After this PR passes CI and merges, tag its exact squash commit as `v0.57.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 20, 2026
… for Claude/Codex (#1085) <!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/ZXll.svg" width="16" height="16" align="absmiddle" alt=""> <b>Lookout</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_4e33008d67b16f5e5dad5b49538fae83"><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 --> ## Summary Declare `Runtime.credentials` across all 15 built-in runtimes, extend `RuntimeCredentials` / `CredentialVariable` / `CredentialStore` with the structured fields Raft needs for disk watching, credential stripping/redaction, store isolation, sign-in UX, and interpolation handling, and expose stable native account identity (`LoginAccount.accountId`) on Claude and Codex. Closes Raft handoff items D11, S2, S3, and S4 (tracked in `#core:#351`). ## Contract changes - `packages/oar/src/contracts/credentials.ts` (extracted from `contracts/runtime.ts`, re-exported from `contracts/index.ts` and root `@botiverse/oar`): - `RuntimeCredentials`: added `scope` (`"single_account" | "per_provider"`), `management` (`"native" | "external"`), `signInPaste` (`"none" | "code" | "code_or_url"`), `usageDirectoryEnv`, and `interpolation` (`readonly CredentialInterpolation[]`). - `CredentialVariable`: added `provider` and `field` (`CredentialField`) so hosts can strip/redact controlled env keys and attribute errors to the owning credential field. - `CredentialStore`: added `fallbackDirectoryEnvs` (for runtimes like Pi that fall back from `OAR_PI_AGENT_DIR` to `PI_CODING_AGENT_DIR`) and `service` (static OS keychain/keyring service name where known). - `packages/oar/src/contracts/login.ts`: added `LoginAccount.accountId?: string`. ## Account identity (`D11`) - **Claude** (`packages/oar/src/runtimes/claude/last-account.ts`, `auth-status.ts`): `claudeAccountProfile` reads `oauthAccount.accountUuid` from the matched `.claude.json` alongside `planDisplayName` (only when `emailAddress` / `organizationUuid` / `organizationName` match the signed-in non-API-key account) and populates `LoginAccount.accountId`. - **Codex** (`packages/oar/src/runtimes/codex/account-id.ts`, `login.ts`): read-only, non-blocking (`O_RDONLY | O_NONBLOCK`, <= 1 MiB) reader for `$CODEX_HOME/auth.json` (default `~/.codex/auth.json`) `tokens.account_id`, wired into `codexAuthStatus` and `codexLogin` confirmation for ChatGPT logins. Never returns or logs token fields. ## Per-runtime credential declarations (`D11`, `S2`, `S3`, `S4`) Every store `directoryEnv` and `fallbackDirectoryEnvs` is strictly disjoint from `env[]`. | Runtime | Scope / management | Sign-in paste | Store directory env (`usageDirectoryEnv`) | Keychain service / primary stores | Interpolation | Evidence | | --- | --- | --- | --- | --- | --- | --- | | antigravity | `single_account` / `native` | `code_or_url` | none | OS keyring, `~/.gemini/antigravity-cli/antigravity-oauth-token` | none | `agy 1.5.13` binary (`KeyringTokenStorage`), `antigravity/token-email.ts` | | claude | `single_account` / `native` | `code` | `CLAUDE_CONFIG_DIR` (usage), `ANTHROPIC_CONFIG_DIR` | macOS Keychain (`Claude Code-credentials`), `.credentials.json`, `.claude.json`, `.config/anthropic`, AWS/gcloud/Azure/XDG stores | none | Claude Code 2.1.328, `sea-trial/vendor/support/user-configuration/claude-store.ts` | | codebuddy | `single_account` / `native` | `none` | `CODEBUDDY_CONFIG_DIR` | `.codebuddy/settings.json`, `.codebuddy.json`, cwd `.codebuddy/settings[.local].json`, `.codebuddy` dir | none | `codebuddy 2.173.0` binary | | codex | `single_account` / `native` | `none` | `CODEX_HOME` (usage) | OS keyring (`Codex Auth`), `auth.json`, `config.toml` | none | `codex 0.170.0` binary (`login/src/auth/storage.rs:396`), `experiments/codex-quota-errors/probe.ts` | | cursor | `single_account` / `native` | `none` | none | `~/.cursor/sdk/auth.json` | none | `@cursor/[email protected]`, `docs/runtimes/cursor.md` | | devin | `single_account` / `native` | none | `XDG_DATA_HOME` | `$XDG_DATA_HOME/devin/credentials.toml` | none | Devin 3000.12.57, `experiments/devin-acp/README.md`, `docs/runtimes/devin.md` | | dsh | `single_account` / `external` | none | `DSH_HOME` | `.credentials.yaml`, cwd `.env`, `$DSH_HOME/.env` | none | DSH 0.2.1-rc.5, `docs/runtimes/dsh.md` | | factory | `single_account` / `native` | `none` | `FACTORY_HOME_OVERRIDE` (usage) | OS keyring, `.factory/auth.v2.file`, `.factory/auth.v2.key`, `.factory/settings.json` | none | `droid 1.12.1`, `factory/account-credential.ts` | | grok | `single_account` / `native` | `none` | `GROK_HOME` (usage) | `auth.json`, `mcp_credentials.json`, `config.toml` | none | `grok 1.0.89` binary | | kimi | `single_account` / `native` | `none` | `KIMI_CODE_HOME` (usage) | `credentials/`, `config.toml` | none | Kimi 2.6.3, `kimi/auth-config.ts`, `docs/runtimes/kimi.md` | | opencode | `per_provider` / `native` | `code` | `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `OPENCODE_CONFIG_DIR` | `opencode/auth.json`, `opencode/opencode.json`, config dir, cwd `opencode.json` | `{env:VAR}` | `opencode 1.18.30` binary (`/\{env:([^}]+)\}/g`), OpenCode 2.2.7 | | pi | `per_provider` / `native` | `code_or_url` | `OAR_PI_AGENT_DIR` (fallback `PI_CODING_AGENT_DIR`) | `auth.json`, `models.json`, gcloud ADC, `~/.aws/credentials` | `$VAR`, `!command` | `@earendil-works/[email protected]` (`env-api-keys.js`, `auth/resolve.js`, `auth/oauth/anthropic.js`), `pi/config-value.ts`, `pi/resolve.ts` | | pi-durable | `per_provider` / `external` | none | none | host-supplied | none | `pi-durable/index.ts` | | qoder | `single_account` / `native` | `none` | `QODER_HOME` | `$QODER_HOME` dir (`<name>-credentials.json`, `.keychain-salt`) | none | `qodercli 1.1.78` binary | | qwen | `per_provider` / `native` | none | `QWEN_HOME` | `settings.json`, `.env`, `~/.env`, cwd `.env`, `oauth_creds.json`, gcloud ADC | none | Qwen 0.26.2, `qwen/auth-status.ts`, `qwen/auth-files.ts` | ## Verification - `CI=1 pnpm run check` passes locally (typecheck, `oxlint --type-aware --deny-warnings`, unit tests, and mock `sea-trial`). - `tests/credentials-shape.test.ts`: asserts all 15 runtimes declare `credentials`, unique `env` names with `field`, strict disjointness from `stores[].directoryEnv` + `fallbackDirectoryEnvs`, `usageDirectoryEnv` backed by `accountUsage` and `stores`, `management`, `signInPaste`, `interpolation`, keychain `service`, and full coverage of `@earendil-works/pi-ai/dist/env-api-keys.js`. - `tests/login/codex-account-id.test.ts` and `tests/claude/claude-plan-display-name.test.ts`: verify `LoginAccount.accountId` population and safety boundaries on Codex and Claude. --------- Co-authored-by: Lookout <[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.
Hosts can now discover native slash commands with
Runtime.commands(installation, { cwd, timeoutMs })andoar commands [runtime]. Pi reports extension invocation names and prompt templates, including native argument hints; Claude reports command metadata from its private initialize response. Skills remain a separate inventory. Other selected transports return explicit unsupported results.Pi preserves the SDK's resolved names for colliding extension commands and marks incomplete resource loading as partial. Neither reader submits a model prompt or returns command bodies, handlers or account fields. This is an independent startup catalog, not commands added later by session hooks or a guarantee that each command works without a terminal UI. The native evidence report documents those boundaries and the other runtime interfaces checked.
Windows CI exposed a pre-existing teardown gap: these query processes awaited their launcher exiting but did not stop its native descendants. Enable the existing process-tree cleanup for Claude inventories, model listing and account-usage queries, and Grok inventories. Lookout also reproduced the detached-descendant leak on Linux and verified the fix there; macOS was not separately probed. Regression tests check the four spawn options and ensure inventory success, failure and timeout all wait for process exit before returning. The commands, structured-output and additional-directories vendor fixtures also use the repository's bounded Windows retry settings. Other process helpers are tracked separately in #352.
Compatibility:
CommandEntryis exported from both contract entries.defineRuntimesupplies the unsupported reader automatically; manually constructed objects typed asRuntimemust addcommands.Validation: final
pnpm run check(1,690 tests) and package/CLI build passed. All five behavior backends, real Pi 1.1.0 and Claude 2.1.296 command tests, isolated native probes, and the built CLI's workspace/template query passed. The teardown revision also passes the query regressions, Claude native and behavior checks, and Grok native inspect/timeout checks. No real accounts or model requests were used by the inventory probes. The affected structured-output and additional-directories vendor files also pass all 11 applicable Claude, Codex and Kimi cases locally. The original command-query Windows cleanup failure remains visible in run 38123476682; it passed in run 38124312506, which exposed the existing structured-output fixture cleanup failure. Final CI reruns with both fixes.Closes #348.