@parcha/agentrun-harness-codex 0.1.0-beta.67 → 0.1.0-beta.69

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,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.69 (2026-11-28)
6
+
7
+ - Codex on a model on the host's own machine (an Ollama model) waits out a silent stream for 30 minutes, as claude-agent's CLI already does. A slow machine that took more than five minutes to load the model or read a long prompt used to end the turn with "stream disconnected before completion: idle timeout waiting for SSE". The Codex adapter takes `streamIdleMs` (Codex's `stream_idle_timeout_ms` on its provider) and exports `LOCAL_STREAM_IDLE_MS`; serve sets it for an Ollama model, in process and on a runner. Any other route keeps Codex's own five minutes. <!-- changes/codex-local-stream-idle.md -->
8
+
5
9
  ## 0.1.0-beta.64 (2026-11-26)
6
10
 
7
11
  - pi's turn budget now outlasts a process that stops in the turn, as Claude's, Codex's, ACP's and OpenCode's do: a pi session opened again takes the turn back from its conversation (its last answer's usage and calls, and each result handed since) before a call claims, so the calls a resume answers split what their answer left instead of each taking its whole bound. A read of the turn that fails runs no call: the call is an error naming why, and the next call reads again. <!-- changes/turn-budget-resume-pi-scripts.md -->
package/dist/adapter.d.ts CHANGED
@@ -18,6 +18,10 @@ export declare const codexToolName: (name: string) => string;
18
18
  * three quarters of a token a character: not a quarter, which holds for ASCII alone.
19
19
  */
20
20
  export declare const CODEX_TOOL_OUTPUT_TOKENS: number;
21
+ /** How long Codex waits on a silent stream from a model on the host's own machine (an Ollama model the route
22
+ * translates), which says nothing while it loads or reads a long prompt: 30 minutes, as claude-agent's CLI waits
23
+ * (its LOCAL_STREAM_IDLE_MS). Any other route keeps Codex's own five minutes. */
24
+ export declare const LOCAL_STREAM_IDLE_MS: number;
21
25
  export interface CodexProvider {
22
26
  /** The provider's origin (`https://api.openai.com`): the proxy forwards to its `/v1/responses` only. */
23
27
  origin: string;
@@ -53,6 +57,9 @@ export interface CodexAdapterOptions {
53
57
  * result is its share of it (the kernel's resultMaxChars). A session's own (SessionSpec.contextWindow) wins. With
54
58
  * neither, Codex is told 272 000 and the host's bound alone holds a result. */
55
59
  contextWindow?: number;
60
+ /** How long Codex waits on a streamed answer that sends nothing. A host sets LOCAL_STREAM_IDLE_MS for a model on its
61
+ * own machine; absent, Codex's own limit (five minutes), so a hung paid stream holds the run's slot and cap no longer. */
62
+ streamIdleMs?: number;
56
63
  /** Where sessions keep their private directories when the host lends none (`io.dir`): one per session key. */
57
64
  sessionsDir?: string;
58
65
  /** The host's skills, which Codex lists to the model by name and description and the model reads with
package/dist/adapter.js CHANGED
@@ -42,6 +42,10 @@ export const codexToolName = (name) => (name.startsWith("mcp__") ? `mcp_${name.s
42
42
  * three quarters of a token a character: not a quarter, which holds for ASCII alone.
43
43
  */
44
44
  export const CODEX_TOOL_OUTPUT_TOKENS = Math.ceil((HOST_RESULT_MAX_CHARS * 3) / 4);
45
+ /** How long Codex waits on a silent stream from a model on the host's own machine (an Ollama model the route
46
+ * translates), which says nothing while it loads or reads a long prompt: 30 minutes, as claude-agent's CLI waits
47
+ * (its LOCAL_STREAM_IDLE_MS). Any other route keeps Codex's own five minutes. */
48
+ export const LOCAL_STREAM_IDLE_MS = 30 * 60_000;
45
49
  /** The adapter's event for a harness live event, if it has one: a tool's by the host's name for it (`hostName`). */
46
50
  function adapterEvent(event, hostName) {
47
51
  const e = event;
@@ -191,6 +195,7 @@ export function codexAdapter(options) {
191
195
  // The window the host knows (the session's, from its catalog; else this adapter's). Only with neither is Codex told
192
196
  // 272,000, a guess at a large OpenAI model's, and then no tool result is held to it: the host's bound alone.
193
197
  contextWindow: window ?? 272_000,
198
+ ...(options.streamIdleMs !== undefined ? { streamIdleMs: options.streamIdleMs } : {}),
194
199
  ...budget,
195
200
  ...(options.log ? { log: options.log } : {}),
196
201
  ...(options.standIn ? { test: { command: options.standIn.command, args: options.standIn.args ?? [] } } : {}),
package/dist/config.d.ts CHANGED
@@ -43,6 +43,9 @@ export interface CodexConfigOptions {
43
43
  * else), less any name the policy excludes.
44
44
  */
45
45
  commandEnv?: Readonly<Record<string, string>>;
46
+ /** How long Codex waits on a streamed answer that sends nothing (`stream_idle_timeout_ms` on its provider). Absent:
47
+ * Codex's own limit, five minutes. A host sets it for a model on its own machine (LOCAL_STREAM_IDLE_MS). */
48
+ streamIdleMs?: number;
46
49
  /** Merged over the generated config, last. */
47
50
  extra?: Record<string, TomlValue>;
48
51
  }
package/dist/config.js CHANGED
@@ -96,6 +96,7 @@ export function codexConfig(options) {
96
96
  env_key: options.envKey,
97
97
  wire_api: 'responses',
98
98
  supports_websockets: false,
99
+ ...(options.streamIdleMs !== undefined ? { stream_idle_timeout_ms: Math.max(1, Math.floor(options.streamIdleMs)) } : {}),
99
100
  },
100
101
  },
101
102
  ...(options.cwd ? { projects: { [options.cwd]: { trust_level: 'untrusted' } } } : {}),
package/dist/harness.d.ts CHANGED
@@ -117,6 +117,8 @@ export interface CodexHarnessOptions {
117
117
  name?: string;
118
118
  /** The model's context window (Gateway ids are unknown to Codex). Default 272,000. */
119
119
  contextWindow?: number;
120
+ /** How long Codex waits on a streamed answer that sends nothing (CodexConfigOptions.streamIdleMs). Default Codex's own. */
121
+ streamIdleMs?: number;
120
122
  /** What the session's model can take of one tool result (its context window): the tool bridge holds every result to
121
123
  * it (boundResult's budget), and so does each result code mode hands Codex from the log. Absent: the host's bound
122
124
  * alone (HOST_RESULT_MAX_CHARS). */
package/dist/harness.js CHANGED
@@ -249,6 +249,7 @@ export function codexHarness(options = {}) {
249
249
  baseUrl: `${machine.modelUrl}/v1`,
250
250
  envKey: KEY_ENV,
251
251
  contextWindow: options.contextWindow ?? 272_000,
252
+ ...(options.streamIdleMs !== undefined ? { streamIdleMs: options.streamIdleMs } : {}),
252
253
  cwd,
253
254
  ...(spec.env ? { commandEnv: spec.env } : {}),
254
255
  extra: {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { CODEX_TOOL_OUTPUT_TOKENS, codexAdapter } from "./adapter.js";
1
+ export { CODEX_TOOL_OUTPUT_TOKENS, codexAdapter, LOCAL_STREAM_IDLE_MS } from "./adapter.js";
2
2
  /** The policy a Codex session's model proxy applies, for a host that serves the same route itself (a faux harness's). */
3
3
  export { codexPolicy, planLimitOf, webSearchUsd, withWebSearches } from "./host/policy.js";
4
4
  /** The check the adapter runs on the host's skills when it is made: @parcha/agentrun-kernel' own, as the Claude adapter's. */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { CODEX_TOOL_OUTPUT_TOKENS, codexAdapter } from "./adapter.js";
1
+ export { CODEX_TOOL_OUTPUT_TOKENS, codexAdapter, LOCAL_STREAM_IDLE_MS } from "./adapter.js";
2
2
  /** The policy a Codex session's model proxy applies, for a host that serves the same route itself (a faux harness's). */
3
3
  export { codexPolicy, planLimitOf, webSearchUsd, withWebSearches } from "./host/policy.js";
4
4
  /** The check the adapter runs on the host's skills when it is made: @parcha/agentrun-kernel' own, as the Claude adapter's. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-harness-codex",
3
- "version": "0.1.0-beta.67",
3
+ "version": "0.1.0-beta.69",
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",
@@ -44,7 +44,7 @@
44
44
  "test": "node --test --test-concurrency=8 'test/*.test.mjs'"
45
45
  },
46
46
  "dependencies": {
47
- "@parcha/agentrun-kernel": "0.1.0-beta.67"
47
+ "@parcha/agentrun-kernel": "0.1.0-beta.69"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@openai/codex": "0.164.0"
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@openai/codex": "0.164.0",
59
- "@parcha/agentrun-dsl": "0.1.0-beta.67"
59
+ "@parcha/agentrun-dsl": "0.1.0-beta.69"
60
60
  },
61
61
  "repository": {
62
62
  "type": "git",