@parcha/agentrun-harness-codex 0.1.0-beta.51 → 0.1.0-beta.53

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,57 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.53 (2026-11-22)
6
+
7
+ - Keep newly connected Codex and Claude Code setups in sync by default, and move a supported complete setup to AgentRun from the existing agent page. Move preserves the agent's identity, history, source capture and unified usage, and checks destination tools, accounts, model, policy and project restoration before switching execution. <!-- changes/source-sync-move.md -->
8
+
9
+ Managed runs retain project checkpoints for later runs. Source and managed changes produce reviewable conflicts;
10
+ uncertain saves require review before another run. Existing connections require an explicit export grant, native
11
+ credentials stay at the source, and unsupported capabilities remain named prerequisites. See
12
+ [source sync](../../docs/source-sync.md) for compatibility and recovery behavior. Automatic notes and learned skills
13
+ remain retired; authored source skills retain their files and modes.
14
+ Owner skill edits after Move produce a new immutable project for future runs while preserving existing runs and
15
+ unchanged companion assets. Git checkpoints exclude ignored dependency trees before applying project limits and
16
+ file checks. An upload refused before project seeding releases its write receipt only after destination and upload
17
+ cleanup have both settled; unknown or dispatched writes continue to block deletion.
18
+ Completed checkpoint reads that refuse staged Git changes, secrets or unsupported files release their write receipt
19
+ only after scratch, cache, tools and provider cleanup settle under the original claim. The rejected save remains
20
+ visible and unpublished. Failed commands, changed files, lost write acknowledgments and uncertain cleanup retain
21
+ their receipts and continue to block deletion.
22
+ Terminal moved runs whose child crashed before checkpointing now require project review instead of silently starting
23
+ from an older saved project. Recovery reads the committed end, or the exact terminal claim when no end could be
24
+ written; it never invents a checkpoint or publishes orphan files. Missing-end reviews use `entry_id: null` and the
25
+ required `attempt_epoch`, so reviewing an earlier failure cannot acknowledge a later one. Active and queued runs
26
+ are not classified as failed merely because their checkpoint is still pending.
27
+ Moved projects on local storage now place attachments before restoring project files, pin their exact input paths,
28
+ and refuse collisions before admission. Claims and follow-ups reuse the placed files; checkpoints exclude those
29
+ attachments while retaining authored files in the same inputs directory.
30
+
31
+ Moved agents can learn checked workflows on the server using their existing learning settings. Replay and eligible
32
+ shadow-audit runs receive isolated copies of the reserved project; their results remain learning evidence, while
33
+ their settled file changes are explicitly discarded rather than published to the saved project. Uncertain writes
34
+ retain recovery receipts, and the existing restrictions on auditing write-capable agents still apply.
35
+ An audit that stops at an approval can still settle its private project under its original held claim, so that
36
+ refused tool call does not falsely block later runs. Parked runs gain no new tool-dispatch permission; superseded
37
+ claims and unresolved writes still refuse settlement. The bounded host-settlement model covers this transition;
38
+ the DSL effect-admission and recovery-driver models are unchanged.
39
+
40
+ Supported HTTP MCP connections retain source tool selections and denials, with explicit destination account binding.
41
+ Resource lists, templates and reads use the same pinned grants, credentials and permission gate; resource-only servers
42
+ are supported on managed AgentRun; native Codex 0.171.0 has a resource-only discovery limitation. Incomplete resource listings fail visibly, and resource bodies that echo connection credentials are
43
+ scrubbed or withheld before filing. Three upstream tool names are now reserved for these generated resource operations:
44
+ `agentrun_list_resources`, `agentrun_list_resource_templates` and `agentrun_read_resource`. A conflicting upstream tool
45
+ must be renamed before its server can connect. Stdio connections and unsupported native capabilities remain prerequisites.
46
+
47
+ Unknown source storage-write outcomes retain receipts and block deletion until independently resolved; restarting
48
+ or acknowledging a run checkpoint does not clear a source write receipt.
49
+
50
+ The Codex adapter preserves native rollout ordinals when recording an approved tool's result before resuming. This
51
+ fixes pinned Codex 0.164.0 rejecting the resumed thread after approval. Existing mixed or invalid ordinal histories
52
+ remain retained and fail before another tool dispatch; they are not silently rewritten or retried. Older wholly
53
+ unnumbered journals retain their format. This serialization fix leaves recovery admission, intent and result ordering
54
+ unchanged, so the recovery models do not change.
55
+
5
56
  ## 0.1.0-beta.44 (2026-11-17)
6
57
 
7
58
  - A Codex run under a small spend cap no longer stops as early on a hold that overstated its next request. <!-- changes/codex-cap-hold-billed-after.md -->
package/dist/harness.js CHANGED
@@ -7,7 +7,7 @@ import { BuiltinCalls, CODEX_ROUTES, failureText, gatewayCredential, gatewayHand
7
7
  import { acknowledgeInDrive, attachInDrive, cliPath, CODEX_CLI, DriveFiles, SANDBOX_DOC } from './host/sandbox.js';
8
8
  import { AppServer } from './app-server.js';
9
9
  import { codeMode } from './code-mode.js';
10
- import { danglingCalls, settleCall } from './transcript.js';
10
+ import { danglingCalls, nextRolloutOrdinal, 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
13
  export const DEFAULT_MODEL = 'openai/gpt-6-luna';
@@ -219,6 +219,9 @@ export function codexHarness(options = {}) {
219
219
  const clamps = new Map();
220
220
  try {
221
221
  if (resume) {
222
+ // Validate before the bridge can approve or dispatch another effect. Earlier versions could retain a synthetic
223
+ // result without a native ordinal; preserve that history and refuse rather than repair it or replay its effect.
224
+ nextRolloutOrdinal(lines);
222
225
  // A resumed thread's host calls with no output, before Codex starts on it: one that never started (no intent in
223
226
  // the session's records) runs now through the bridge under its own id (gate, intent, run, result); one the log
224
227
  // finished is answered with its recorded result; one with an intent and no outcome is left to the recovery below,
package/dist/rollout.d.ts CHANGED
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * A Codex thread persists as one append-only JSONL file, the rollout:
6
6
  * `$CODEX_HOME/sessions/YYYY/MM/DD/rollout-<ts>-<threadId>.jsonl`, one
7
- * `{timestamp, type, payload}` object per line. Its `response_item` lines are
7
+ * `{timestamp, ordinal, type, payload}` object per paginated line (older
8
+ * unnumbered journals omit `ordinal`). Its `response_item` lines are
8
9
  * the model-visible history (messages, `function_call`,
9
10
  * `function_call_output`, reasoning); its `event_msg` lines mark turns
10
11
  * (`task_started`, `task_complete`, `turn_aborted`) and carry the
@@ -30,6 +31,7 @@ export interface ThreadRecord {
30
31
  /** One rollout line, parsed. */
31
32
  export interface RolloutLine {
32
33
  timestamp?: string;
34
+ ordinal?: number;
33
35
  type: string;
34
36
  payload?: Record<string, unknown> & {
35
37
  type?: string;
package/dist/rollout.js CHANGED
@@ -7,7 +7,8 @@
7
7
  *
8
8
  * A Codex thread persists as one append-only JSONL file, the rollout:
9
9
  * `$CODEX_HOME/sessions/YYYY/MM/DD/rollout-<ts>-<threadId>.jsonl`, one
10
- * `{timestamp, type, payload}` object per line. Its `response_item` lines are
10
+ * `{timestamp, ordinal, type, payload}` object per paginated line (older
11
+ * unnumbered journals omit `ordinal`). Its `response_item` lines are
11
12
  * the model-visible history (messages, `function_call`,
12
13
  * `function_call_output`, reasoning); its `event_msg` lines mark turns
13
14
  * (`task_started`, `task_complete`, `turn_aborted`) and carry the
@@ -11,6 +11,9 @@ export type CallOutcome = {
11
11
  };
12
12
  /** The host's calls Codex made and never got an output for, in the order it made them. */
13
13
  export declare function danglingCalls(lines: readonly string[]): DanglingCall[];
14
+ /** The next paginated record number. Old unnumbered journals keep their format; a partly numbered or invalid journal
15
+ * cannot establish append order and is refused, never repaired. Call before dispatching any resumed host effect too. */
16
+ export declare function nextRolloutOrdinal(lines: readonly string[]): number | undefined;
14
17
  /** `lines` with the dangling call `callId` given `outcome`: one `function_call_output` line after the last, its output the
15
18
  * bridge's text (Codex's rollout keeps no failure flag for a function's output: a failure or refusal is in its words).
16
19
  * Throws when the call does not dangle: an answered call is never rewritten. */
@@ -43,12 +43,31 @@ export function danglingCalls(lines) {
43
43
  }
44
44
  return [...calls.values()];
45
45
  }
46
+ /** The next paginated record number. Old unnumbered journals keep their format; a partly numbered or invalid journal
47
+ * cannot establish append order and is refused, never repaired. Call before dispatching any resumed host effect too. */
48
+ export function nextRolloutOrdinal(lines) {
49
+ const parsed = lines.map(parseLine);
50
+ if (!parsed.some((line) => line !== undefined && Object.hasOwn(line, 'ordinal')))
51
+ return undefined;
52
+ let previous = -1;
53
+ for (const line of parsed) {
54
+ const ordinal = line?.ordinal;
55
+ if (typeof ordinal !== 'number' || !Number.isSafeInteger(ordinal) || ordinal < 0 || ordinal <= previous) {
56
+ throw new Error('Codex rollout ordinal order is missing or invalid; retained records require review before resuming.');
57
+ }
58
+ previous = ordinal;
59
+ }
60
+ if (previous === Number.MAX_SAFE_INTEGER)
61
+ throw new Error('Codex rollout ordinal cannot be safely advanced; retained records require review before resuming.');
62
+ return previous + 1;
63
+ }
46
64
  /** `lines` with the dangling call `callId` given `outcome`: one `function_call_output` line after the last, its output the
47
65
  * bridge's text (Codex's rollout keeps no failure flag for a function's output: a failure or refusal is in its words).
48
66
  * Throws when the call does not dangle: an answered call is never rewritten. */
49
67
  export function settleCall(lines, callId, outcome, now = Date.now()) {
50
68
  if (!danglingCalls(lines).some((call) => call.callId === callId))
51
69
  throw new Error(`Codex's rollout has no call ${callId} of the host's that it made and never got an output for`);
52
- const output = JSON.stringify({ timestamp: new Date(now).toISOString(), type: 'response_item', payload: { type: 'function_call_output', call_id: callId, output: outcome.text } });
70
+ const ordinal = nextRolloutOrdinal(lines);
71
+ const output = JSON.stringify({ timestamp: new Date(now).toISOString(), ...(ordinal === undefined ? {} : { ordinal }), type: 'response_item', payload: { type: 'function_call_output', call_id: callId, output: outcome.text } });
53
72
  return [...lines, output];
54
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-harness-codex",
3
- "version": "0.1.0-beta.51",
3
+ "version": "0.1.0-beta.53",
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.51"
47
+ "@parcha/agentrun-kernel": "0.1.0-beta.53"
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.51"
59
+ "@parcha/agentrun-dsl": "0.1.0-beta.53"
60
60
  },
61
61
  "repository": {
62
62
  "type": "git",