@parall/codex-agent 1.55.1 → 1.55.2

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.
@@ -107,7 +107,7 @@ export declare class CodexAppServerAdapter implements DispatchAdapter {
107
107
  enqueueDuringDispatch(sessionKey: string, body: string): Promise<boolean>;
108
108
  abortDispatch(sessionKey: string): void;
109
109
  hasPendingInjections(sessionKey: string): boolean;
110
- dispatch({ event, bodyForAgent, sessionKey, context, }: DispatchOpts): AsyncIterable<RuntimeEvent>;
110
+ dispatch({ event, bodyForAgent, sessionKey, context, noteActivity, }: DispatchOpts): AsyncIterable<RuntimeEvent>;
111
111
  /**
112
112
  * Bring the app-server up and open (start or resume) the thread for this
113
113
  * dispatch, then reconcile the main thread's EFFECTIVE instructions plane.
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,YAAY,EACb,MAAM,oBAAoB,CAAC;AAa5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,KAAK,4BAA4B,GAAG,IAAI,CACtC,gBAAgB,EACd,gBAAgB,GAChB,UAAU,GACV,WAAW,GACX,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,cAAc,CACjB,GAAG;IACF,cAAc,EAAE,mBAAmB,CAAC;IACpC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,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B,IAAI;YA2BI,aAAa;YA4Bb,OAAO;IAoIrB,OAAO,CAAC,qBAAqB;YAsCf,UAAU;IA2DxB,OAAO,CAAC,iBAAiB;CA2D1B"}
package/dist/dispatch.js CHANGED
@@ -151,13 +151,13 @@ export class CodexAppServerAdapter {
151
151
  .sendRequest('turn/interrupt', { threadId, turnId })
152
152
  .catch((err) => this.opts.log?.warn?.(`turn/interrupt failed: ${errToString(err)}`));
153
153
  }
154
- sink.push({ kind: 'error', message: 'dispatch deadline exceeded' });
154
+ sink.push({ kind: 'error', message: 'dispatch inactivity deadline exceeded' });
155
155
  sink.close();
156
156
  }
157
157
  hasPendingInjections(sessionKey) {
158
158
  return (this.pendingInjections.get(sessionKey) ?? 0) > 0;
159
159
  }
160
- async *dispatch({ event, bodyForAgent, sessionKey, context, }) {
160
+ async *dispatch({ event, bodyForAgent, sessionKey, context, noteActivity, }) {
161
161
  const pending = this.pendingInjections.get(sessionKey) ?? 0;
162
162
  if (pending > 0) {
163
163
  this.pendingInjections.delete(sessionKey);
@@ -253,7 +253,7 @@ export class CodexAppServerAdapter {
253
253
  }
254
254
  break;
255
255
  }
256
- const sink = new TurnSink();
256
+ const sink = new TurnSink(noteActivity);
257
257
  this.setActiveTurn(threadId, sink, log);
258
258
  const groupKey = randomUUID();
259
259
  let sawTurnEnd = false;
@@ -955,6 +955,10 @@ export class CodexAppServerAdapter {
955
955
  }
956
956
  return;
957
957
  }
958
+ // Every routed app-server notification is runtime progress, including
959
+ // streaming deltas that EventMapper intentionally suppresses from the
960
+ // persisted RuntimeEvent stream.
961
+ sink.touchActivity();
958
962
  // For turn/completed we still run the mapper first — it emits a
959
963
  // RuntimeEvent error if `turn.status === "failed"`. Enqueue those events
960
964
  // before the turn_end sentinel so the dispatch loop can yield them.
@@ -4,7 +4,7 @@
4
4
  * The bridge runs headless with `approvalPolicy: "never"`, so approval-shaped
5
5
  * requests should not occur — but the protocol allows the app-server to send
6
6
  * them (e.g. a thread that fell back to `on-request`), and an unanswered
7
- * request parks its turn until the dispatch deadline. Every known
7
+ * request parks its turn until the dispatch inactivity deadline. Every known
8
8
  * approval-shaped method is answered with an explicit denial; unknown methods
9
9
  * get a method-not-found error from the JSON-RPC layer (`undefined` here).
10
10
  *
@@ -12,10 +12,13 @@ export type TurnEventEnvelope = {
12
12
  };
13
13
  /** Per-turn buffered sink backed by an unbounded promise queue. */
14
14
  export declare class TurnSink {
15
+ private readonly noteActivity?;
15
16
  readonly mapper: EventMapper;
16
17
  private readonly queue;
17
18
  private resolver;
18
19
  private closed;
20
+ constructor(noteActivity?: (() => void) | undefined);
21
+ touchActivity(): void;
19
22
  push(envelope: TurnEventEnvelope): void;
20
23
  next(): Promise<TurnEventEnvelope>;
21
24
  close(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"turn-sink.d.ts","sourceRoot":"","sources":["../src/turn-sink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,mEAAmE;AACnE,qBAAa,QAAQ;IACnB,QAAQ,CAAC,MAAM,cAAqB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IACjD,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,MAAM,CAAS;IAEvB,IAAI,CAAC,QAAQ,EAAE,iBAAiB;IAWhC,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAelC,KAAK;IAOL;kCAC8B;IAC9B,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACF"}
1
+ {"version":3,"file":"turn-sink.d.ts","sourceRoot":"","sources":["../src/turn-sink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,mEAAmE;AACnE,qBAAa,QAAQ;IAMP,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAL1C,QAAQ,CAAC,MAAM,cAAqB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IACjD,OAAO,CAAC,QAAQ,CAAqD;IACrE,OAAO,CAAC,MAAM,CAAS;gBAEM,YAAY,CAAC,GAAE,MAAM,IAAI,aAAA;IAEtD,aAAa;IAIb,IAAI,CAAC,QAAQ,EAAE,iBAAiB;IAWhC,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAelC,KAAK;IAOL;kCAC8B;IAC9B,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACF"}
package/dist/turn-sink.js CHANGED
@@ -1,10 +1,17 @@
1
1
  import { EventMapper } from './event-mapping.js';
2
2
  /** Per-turn buffered sink backed by an unbounded promise queue. */
3
3
  export class TurnSink {
4
+ noteActivity;
4
5
  mapper = new EventMapper();
5
6
  queue = [];
6
7
  resolver = null;
7
8
  closed = false;
9
+ constructor(noteActivity) {
10
+ this.noteActivity = noteActivity;
11
+ }
12
+ touchActivity() {
13
+ this.noteActivity?.();
14
+ }
8
15
  push(envelope) {
9
16
  if (this.closed)
10
17
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/codex-agent",
3
- "version": "1.55.1",
3
+ "version": "1.55.2",
4
4
  "description": "Codex CLI bridge runtime for self-hosted Parall agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "src"
26
26
  ],
27
27
  "dependencies": {
28
- "@parall/cli": "1.55.1",
29
- "@parall/sdk": "1.55.1",
30
- "@parall/agent-core": "1.55.1"
28
+ "@parall/cli": "1.55.2",
29
+ "@parall/sdk": "1.55.2",
30
+ "@parall/agent-core": "1.55.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^22.0.0",
package/src/dispatch.ts CHANGED
@@ -227,7 +227,7 @@ export class CodexAppServerAdapter implements DispatchAdapter {
227
227
  .sendRequest('turn/interrupt', { threadId, turnId })
228
228
  .catch((err) => this.opts.log?.warn?.(`turn/interrupt failed: ${errToString(err)}`));
229
229
  }
230
- sink.push({ kind: 'error', message: 'dispatch deadline exceeded' });
230
+ sink.push({ kind: 'error', message: 'dispatch inactivity deadline exceeded' });
231
231
  sink.close();
232
232
  }
233
233
 
@@ -240,6 +240,7 @@ export class CodexAppServerAdapter implements DispatchAdapter {
240
240
  bodyForAgent,
241
241
  sessionKey,
242
242
  context,
243
+ noteActivity,
243
244
  }: DispatchOpts): AsyncIterable<RuntimeEvent> {
244
245
  const pending = this.pendingInjections.get(sessionKey) ?? 0;
245
246
  if (pending > 0) {
@@ -349,7 +350,7 @@ export class CodexAppServerAdapter implements DispatchAdapter {
349
350
  break;
350
351
  }
351
352
 
352
- const sink = new TurnSink();
353
+ const sink = new TurnSink(noteActivity);
353
354
  this.setActiveTurn(threadId, sink, log);
354
355
  const groupKey = randomUUID();
355
356
  let sawTurnEnd = false;
@@ -1081,6 +1082,11 @@ export class CodexAppServerAdapter implements DispatchAdapter {
1081
1082
  return;
1082
1083
  }
1083
1084
 
1085
+ // Every routed app-server notification is runtime progress, including
1086
+ // streaming deltas that EventMapper intentionally suppresses from the
1087
+ // persisted RuntimeEvent stream.
1088
+ sink.touchActivity();
1089
+
1084
1090
  // For turn/completed we still run the mapper first — it emits a
1085
1091
  // RuntimeEvent error if `turn.status === "failed"`. Enqueue those events
1086
1092
  // before the turn_end sentinel so the dispatch loop can yield them.
@@ -4,7 +4,7 @@
4
4
  * The bridge runs headless with `approvalPolicy: "never"`, so approval-shaped
5
5
  * requests should not occur — but the protocol allows the app-server to send
6
6
  * them (e.g. a thread that fell back to `on-request`), and an unanswered
7
- * request parks its turn until the dispatch deadline. Every known
7
+ * request parks its turn until the dispatch inactivity deadline. Every known
8
8
  * approval-shaped method is answered with an explicit denial; unknown methods
9
9
  * get a method-not-found error from the JSON-RPC layer (`undefined` here).
10
10
  *
package/src/turn-sink.ts CHANGED
@@ -13,6 +13,12 @@ export class TurnSink {
13
13
  private resolver: ((value: TurnEventEnvelope) => void) | null = null;
14
14
  private closed = false;
15
15
 
16
+ constructor(private readonly noteActivity?: () => void) {}
17
+
18
+ touchActivity() {
19
+ this.noteActivity?.();
20
+ }
21
+
16
22
  push(envelope: TurnEventEnvelope) {
17
23
  if (this.closed) return;
18
24
  if (this.resolver) {