@parcha/agentrun-harness-codex 0.1.0-beta.34 → 0.1.0-beta.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.36 (2026-11-13)
6
+
7
+ - Model defaults move to the current models. The OpenAI default (and OpenRouter's, for pi, codex and opencode) is now gpt-6.1-sol, where OpenRouter's was gpt-6-sol. The Claude Agent adapter's default is now claude-sonnet-5-5 (was claude-sonnet-4-5) and the Codex adapter's is openai/gpt-6-luna (was openai/gpt-5.4-mini). A host that relied on a default names its model; the READMEs' examples name the current ones.
8
+ - The two harness adapters list `@parcha/agentrun-dsl` as a dev dependency, since only their tests import it, and serve's package keywords drop the retired `pi-durable`.
9
+
10
+ ## 0.1.0-beta.35 (2026-11-11)
11
+
12
+ - A capped run that reads screenshots is no longer refused at its cap after the first one. A model request's input bound counted an image's base64 as one token per byte, and then the image's billed maximum on top. A 1280x720 screenshot (about a megabyte of base64) read as some 1.3 million input tokens, so a Sonnet step under a $1.50 cap "needed at least $4.83" when Claude bills it a few cents.
13
+
14
+ Each image, in every turn, now counts at what the routed model's provider can bill it as, in place of its data's bytes, whatever API carries it. The size comes from the image's own header (PNG, JPEG, GIF or WebP):
15
+ - Anthropic: its 28-pixel patches or its area at 750 pixels a token, whichever is more, at most 4,784.
16
+ - OpenAI: its 512-pixel tiles after resizing (85 + 170 each; 85 at detail low), or for a patch-billed mini or nano model its 32-pixel patches at that model's multiplier when more, at most 73,800.
17
+ - Google: 258 per 768-pixel tile, at least 1,120.
18
+ - Any other provider: the most of the three.
19
+ An image whose size can't be read counts at its provider's per-image maximum, never at its bytes. An image-shaped object outside where the API reads images (a tool call's arguments) is counted at its bytes, as text.
20
+
21
+ `InputShape.images` (the kernel host's `providerInputOverhead`) is now a list of images, each with the bytes its data takes and its size when known; `InputShape.model` names the routed model; the figure can be below 0, and so can a policy's `serverInputOverhead`, never past the body's bytes. Upgrading: pass `images: [{ bytes, width?, height? }]`, built with `imageInputOf`, `messagesImagesIn` or `responsesImagesIn`, and the model, in place of a count.
22
+
5
23
  ## 0.1.0-beta.34 (2026-11-11)
6
24
 
7
25
  - The server checks a harness's pinned binary (claude-agent's CLI, Codex, OpenCode: its sha256, then the version it reports) without holding its event loop, so requests, timers and store answers go on while a binary of hundreds of MiB is hashed and run. Before, the first check in a process held every request for one to several seconds (GET /v2/capabilities, a server's start, an adapter made for a run). The binary is now hashed off the loop a chunk at a time and run as a child the loop does not wait on. A pass is kept for the adapter's own check, which then reads nothing, and two checks of one binary at once read it once. New: `checkedOnceAsync` and `sha256OfFileAsync` (kernel host), `verifyClaudeAgentCliAsync` (claude-agent), and `verifyCodexAsync` and `verifyCodexBinaryAsync` (Codex). Who breaks: a program that calls the kernel's `checkedOnce` with its own check. A check is now a `BinaryCheck`, a generator that yields each probe (`{ kind: "sha256", path }` or `{ kind: "run", path, args, env, timeoutMs }`) and is given back its answer, so one check runs either way.
package/README.md CHANGED
@@ -9,7 +9,7 @@ import { codexAdapter } from "@parcha/agentrun-harness-codex";
9
9
 
10
10
  const runNode = createHarnessRunner(
11
11
  codexAdapter({
12
- model: "gpt-5.4-mini",
12
+ model: "gpt-6-luna",
13
13
  provider: { origin: "https://api.openai.com", credential: () => process.env.OPENAI_API_KEY! },
14
14
  sessionsDir: "/var/lib/my-host/codex-sessions",
15
15
  }),
package/dist/harness.d.ts CHANGED
@@ -144,7 +144,7 @@ export interface CodexMachine {
144
144
  /** `sandbox({ commandTimeoutMs })`: a built-in command's longest run, within the time left in the invocation. */
145
145
  commandTimeoutMs?: number;
146
146
  }
147
- export declare const DEFAULT_MODEL = "openai/gpt-5.4-mini";
147
+ export declare const DEFAULT_MODEL = "openai/gpt-6-luna";
148
148
  /** A Codex item's replay policy: a command whose every action reads is `safe`; any other command, and every patch, `never`. */
149
149
  export declare function codexItemReplay(item: {
150
150
  type?: string;
package/dist/harness.js CHANGED
@@ -10,7 +10,7 @@ import { codeMode } from './code-mode.js';
10
10
  import { danglingCalls, settleCall } from './transcript.js';
11
11
  import { BUILTINS_ON, checkConfig, codexConfig, toToml } from './config.js';
12
12
  import { callIdOf, endsTurn, isRolloutPath, isSessionMeta, rolloutPathIn, rolloutStream, rolloutText, summarizeRollout, THREAD_STREAM, } from './rollout.js';
13
- export const DEFAULT_MODEL = 'openai/gpt-5.4-mini';
13
+ export const DEFAULT_MODEL = 'openai/gpt-6-luna';
14
14
  const SANDBOX_MODES = new Set(['read-only', 'workspace-write', 'danger-full-access']);
15
15
  /** Codex's command actions that only read: a command made of these alone is `safe` (the note says "safe to repeat"). */
16
16
  const READ_ACTIONS = new Set(['read', 'listFiles', 'search']);
@@ -68,7 +68,7 @@ export declare function webSearchesOf(text: string): number | undefined;
68
68
  * Responses API documents no prompt of its own that it adds on these routes (no hosted tool passes the policy but a
69
69
  * session's live web search, below), and the framing it puts around each input item and tool definition is a few tokens
70
70
  * each, fewer than the bytes of the JSON keys that item already spends in the body. An image is billed by its area, not
71
- * its bytes: each adds the most it can be billed as. A file input (a PDF, billed by its pages) has no stated bound, so a
71
+ * its bytes: each counts at the most it can be billed as, in place of the bytes its data URL takes in the body. A file input (a PDF, billed by its pages) has no stated bound, so a
72
72
  * body with one cannot be measured: this throws, and the request's input is unknown.
73
73
  */
74
74
  export declare function responsesServerInputOverhead(body: Record<string, unknown>): number;
@@ -1,4 +1,4 @@
1
- import { providerInputOverhead, ProxyRefusal } from "@parcha/agentrun-kernel/host";
1
+ import { providerInputOverhead, ProxyRefusal, responsesImagesIn } from "@parcha/agentrun-kernel/host";
2
2
  export const CODEX_RESPONSES_ROUTES = Object.freeze([
3
3
  { method: "GET", path: "/", local: 404 },
4
4
  { method: "POST", path: "/v1/responses", headers: ["accept"] },
@@ -359,13 +359,13 @@ function itemsIn(value, type) {
359
359
  * Responses API documents no prompt of its own that it adds on these routes (no hosted tool passes the policy but a
360
360
  * session's live web search, below), and the framing it puts around each input item and tool definition is a few tokens
361
361
  * each, fewer than the bytes of the JSON keys that item already spends in the body. An image is billed by its area, not
362
- * its bytes: each adds the most it can be billed as. A file input (a PDF, billed by its pages) has no stated bound, so a
362
+ * its bytes: each counts at the most it can be billed as, in place of the bytes its data URL takes in the body. A file input (a PDF, billed by its pages) has no stated bound, so a
363
363
  * body with one cannot be measured: this throws, and the request's input is unknown.
364
364
  */
365
365
  export function responsesServerInputOverhead(body) {
366
366
  if (itemsIn(body.input, "input_file") > 0)
367
367
  throw new Error("a file input's billed size has no stated bound");
368
- return providerInputOverhead("openai-responses", { tools: Array.isArray(body.tools) && body.tools.length > 0, images: itemsIn(body.input, "input_image") });
368
+ return providerInputOverhead("openai-responses", { tools: Array.isArray(body.tools) && body.tools.length > 0, images: responsesImagesIn(body.input), ...(typeof body.model === "string" ? { model: body.model } : {}) });
369
369
  }
370
370
  /** The text of a tool output item: a string, or the text of each of its parts. */
371
371
  /** Codex's status header of a tool output: the text it starts with (its first part), never what the script printed after it. */
package/dist/rollout.d.ts CHANGED
@@ -81,14 +81,6 @@ export declare function hasCall(lines: readonly string[], callId: string): boole
81
81
  export declare function endsTurn(line: string): boolean;
82
82
  /** The file a set of mirrored lines restores to: each line and its newline. */
83
83
  export declare function rolloutText(lines: readonly string[]): string;
84
- /**
85
- * The rollout path relative to `CODEX_HOME`, from the absolute path
86
- * app-server reports. Codex resumes a thread only from a file with its
87
- * canonical name, `rollout-<YYYY-MM-DDTHH-MM-SS>-<threadId>.jsonl` (any
88
- * directory under `sessions/`, any timestamp): anything else is "no rollout
89
- * found" or "not a canonical rollout filename".
90
- */
91
- export declare function relativeRolloutPath(absolute: string, threadId: string): string;
92
84
  /** Whether `rel` is a rollout path the driver itself would derive for `threadId`: `sessions/[YYYY/MM/DD/]rollout-<ts>-<threadId>.jsonl`, nothing else. */
93
85
  export declare function isRolloutPath(rel: string, threadId: string): boolean;
94
86
  /**
package/dist/rollout.js CHANGED
@@ -139,22 +139,6 @@ export function rolloutText(lines) {
139
139
  out += `${l}\n`;
140
140
  return out;
141
141
  }
142
- /**
143
- * The rollout path relative to `CODEX_HOME`, from the absolute path
144
- * app-server reports. Codex resumes a thread only from a file with its
145
- * canonical name, `rollout-<YYYY-MM-DDTHH-MM-SS>-<threadId>.jsonl` (any
146
- * directory under `sessions/`, any timestamp): anything else is "no rollout
147
- * found" or "not a canonical rollout filename".
148
- */
149
- export function relativeRolloutPath(absolute, threadId) {
150
- const at = absolute.lastIndexOf('/sessions/');
151
- const rel = at >= 0 ? absolute.slice(at + 1) : '';
152
- const name = rel.slice(rel.lastIndexOf('/') + 1);
153
- if (rel.includes('..') || !/^rollout-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-/.test(name) || name !== `${name.slice(0, 28)}${threadId}.jsonl`) {
154
- return `sessions/rollout-1970-01-01T00-00-00-${threadId}.jsonl`;
155
- }
156
- return rel;
157
- }
158
142
  /** A thread id as the harness accepts it from app-server (untrusted: it names a file to tail). */
159
143
  const THREAD_ID = /^[0-9A-Za-z-]{8,64}$/;
160
144
  /** Whether `rel` is a rollout path the driver itself would derive for `threadId`: `sessions/[YYYY/MM/DD/]rollout-<ts>-<threadId>.jsonl`, nothing else. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-harness-codex",
3
- "version": "0.1.0-beta.34",
3
+ "version": "0.1.0-beta.36",
4
4
  "description": "Codex as an AgentRun harness: a tool-less Codex app-server behind a loopback model proxy, durable in AgentRun's own store, with the host's tools as its only tools.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -13,7 +13,7 @@
13
13
  "license": "Apache-2.0",
14
14
  "author": "Parcha Labs, Inc.",
15
15
  "engines": {
16
- "node": ">=24.11.0"
16
+ "node": ">=24.22.3"
17
17
  },
18
18
  "main": "./dist/index.js",
19
19
  "types": "./dist/index.d.ts",
@@ -44,8 +44,7 @@
44
44
  "test": "node --test --test-concurrency=8 'test/*.test.mjs'"
45
45
  },
46
46
  "dependencies": {
47
- "@parcha/agentrun-dsl": "0.1.0-beta.34",
48
- "@parcha/agentrun-kernel": "0.1.0-beta.34"
47
+ "@parcha/agentrun-kernel": "0.1.0-beta.36"
49
48
  },
50
49
  "peerDependencies": {
51
50
  "@openai/codex": "0.164.0"
@@ -56,7 +55,8 @@
56
55
  }
57
56
  },
58
57
  "devDependencies": {
59
- "@openai/codex": "0.164.0"
58
+ "@openai/codex": "0.164.0",
59
+ "@parcha/agentrun-dsl": "0.1.0-beta.36"
60
60
  },
61
61
  "repository": {
62
62
  "type": "git",