Skip to content

fix: allow 15 seconds for executable probes - #155

Merged
xxchan merged 1 commit into
mainfrom
fix/executable-probe-timeout
Oct 6, 2026
Merged

xxchan merged 1 commit into
mainfrom
fix/executable-probe-timeout

Conversation

@xxchan

@xxchan xxchan commented Oct 6, 2026

Copy link
Copy Markdown
Member

Windows installation probes have repeatedly hit the shared five-second deadline while running Claude --version or Codex app-server --help. Give runExecutable 15 seconds by default on every platform, so hosts receive the same allowance as CI. Explicit caller deadlines stay unchanged. A stuck command now takes up to 15 seconds to report failure.

This is the maintainer's timeout-policy decision based on the repeated failures; it does not identify which launcher or native startup phase caused the delay. Include it in 0.26.0 without a separate release. Reopen #57 if a probe exceeds the new deadline.

Validation:

  • pnpm run check.
  • Mock, Claude, Codex and Pi aimock behavior suites: all four backends clean.
  • Real child-process checks: a six-second command completes; a stuck command reports the default 15,000 ms timeout; an explicit 100 ms deadline is retained.
  • Searched tests and Markdown documentation: no assertions or current documentation describe a five-second default. Existing explicit-timeout diagnostics remain unchanged.

Closes #57.

@xxchan
xxchan merged commit 0f4c77c into main Oct 6, 2026
13 checks passed
@xxchan
xxchan deleted the fix/executable-probe-timeout branch October 6, 2026 10:19
xxchan added a commit that referenced this pull request Oct 6, 2026
…port each failure (#156)

## What

Two related gaps found in today's inspection round (verified with fake
executables and the built CLI; a codex refuter did not refute them).

**1. claude and kimi account usage answer `unsupported` on a timeout.**
[docs/spec/account-usage.md](https://github.com/botiverse/oar/blob/main/docs/spec/account-usage.md)
says operational failures, timeouts included, reject the promise. codex
and grok do. Two readers did not:

- claude: `supportsSafeMode` returned false for any failed `claude
--help`, a timeout included, so the read answered
`unsupported/unsupported_installation`, telling the host this CLI cannot
be read. The probe also ignored the caller's `timeoutMs` and waited for
`runExecutable`'s 15 s default.
- kimi: `resolveKimiAuth` returned null for any failed `kimi provider
list --json`, so a timeout answered
`unsupported/auth_configuration_unavailable`.

Both now reject with the process diagnostics when the run timed out or
never ran. That rule is now one function, `assertRan` in
`shared/executable/diagnostics.ts`, used by `readExecutableVersion`, the
installation readiness probe and both readers. A run that exits with a
code keeps its old answer.

`AccountUsageReadOptions.timeoutMs` now bounds the whole read (contract
comment and docs/spec/account-usage.md), as kimi and codex already did:
claude's help probe and query share one deadline (default 30 s, the two
15 s budgets it replaces), and grok's start and requests share one
(default 30 s, was 10 s per request, up to four). claude, kimi and grok
now all default to 30 s for the whole read; codex's 8 s is unchanged.
The budget arithmetic is one function, `remainingMs(deadline, name)` in
`shared/deadline.ts`, used by the three readers.

**2. One failing runtime aborts `oar installation`, `models` and
`usage`.** These commands, `skills`/`mcps`/`tools`, and the MCP
`runtimes` tool gathered runtimes with a bare `Promise.all`. One runtime
whose installation probe rejects (a stuck `--version`, the Windows case
behind #57/#155) or whose usage read rejects (offline) took the whole
command down: no JSON for any runtime, an uncaught stack trace, exit 1.
`oar upgrade` and `oar login --status` already report such a runtime as
`{ runtimeId, error }`. The others now do the same through one helper
(`packages/cli/src/each-runtime.ts`), and exit 1 when any runtime
failed. In the MCP `runtimes` tool the row is `{ runtime, installation:
"unknown", error }`.

Fix 1 alone would make more `oar usage` runs crash, so the two go
together.

## Evidence

Built package, fake executables that hang, caller `timeoutMs: 2000`:

| reader | main | this branch |
|---|---|---|
| claude | resolves `unsupported/unsupported_installation` after 15014
ms | rejects `Failed to run … --help: … timeout after 2000 ms` after
2010 ms |
| kimi | resolves `unsupported/auth_configuration_unavailable` after
2010 ms | rejects `Failed to run … provider list --json: … timeout after
2000 ms` |
| codex, grok (control) | reject after ~2000 ms | unchanged |

CLI with `OAR_GROK_BIN` pointing at an executable that hangs:

| command | main | this branch |
|---|---|---|
| `oar installation` | exit 1, 0 bytes of stdout | exit 1, every
runtime, grok's `error` |
| `oar models` | exit 1, 0 bytes | exit 1, every runtime, `grok: error:
…` |
| `oar upgrade --check --json` (control) | exit 1, every runtime, grok's
`error` | unchanged |

`HTTPS_PROXY=http://127.0.0.1:9 oar usage` on main: exit 1, no stdout
(`Failed to read Grok account usage`).

## Tests

- `tests/claude-account-usage-reader.test.ts`: a timed-out help probe
rejects and is not cached; an exit code still answers unsupported,
uncached; with the probe uncached, the whole read rejects within
`timeoutMs`.
- `tests/grok/grok-account-usage-reader.test.ts`: each request gets what
is left of `timeoutMs`; a spent budget rejects.
- `tests/kimi/kimi-account-usage-reader.test.ts`: a timed-out `provider
list` rejects; an exit code answers `auth_configuration_unavailable`.
- `tests/cli-each-runtime.test.ts`: one rejecting runtime is its own
`error` entry; the MCP `runtimes` tool lists every runtime.
- The timeout and deadline tests fail without the change. `pnpm run
check` passes (677 tests).

Docs: packages/cli/README.md (failure entries and exit code),
docs/spec/account-usage.md (`timeoutMs` scope), claude.md and kimi.md
(one clause each).

🤖 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 xxchan mentioned this pull request Oct 7, 2026
xxchan added a commit that referenced this pull request Oct 7, 2026
Release OAR and CLI 0.26.0. This PR changes only the two package version
fields.

**New**
- cursor `login` and `authStatus` through the SDK's own `Cursor.auth`
(#146): the URL is relayed as an `auth_url` event and the login ends on
its own once the user signs in on any device; nothing is pasted back.
`LoginAccount.expiresAt` (a `UtcInstant`) carries the expiry of cursor's
minted key (90 days). Needs `@cursor/sdk` 1.0.36, which 0.25.0 already
pins. Passed a real-account checklist on a fresh Linux machine. `oar
login cursor` works through the existing command.
- `experiments/cursor-login`: the real SDK login against a local mock
backend, to run on every `@cursor/sdk` upgrade (#150).

**Fixes**
- Executable probes (`--version`, `--help`, login status) default to 15
seconds instead of 5, after repeated Windows `.CMD` start-up timeouts
(#155, closes #57).
- Account usage: a probe that times out or fails to start rejects
instead of answering `unsupported` (claude, kimi); `timeoutMs` bounds
the whole read, default 30 seconds for claude, kimi and grok (#156).
- CLI: `oar installation`, `models`, `usage`, `skills`, `mcps`, `tools`
and the MCP `runtimes` tool report a failing runtime in its own entry
instead of losing every runtime's output; the exit code is 1 when any
failed (#156).

**Not host-facing**: live probe model defaults (#153), cursor docs
(#157).

Validation: `pnpm run check` passed locally on #146 after its rebase;
all 13 checks passed on the final heads of #146 and #150. After this PR
passes CI and merges, tag its exact squash commit as `v0.26.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 2, 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_b9cd79600fb20406a825ddf3b9856243"><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 -->

An external DSH plugin can access native controls and events without
going through ACP, but its DSH peer imports do not resolve outside the
profile. This experiment retains that negative control and a working
bridge that imports only Node built-ins and uses the running DSH's
services.

The local provider runs cover DSH 0.2.1-rc.5 and 0.2.2-alpha.2 on Linux
x64: native text/reasoning/tool deltas, usage and durable events;
prompt, active steer/inject, cancellation, queue withdrawal, child
attribution, session list and cross-process resume with the saved tool
cwd. The first frame inventories services, and opened agents report
their actual methods before prompting. RC lacks `model.current()` and
returns an explicit unsupported reason. Only these exact versions are
evidenced.

The report distinguishes cold profile initialization and native
session/cache writes from unchanged existing user configuration,
verifies that home/profile settings still apply, and includes a small
internal transport sketch and ABI risks. There is no product adapter or
default capability change. Windows/macOS, crash recovery, slow consumers
and real authentication remain unverified.

Validation: full `CI=1 pnpm run check` passed (2,991 tests, 18 mock
behavior cases). Both exact native versions passed all 17 probe checks;
all six processes exited 0. Native durable records match persisted
records exactly. Both selected evidence files reproduce byte-for-byte
from their captured inputs. The executing bridge JS contains no DSH
runtime import. The standalone untyped ABI probes use the existing
experiment convention of narrowly disabling unsafe TypeScript boundary
lint rules; normal JS lint remains enabled.

Task #155. Findings:
[experiments/dsh-plugin/README.md](experiments/dsh-plugin/README.md).

Co-authored-by: Otter <[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.

codex: diagnose intermittent Windows startup failures in CI

2 participants