Skip to content

feat(codex): type old-release, config and turn/start refusals - #726

Merged
stamp-build[bot] merged 2 commits into
mainfrom
codex-refusal-classes
Nov 11, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
codex-refusal-classes

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

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


Raft asked for these so it can drop its legacy Codex driver (#oar-raft, Codex asks 3 and 4, plus the optional config-parse class).

What changes

Older Codex at open. OAR reads the running version from initialize's userAgent. Two refusals now fail the open with RuntimeFailureError failure: "invalid_request", code: "runtime_outdated", and a message naming the version and the first release that has what OAR sent:

  • serviceTier: "default" or "priority" before 0.129.0 (-32600 unknown variant \default`, expected `fast` or `flex`). Raft sends default` for standard speed, so every open on such a Codex failed untyped before.
  • thread/settings/update before 0.133.0 (-32600 unknown variant \thread/settings/update``), sent when a resumed thread runs another effort level.

A tier no release accepts keeps the plain error.

Unreadable config.toml. Codex starts on defaults and refuses thread/start / thread/resume with failed to load configuration: <path>:<line>:<col>: .... That is now RuntimeFailureError code: "runtime_config_invalid" with Codex's words.

Refused controls (turn/start, turn/steer, thread/queue/add) keep Codex's JSON-RPC error as native and read its code:

Codex Rejection
-32600 thread not found: <id> new code session_not_found (reopen with resume)
-32602 data.input_error_code: "input_too_large" runtime_refused, failure: "input_too_large"
-32001 runtime_refused, failure: "overloaded"
-32600 config load / data.type: modelProvider... runtime_refused, failure: "invalid_request"
anything else runtime_refused, no failure

failure is on the rejection body and on ControlOutcome.

Contract additions

  • RejectionCode gains session_not_found. Exhaustive switches must handle it.
  • Rejections may carry failure?: FailureClass (only with runtime_refused), the same field input_dropped has.
  • RuntimeFailureError.code is now RuntimeFailureCode (project_packages_blocked | runtime_outdated | runtime_config_invalid), exported.
  • ContextUsage moved to its own contract file (records.ts hit max-lines); exports are unchanged.

Evidence

  • experiments/codex-old-releases/ probes real npm releases 0.118.0, 0.125.0, 0.128.0, 0.129.0, 0.130.0, 0.132.0, 0.133.0, 0.134.0, 0.135.0 and 0.154.0 over raw app-server stdio (no login, no model call). The README has the table.
  • The turn/start classes come from the 0.167.0 source (turn_processor.rs, error_code.rs, config_errors.rs). In that source turn/start reloads config each time, which is why a broken or changed config.toml refuses every later prompt.
  • tests/codex/codex-refusals.test.ts drives the session over a scripted app-server with those native answers.
  • docs/runtimes/codex.md#refusals documents it. The same page now notes that the Desktop CLI can be older than the one on PATH.

pnpm run check: all green except tests/session-dispose.test.ts (the grace-period timing case at load 21), which passes alone.

🤖 Generated with Claude Code

Cindy and others added 2 commits November 10, 2026 22:57
An older Codex now fails the open with RuntimeFailureError code
runtime_outdated, naming its version (from initialize's userAgent) and the
first release that has what OAR sends: serviceTier default or priority
(0.129.0) and thread/settings/update for a resumed thread's effort
(0.133.0). An unreadable config.toml fails thread/start and thread/resume
with code runtime_config_invalid, keeping Codex's file, line and column.

Refused turn/start, turn/steer and thread/queue/add keep Codex's JSON-RPC
error as native and read its code: "thread not found" is the new
rejection code session_not_found; input over Codex's limit, a full request
queue, and a configuration or model provider refusal carry failure
input_too_large, overloaded or invalid_request on the rejection and on the
host's ControlOutcome. Everything else stays runtime_refused without a class.

Probed on codex-cli 0.118.0 to 0.135.0 and 0.154.0
(experiments/codex-old-releases); the turn/start classes follow the 0.167.0
source. codex.md also notes that the Desktop CLI can be older than PATH.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #726: a host delivering through Session.deliver() saw only
code and reason on a rejected DeliverResult. The rejected DeliverResult and
SteerOrQueueResult now carry the refused control's failure too, as
ControlOutcome does. The resume effort update also clears its timer and
waiter in a finally, so a runtime_outdated throw leaves nothing behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build
stamp-build Bot merged commit f8405e3 into main Nov 11, 2026
40 checks passed
@stamp-build
stamp-build Bot deleted the codex-refusal-classes branch November 11, 2026 04:24
@stamp-build stamp-build Bot mentioned this pull request Nov 11, 2026
stamp-build Bot added a commit that referenced this pull request Nov 11, 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_b4346693e3c47eae60e940c1fb2d21c3"><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: Codex refusals are typed (an outdated Codex, an unreadable config.toml, and refused turns); Antigravity gets sign-in and status through agy's own login; Cursor moves to SDK 1.3.1.

## Upgrade notes
- **Cursor hosts must install `@cursor/[email protected]`.** The optional peer is an exact version and moves from 1.2.0 to 1.3.1 (#725).
- **`RejectionCode` gains `session_not_found`.** An exhaustive TypeScript switch over it must handle the new value.

## Codex refusals (#726)
- **An outdated Codex fails the open as `RuntimeFailureError` with `code: "runtime_outdated"`** (`failure: "invalid_request"`). The message names the running version (from `initialize`'s `userAgent`, else the installation's probed version, else "version unreported") and the first release that has what OAR sent. That covers `serviceTier: "default"` or `"priority"` before 0.129.0 and `thread/settings/update` (setting a resumed thread's effort) before 0.133.0.
- **An unreadable `config.toml` fails the open with `code: "runtime_config_invalid"`.** The message keeps Codex's words, including the file, line and column. Codex starts on its defaults and refuses only at `thread/start` / `thread/resume`.
- **Refused `turn/start`, `turn/steer` and `thread/queue/add` keep Codex's JSON-RPC error as `native` and are classified by its code.**
  - `thread not found` is the new rejection code `session_not_found`. This process no longer has the thread, so open a new Session with `resume`.
  - Input over Codex's limit is `runtime_refused` with `failure: "input_too_large"`.
  - A full request queue is `runtime_refused` with `failure: "overloaded"`.
  - A configuration that does not load, or a model provider the thread cannot use, is `runtime_refused` with `failure: "invalid_request"`.
  - Anything else stays `runtime_refused` without a class.
- **`failure` is new on the rejected response body, on `ControlOutcome`, and on rejected `DeliverResult` and `SteerOrQueueResult`.** `RuntimeFailureCode` is exported.
- Evidence: nine npm releases between 0.118.0 and 0.135.0, and 0.154.0, over raw app-server stdio ([probe](https://github.com/botiverse/oar/blob/main/experiments/codex-old-releases/README.md)), plus the 0.167.0 source for the turn/start paths. `docs/runtimes/codex.md` also notes that the Codex Desktop CLI can be older than the `codex` on PATH.

## Antigravity sign-in and status (#720)
- **`login`** runs `agy acp --login`. It relays agy's Google URL as `auth_url`, then asks the host with a `manual_code` prompt for the authorization code or the landing URL. OAR writes the answer only to agy's stdin, never reads or writes the credential, and asks again on a blank answer. With `openBrowser: false`, a do-nothing launcher keeps the browser closed on Linux (checked live) and macOS (from reading agy's binary, not run); on Windows, agy starts its browser launcher by absolute path, so the login returns `browser_suppression_unavailable` before anything runs.
- **`authStatus`** runs `agy models`. It reports `logged_in`, or `logged_out` on agy's "Please sign in", and `unknown` otherwise.
- **No `logout`**: agy refuses `/logout` outside its interactive UI, and OAR does not delete the token itself.
- This reverses OAR's earlier no-login stance for Antigravity, at the project owner's decision (`docs/design/decisions.md`). Google warns that third-party access with an Antigravity login breaks its terms; its [Antigravity terms](https://antigravity.google/terms) (section 6) name it as grounds for suspending the Antigravity and/or Gemini CLI accounts. Whether a host offers this is the host's and the user's call.
- Live status: the URL and prompt shape come from agy 1.5.5. A full successful sign-in through OAR has not been run yet; the first one will happen in Raft.

## Other
- Grok's Windows vendor test now runs a real slow command (#722).
- November 10 and 11 native runtime checks and OpenCode cleanup notes (#724, #725).

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

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