Skip to content

fix: a probe timeout rejects account usage; multi-runtime commands report each failure - #156

Merged
xxchan merged 3 commits into
mainfrom
lookout/usage-timeouts-reject
Oct 6, 2026
Merged

xxchan merged 3 commits into
mainfrom
lookout/usage-timeouts-reject

Conversation

@xxchan

@xxchan xxchan commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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 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

exe.dev user and others added 3 commits October 6, 2026 10:43
…port each failure

docs/spec/account-usage.md: operational failures, timeouts included,
reject. The claude and kimi readers instead answered `unsupported` when a
native process timed out: claude's `--help` probe for `--safe-mode`
(`unsupported_installation`, after the 15 s default whatever the caller's
`timeoutMs`) and kimi's `kimi provider list --json`
(`auth_configuration_unavailable`). Both now reject with the process
diagnostics, as readExecutableVersion does; a run that exits with a code
keeps its old answer. claude's probe takes the caller's `timeoutMs`.

`oar installation`, `models`, `usage`, `skills`/`mcps`/`tools` and the MCP
`runtimes` tool gathered runtimes with a bare Promise.all, so one runtime
whose probe or read rejected aborted the whole command with no output.
Each runtime's failure is now its own `error` entry, the others still
report, and the exit code is 1, as `oar upgrade` and `oar login --status`
already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…be sites

`AccountUsageReadOptions.timeoutMs` now bounds the whole read, 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); grok's requests share
one (default 10 s, was 10 s per request). The contract and
docs/spec/account-usage.md say so.

`assertRan` (shared/executable/diagnostics.ts) is the one rule that a
command that timed out or never ran throws `processFailure`; version.ts,
installation.ts and the claude and kimi readers use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
grok's default becomes 30 s for the whole read (one grok start and up to
four requests), like claude and kimi; codex's 8 s is unchanged.
`remainingMs(deadline, name)` (shared/deadline.ts) replaces the claude,
grok and kimi copies; its timeout reads `<name> timed out`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@xxchan
xxchan merged commit a3b43f9 into main Oct 6, 2026
13 checks passed
@xxchan
xxchan deleted the lookout/usage-timeouts-reject branch October 6, 2026 10:57
@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_1fa4dd995bda681621703ef81c293b8b"><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 -->

Claude and Codex resumed prompts were refused after observing only the
first resumed request. Native compaction changes that result: Claude's
replacement and append, and Codex's append, use the newly supplied value
after compaction. Omitting them instead drops the saved override at that
point. This change forwards those native options and removes the
incorrect refusals.

`Runtime.resumedSessionOptions` declares two independent facts per
option: when a different supplied value takes effect, and what omission
does. The optional map uses `SessionOptions` keys; absent entries mean
untested. Claude, Codex, Qwen, Pi SDK/RPC and Pi Durable have measured
declarations. Refusal declarations remain authoritative. OAR does not
compare prompt strings, inject instructions or add a compaction control.

All declared prompt options have native regressions for supplied and
omitted values before and after compaction. Claude uses `/compact`, Qwen
uses `/compress`, and Codex/Pi use native automatic compaction. Qwen
must report native completion with a smaller token count; Qwen/Pi must
also place a unique native summary in the next main request's history.
Sequential resumes track the current saved value. A registry-wide test
fixes the declaration inventory and prohibits overlap with refused
options.

Host migration: pass the current Claude/Codex prompts on every resume to
retain them after compaction. Codex replacement instructions survive
omission. Grok append-only sessions are the exception: omit append on
resume to retain the saved value; to change it, also supply replacement
instructions. A retained native Grok compaction probe supports that
exception. The spec, runtime pages, public JSDoc, root example and
decision reversing #469 are updated; the old dated report keeps its
original text with a correction. [Evidence and release-note
draft](https://github.com/botiverse/oar/blob/e052eb83297fd77e1c2481e0280ab6acbad62953/experiments/resume-prompts-2026-11-02.md).

Validation:
- Complete local check: 2,991 tests and 18 mock behaviors; build passed.
Packed public type consumption was verified for the unchanged exported
types.
- All 19 declaration-driven native controls passed; the full Durable
vendor file also passed.
- Eight original Claude/Codex mutation controls and eight added Qwen/Pi
runtime/dimension mutation runs failed their expected assertions.
Durable's incorrect `saved_until_compaction` declaration now fails after
compaction; Qwen/Pi's incorrect `saved` declaration expects the
preceding resume's new marker.
- Existing Claude/Codex/Grok behavior and vendor regressions passed.

Local native observations are Linux x64 against scripted providers.
Cross-platform validation is pending this revision's CI. Codex
declarations were exercised with local compaction; ChatGPT remote
compaction was only inspected in native source, not exercised.
Conditional Grok/OpenCode support and unmeasured Qoder/CodeBuddy
omission remain undeclared. Qwen's compaction-status attribution is a
separate task (#156).

Task #153. No version bump; release timing belongs to Cindy.

---------

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

Qwen 0.26.5 emits manual compression status as assistant text and
exposes no automatic compression frame in stream-json. A user
`compress.toml` can replace `/compress` with a model prompt, so neither
the output text nor the submitted command safely identifies compaction.

Document this limit in the Qwen runtime page and record-stream contract
without changing the adapter. Keep a reproducible native probe, portable
selected evidence and an unsubmitted upstream issue draft requesting
structured manual/automatic compaction observations and resolved command
origin.

Validation: native manual, automatic and overridden-command controls
pass on Linux x64. Both compaction controls verify the unique summary
reaches the next main provider request; an ordinary model response
reproduces the native status verbatim. Full check passes (2,991 tests
and 18 mock behaviors). The selector reproduces the committed evidence
byte for byte. Other platforms are not claimed.

Tracks task #156. The issue draft is for Cindy to decide whether to
submit. This PR does not change product behavior or the release version.

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.

1 participant