@gobing-ai/ts-ai-runner 0.8.2 → 0.8.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"turn-session.d.ts","sourceRoot":"","sources":["../src/turn-session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKhD;;;;;;GAMG;AAEH,0GAA0G;AAC1G,MAAM,MAAM,eAAe,GACrB,SAAS,GACT,SAAS,GACT,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,oBAAoB,CAAC;AAE3B,sGAAsG;AACtG,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B;AAED,8FAA8F;AAC9F,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,0GAA0G;AAC1G,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CA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CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAyB3F;AAoXD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,EAAE;IACrD,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0EjC"}
@@ -27,6 +27,12 @@ export const TURN_CANCEL_GRACE_MS = 5_000;
27
27
  export const TURN_HANDSHAKE_TIMEOUT_MS = 10_000;
28
28
  /** Max buffered stdout line; overflow is a protocol contract violation. */
29
29
  export const TURN_MAX_LINE_BYTES = 1024 * 1024;
30
+ /**
31
+ * Bound on draining stdout after the child exits, before the exit path settles the turn. A child
32
+ * that emits a bad frame and exits at once must classify `contract-violation`, not be outrun by
33
+ * the exit event; the bound only exists so a grandchild holding stdout open cannot stall it.
34
+ */
35
+ const TURN_EXIT_DRAIN_MS = 1_000;
30
36
  /** `startTurn` while another turn is active — no hidden queue, by design. */
31
37
  export class TurnSessionBusyError extends Error {
32
38
  constructor(turnId) {
@@ -213,6 +219,13 @@ class TurnSessionImpl {
213
219
  process;
214
220
  driver;
215
221
  lines;
222
+ /** Resolves when the stdout pump has routed every line (never rejects — it settles the turn). */
223
+ pumped;
224
+ /**
225
+ * First frame the pump could not decode. Proof the protocol broke outranks every
226
+ * process-gone classification (exit, dead stdin) and outlives the turn it happened outside of.
227
+ */
228
+ protocolViolation;
216
229
  active;
217
230
  /** Most recent turn — kept so frames arriving after settlement surface as diagnostics. */
218
231
  lastTurn;
@@ -223,9 +236,9 @@ class TurnSessionImpl {
223
236
  this.policyDigest = turnSessionPolicyDigest(options.policy);
224
237
  this.nativeSessionId = options.nativeSessionId;
225
238
  this.lines = options.lines;
226
- void this.pump();
239
+ this.pumped = this.pump();
227
240
  void this.process.exited.then(() => {
228
- this.onExit();
241
+ void this.onExit();
229
242
  });
230
243
  }
231
244
  startTurn(input) {
@@ -242,6 +255,11 @@ class TurnSessionImpl {
242
255
  turn.cancelHook = (reason, graceMs) => this.cancelTurn(turn, reason, graceMs);
243
256
  this.active = turn;
244
257
  this.state = 'busy';
258
+ if (this.protocolViolation !== undefined) {
259
+ // The stream already broke before this turn existed; writing a prompt to it is pointless.
260
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
261
+ return turn;
262
+ }
245
263
  try {
246
264
  this.process.writeStdin(this.driver.encodeTurn({
247
265
  turnId,
@@ -251,8 +269,9 @@ class TurnSessionImpl {
251
269
  }));
252
270
  }
253
271
  catch (error) {
254
- // A dead stdin means the process is gone: the turn never started.
255
- turn.settle({ kind: 'not-started', reason: error instanceof Error ? error.message : String(error) });
272
+ // A dead stdin means the process is gone — but it may have died of a malformed frame it
273
+ // already wrote, so settle behind the drain instead of claiming the turn never arrived.
274
+ void this.settleGone(turn, error instanceof Error ? error.message : String(error));
256
275
  }
257
276
  return turn;
258
277
  }
@@ -391,20 +410,33 @@ class TurnSessionImpl {
391
410
  }
392
411
  }
393
412
  catch (error) {
394
- this.active?.settle({
395
- kind: 'contract-violation',
396
- reason: error instanceof Error ? error.message : String(error),
397
- });
413
+ const reason = error instanceof Error ? error.message : String(error);
414
+ this.protocolViolation ??= reason;
415
+ this.active?.settle({ kind: 'contract-violation', reason });
416
+ }
417
+ }
418
+ /** Let the stdout pump finish (bounded), then settle a turn whose process is gone. */
419
+ async settleGone(turn, reason) {
420
+ await Promise.race([this.pumped, delay(TURN_EXIT_DRAIN_MS)]);
421
+ if (this.protocolViolation !== undefined) {
422
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
423
+ return;
398
424
  }
425
+ turn.settle({ kind: 'not-started', reason });
399
426
  }
400
427
  /** Deterministic settlement when the process dies: before acceptance → not-started, after → unknown. */
401
- onExit() {
428
+ async onExit() {
429
+ // Drain first: the exit event can win the race against stdout delivery, and settling on it
430
+ // alone would report not-started for a child that did emit a contract-violating frame.
431
+ await Promise.race([this.pumped, delay(TURN_EXIT_DRAIN_MS)]);
402
432
  const turn = this.active;
403
433
  this.state = 'closed';
404
434
  if (turn === undefined)
405
435
  return;
406
436
  if (!turn.outcomeResolved) {
407
- if (turn.acceptedAt === undefined)
437
+ if (this.protocolViolation !== undefined)
438
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
439
+ else if (turn.acceptedAt === undefined)
408
440
  turn.settle({ kind: 'not-started', reason: 'process exited before acceptance' });
409
441
  else
410
442
  turn.settle({ kind: 'outcome-unknown', reason: 'process exited without a native terminal' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobing-ai/ts-ai-runner",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "@gobing-ai/ts-ai-runner — Coding-agent shims, detection, doctor checks, and prompt execution.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -51,12 +51,12 @@
51
51
  "release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-ai-runner-v<version> && git push --tags' && exit 1"
52
52
  },
53
53
  "dependencies": {
54
- "@gobing-ai/ts-infra": "^0.8.2",
55
- "@gobing-ai/ts-runtime": "^0.8.2"
54
+ "@gobing-ai/ts-infra": "^0.8.4",
55
+ "@gobing-ai/ts-runtime": "^0.8.4"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/bun": "1.4.3",
59
- "@gobing-ai/ts-db": "^0.8.2"
59
+ "@gobing-ai/ts-db": "^0.8.4"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"
@@ -226,6 +226,12 @@ export const TURN_CANCEL_GRACE_MS = 5_000;
226
226
  export const TURN_HANDSHAKE_TIMEOUT_MS = 10_000;
227
227
  /** Max buffered stdout line; overflow is a protocol contract violation. */
228
228
  export const TURN_MAX_LINE_BYTES = 1024 * 1024;
229
+ /**
230
+ * Bound on draining stdout after the child exits, before the exit path settles the turn. A child
231
+ * that emits a bad frame and exits at once must classify `contract-violation`, not be outrun by
232
+ * the exit event; the bound only exists so a grandchild holding stdout open cannot stall it.
233
+ */
234
+ const TURN_EXIT_DRAIN_MS = 1_000;
229
235
 
230
236
  /** `startTurn` while another turn is active — no hidden queue, by design. */
231
237
  export class TurnSessionBusyError extends Error {
@@ -431,6 +437,13 @@ class TurnSessionImpl implements TurnSession {
431
437
  private readonly process: PipeProcess;
432
438
  private readonly driver: TurnSessionDriver;
433
439
  private readonly lines: AsyncIterable<string>;
440
+ /** Resolves when the stdout pump has routed every line (never rejects — it settles the turn). */
441
+ private readonly pumped: Promise<void>;
442
+ /**
443
+ * First frame the pump could not decode. Proof the protocol broke outranks every
444
+ * process-gone classification (exit, dead stdin) and outlives the turn it happened outside of.
445
+ */
446
+ private protocolViolation: string | undefined;
434
447
  private active: ActiveTurn | undefined;
435
448
  /** Most recent turn — kept so frames arriving after settlement surface as diagnostics. */
436
449
  private lastTurn: ActiveTurn | undefined;
@@ -449,9 +462,9 @@ class TurnSessionImpl implements TurnSession {
449
462
  this.policyDigest = turnSessionPolicyDigest(options.policy);
450
463
  this.nativeSessionId = options.nativeSessionId;
451
464
  this.lines = options.lines;
452
- void this.pump();
465
+ this.pumped = this.pump();
453
466
  void this.process.exited.then(() => {
454
- this.onExit();
467
+ void this.onExit();
455
468
  });
456
469
  }
457
470
 
@@ -467,6 +480,11 @@ class TurnSessionImpl implements TurnSession {
467
480
  turn.cancelHook = (reason, graceMs) => this.cancelTurn(turn, reason, graceMs);
468
481
  this.active = turn;
469
482
  this.state = 'busy';
483
+ if (this.protocolViolation !== undefined) {
484
+ // The stream already broke before this turn existed; writing a prompt to it is pointless.
485
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
486
+ return turn;
487
+ }
470
488
  try {
471
489
  this.process.writeStdin(
472
490
  this.driver.encodeTurn({
@@ -477,8 +495,9 @@ class TurnSessionImpl implements TurnSession {
477
495
  }),
478
496
  );
479
497
  } catch (error) {
480
- // A dead stdin means the process is gone: the turn never started.
481
- turn.settle({ kind: 'not-started', reason: error instanceof Error ? error.message : String(error) });
498
+ // A dead stdin means the process is gone — but it may have died of a malformed frame it
499
+ // already wrote, so settle behind the drain instead of claiming the turn never arrived.
500
+ void this.settleGone(turn, error instanceof Error ? error.message : String(error));
482
501
  }
483
502
  return turn;
484
503
  }
@@ -616,20 +635,34 @@ class TurnSessionImpl implements TurnSession {
616
635
  for (const wire of wires) this.route(wire);
617
636
  }
618
637
  } catch (error) {
619
- this.active?.settle({
620
- kind: 'contract-violation',
621
- reason: error instanceof Error ? error.message : String(error),
622
- });
638
+ const reason = error instanceof Error ? error.message : String(error);
639
+ this.protocolViolation ??= reason;
640
+ this.active?.settle({ kind: 'contract-violation', reason });
641
+ }
642
+ }
643
+
644
+ /** Let the stdout pump finish (bounded), then settle a turn whose process is gone. */
645
+ private async settleGone(turn: ActiveTurn, reason: string): Promise<void> {
646
+ await Promise.race([this.pumped, delay(TURN_EXIT_DRAIN_MS)]);
647
+ if (this.protocolViolation !== undefined) {
648
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
649
+ return;
623
650
  }
651
+ turn.settle({ kind: 'not-started', reason });
624
652
  }
625
653
 
626
654
  /** Deterministic settlement when the process dies: before acceptance → not-started, after → unknown. */
627
- private onExit(): void {
655
+ private async onExit(): Promise<void> {
656
+ // Drain first: the exit event can win the race against stdout delivery, and settling on it
657
+ // alone would report not-started for a child that did emit a contract-violating frame.
658
+ await Promise.race([this.pumped, delay(TURN_EXIT_DRAIN_MS)]);
628
659
  const turn = this.active;
629
660
  this.state = 'closed';
630
661
  if (turn === undefined) return;
631
662
  if (!turn.outcomeResolved) {
632
- if (turn.acceptedAt === undefined)
663
+ if (this.protocolViolation !== undefined)
664
+ turn.settle({ kind: 'contract-violation', reason: this.protocolViolation });
665
+ else if (turn.acceptedAt === undefined)
633
666
  turn.settle({ kind: 'not-started', reason: 'process exited before acceptance' });
634
667
  else turn.settle({ kind: 'outcome-unknown', reason: 'process exited without a native terminal' });
635
668
  }