@cogitator-ai/bridge 0.10.0 → 0.10.1

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/README.md CHANGED
@@ -88,7 +88,7 @@ The dispatcher of `cogitator bridge serve` reaches both harnesses with the comma
88
88
  | The tools know it by | a hook that adds the session to every tool call | the thread Codex names in every tool call |
89
89
  | Before it can start | Claude Code must trust the folder | nothing |
90
90
 
91
- **Claude Code.** Nothing is pushed into a window from outside. After every turn a background hook of the session runs `cogitator bridge wait`, which waits at the dispatcher and, when a letter comes, exits with code 2 and the letter on stderr: that wakes the session with the letter as its next input (`asyncRewake` in Claude Code's hooks). Under the letter it adds one line saying how to answer through the bridge. While the hook waits the session is free, you can talk to it. A session the bridge starts carries the hook itself. For the sessions you open yourself, `cogitator bridge install` puts it into the project's `.claude/settings.local.json`:
91
+ **Claude Code.** Nothing is pushed into a window from outside. After every turn a background hook of the session runs `cogitator bridge wait`, which waits at the dispatcher and, when a letter comes, exits with code 2 and the letter on stderr: that wakes the session with the letter as its next input (`asyncRewake` in Claude Code's hooks). Under the letter it adds one line saying how to answer through the bridge. While the hook waits the session is free, you can talk to it. A session sometimes ends its turn with its answer said only in its own window, where the agent that waits for the job does not read. So a session that has waited for mail for a minute with a job it has not reported on gets a reminder to report, as a letter that wakes it. When it does not react within the reply timeout of the job, the job fails with that reason, rather than staying open until its deadline. A session the bridge starts carries the hook itself. For the sessions you open yourself, `cogitator bridge install` puts it into the project's `.claude/settings.local.json`:
92
92
 
93
93
  ```json
94
94
  {
@@ -307,6 +307,8 @@ await bridge.createJob({
307
307
 
308
308
  **Who does a later step.** The fixes go back to the author and the second look to the first reviewer when the bridge can wake them: `wakes(agent)` says whether a session waits for its mail or its harness wakes it for a letter. One that would only find the letter when a person opens it, such as a Codex thread that is open nowhere while no local daemon runs, is not waited for. A fresh session of the same harness gets the step then, with what it needs to know in the letter: what the job was, where the work lies, and what was found.
309
309
 
310
+ **Leave for what a step runs.** An agent that works on a step asks leave for a call its rules do not settle, and the rules that count are those of whoever started the recipe. A reviewer nearly always starts with `git diff` and the tests of the project, so allow those in the settings of the project (`Bash(git diff:*)`, `Bash(git status:*)`, `Bash(npm test:*)`) for a recipe to run without you. What they do not allow waits for you in `cogitator bridge asks`, and the step waits with it.
311
+
310
312
  **After a restart.** Every run is a workflow of [`@cogitator-ai/workflows`](https://www.npmjs.com/package/@cogitator-ai/workflows), an optional peer dependency, with a checkpoint after each step. A step hands its job over under an id made of the run and the step, so a step that runs again finds the job it handed over the first time. With checkpoints that outlive the process (`FileCheckpointStore`), a dispatcher that is started again picks every open recipe up where it was, and nothing is done twice. `cogitator bridge serve` keeps them in `recipes` in the folder of the bridge. In memory, the default, a run that was cut off starts its steps over and still finds the jobs it handed over.
311
313
 
312
314
  **A recipe of your own** is a workflow whose steps hand jobs over through the run:
@@ -430,25 +432,26 @@ Folders are compared by their real path, so a project reached through a symlink
430
432
 
431
433
  Each number is a default that `hostBridge({ limits })` changes.
432
434
 
433
- | Limit | Default | What happens |
434
- | ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ |
435
- | Depth | 3 | A job handed over from inside a job from inside a job is the deepest. One more is refused |
436
- | Letters per job | 60 | The job fails, both sides are told. The report that ends the job always goes through |
437
- | Time per job | 4 hours | The job fails, both sides are told |
438
- | Reply timeout | 30 minutes | The one who owes an answer, or did not pick a job up, is reminded. After as long again the job fails |
439
- | Jobs out | 20 | An agent with that many jobs still in progress cannot hand over another |
440
- | Jobs per hour | 60 | Handing over faster is refused as a loop |
441
- | Sessions starting | 2 | No more sessions are started at once |
442
- | Silence | 12 hours | A session with no job in progress is taken for gone, unless its harness lists it or its hook waits |
443
- | Session check | 1 minute | How often a harness that can list its sessions is asked which of them still run |
444
- | Window notice | 10 minutes | An agent that waits for a person at its own window is said so to whoever handed it a job, and not again within this time |
445
- | Person's answer | 4 hours | The person is reminded of a letter that waits for them. After as long again the job fails |
446
- | Delivery | 5 attempts | Retried with a growing wait, then left for the inbox |
447
- | Worktrees | 2 | A third job of the project that asks for a worktree of its own is refused while two are in progress |
448
- | Check | 10 minutes | A check that runs longer is ended with everything it started, and fails |
449
- | Worktree kept | 7 days | The worktree of a finished job nobody took or dropped is removed, its work kept under a ref |
450
- | Context | 6000 tokens | The block the bridge adds under a job keeps to it: files are cut or only named, notes stop when it is full |
451
- | Context wait | 10 seconds | A job whose context could not be put together in that time is handed over without it |
435
+ | Limit | Default | What happens |
436
+ | ----------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
437
+ | Depth | 3 | A job handed over from inside a job from inside a job is the deepest. One more is refused |
438
+ | Letters per job | 60 | The job fails, both sides are told. The report that ends the job always goes through |
439
+ | Time per job | 4 hours | The job fails, both sides are told |
440
+ | Reply timeout | 30 minutes | The one who owes an answer, or did not pick a job up, is reminded. After as long again the job fails |
441
+ | Jobs out | 20 | An agent with that many jobs still in progress cannot hand over another |
442
+ | Jobs per hour | 60 | Handing over faster is refused as a loop |
443
+ | Sessions starting | 2 | No more sessions are started at once |
444
+ | Silence | 12 hours | A session with no job in progress is taken for gone, unless its harness lists it or its hook waits |
445
+ | Session check | 1 minute | How often a harness that can list its sessions is asked which of them still run |
446
+ | Window notice | 10 minutes | An agent that waits for a person at its own window is said so to whoever handed it a job, and not again within this time |
447
+ | Person's answer | 4 hours | The person is reminded of a letter that waits for them. After as long again the job fails |
448
+ | Delivery | 5 attempts | Retried with a growing wait, then left for the inbox |
449
+ | Worktrees | 2 | A third job of the project that asks for a worktree of its own is refused while two are in progress |
450
+ | Check | 10 minutes | A check that runs longer is ended with everything it started, and fails |
451
+ | Worktree kept | 7 days | The worktree of a finished job nobody took or dropped is removed, its work kept under a ref |
452
+ | Context | 6000 tokens | The block the bridge adds under a job keeps to it: files are cut or only named, notes stop when it is full |
453
+ | Context wait | 10 seconds | A job whose context could not be put together in that time is handed over without it |
454
+ | Report reminder | 1 minute | A session that has waited for mail that long with a job it has not reported on is reminded to report. No reaction within the reply timeout fails the job |
452
455
 
453
456
  Two more rules have no number. A letter that says what the previous one in the same direction said is not delivered, and neither is a job the same agent already has from the caller and has not finished.
454
457
 
@@ -583,6 +583,31 @@ export declare class BridgeDispatcher extends EventEmitter<BridgeDispatcherEvent
583
583
  * the deliveries that are due again. The host calls it on a timer.
584
584
  */
585
585
  sweep(): Promise<SweepResult>;
586
+ /**
587
+ * Reminds a session to report on a job it carries out and went quiet on. A session whose
588
+ * waiter has been armed for `limits.reportReminderMs` has ended its turn, and when a job of it
589
+ * is still in progress with nothing owed to it, its answer was most likely said only in its
590
+ * own window, where whoever waits for the job does not read. The reminder is a letter, so it
591
+ * wakes the session. One that does not react to it within the reply timeout of the job fails
592
+ * the job, rather than leaving it open until its deadline, whether or not it waits for mail by
593
+ * then: the hook of a session waits a shorter while than that. A session that reacts with
594
+ * anything but a report is reminded again no sooner than that timeout.
595
+ *
596
+ * A session is left alone while its harness lists it in the middle of a turn, while it waits
597
+ * for jobs it handed over from inside the job or for the person, and while mail for it is on
598
+ * its way. Returns the jobs it failed.
599
+ */
600
+ private remindOfReports;
601
+ /**
602
+ * Whether a job waits for nothing but the word of the agent that carries it out: its checks
603
+ * do not run, it waits for no job handed over from inside it and for no answer of the person,
604
+ * and no letter for the agent is on its way.
605
+ */
606
+ private owesReport;
607
+ /** Whether the agent that carries a job out wrote a letter on it at or after a time. */
608
+ private wroteSince;
609
+ /** Whether the harness of a session listed it in the middle of a turn the last time. */
610
+ private inTurn;
586
611
  /**
587
612
  * Asks the adapters that can list their sessions which of them still run, once in
588
613
  * `limits.presenceCheckMs`. A session that was listed and then is not, two times in a row, is
@@ -1 +1 @@
1
- {"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../src/dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAGjG,OAAO,EAOL,KAA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O,CAAC,YAAY;IAWpB,OAAO,CAAC,YAAY;IA2CpB,sGAAsG;IACtG,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,cAAc;IAyCtB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,WAAW;IAoBnB;;;;OAIG;YACW,aAAa;IA0B3B,OAAO,CAAC,KAAK;IAOb,mGAAmG;IACnG,OAAO,CAAC,IAAI;YAWE,SAAS;IAyDvB,OAAO,CAAC,cAAc;IA0BtB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,WAAW;YASL,eAAe;CA0E9B"}
@@ -1263,6 +1263,7 @@ export class BridgeDispatcher extends EventEmitter {
1263
1263
  const waiter = {
1264
1264
  limit,
1265
1265
  signal,
1266
+ armedAt: this.now(),
1266
1267
  end: (reason, letters = []) => {
1267
1268
  if (this.waiters.get(name) === waiter)
1268
1269
  this.waiters.delete(name);
@@ -2441,6 +2442,7 @@ export class BridgeDispatcher extends EventEmitter {
2441
2442
  await this.failJob(tx, job.number, `${letter.to} did not ${pickup ? 'take' : 'answer'} the ${letter.kind} ${letter.id} in ${formatDuration(2 * job.budget.replyTimeoutMs)}`);
2442
2443
  failed.push(job.number);
2443
2444
  }
2445
+ failed.push(...(await this.remindOfReports(tx, now)));
2444
2446
  failed.push(...(await this.retireAgents(tx, now)));
2445
2447
  for (const agent of this.store.queuedRecipients())
2446
2448
  tx.wake.add(agent);
@@ -2449,6 +2451,88 @@ export class BridgeDispatcher extends EventEmitter {
2449
2451
  this.checkPresence();
2450
2452
  return result;
2451
2453
  }
2454
+ /**
2455
+ * Reminds a session to report on a job it carries out and went quiet on. A session whose
2456
+ * waiter has been armed for `limits.reportReminderMs` has ended its turn, and when a job of it
2457
+ * is still in progress with nothing owed to it, its answer was most likely said only in its
2458
+ * own window, where whoever waits for the job does not read. The reminder is a letter, so it
2459
+ * wakes the session. One that does not react to it within the reply timeout of the job fails
2460
+ * the job, rather than leaving it open until its deadline, whether or not it waits for mail by
2461
+ * then: the hook of a session waits a shorter while than that. A session that reacts with
2462
+ * anything but a report is reminded again no sooner than that timeout.
2463
+ *
2464
+ * A session is left alone while its harness lists it in the middle of a turn, while it waits
2465
+ * for jobs it handed over from inside the job or for the person, and while mail for it is on
2466
+ * its way. Returns the jobs it failed.
2467
+ */
2468
+ async remindOfReports(tx, now) {
2469
+ const failed = [];
2470
+ const reminded = this.store
2471
+ .jobTasks({ states: ['working'] })
2472
+ .flatMap((task) => jobOf(task) ?? [])
2473
+ .filter((job) => job.reportAskedAt !== undefined);
2474
+ for (const job of reminded) {
2475
+ const asked = Date.parse(job.reportAskedAt ?? '');
2476
+ const patience = job.budget.replyTimeoutMs;
2477
+ if (now - asked < patience || this.wroteSince(job, asked) || !this.owesReport(job))
2478
+ continue;
2479
+ if (this.inTurn(this.store.getAgent(job.to)))
2480
+ continue;
2481
+ await this.failJob(tx, job.number, `${job.to} ended its turn without a report and did not react to the reminder in ${formatDuration(patience)}`);
2482
+ failed.push(job.number);
2483
+ }
2484
+ for (const [name, waiter] of this.waiters) {
2485
+ if (now - waiter.armedAt < this.limits.reportReminderMs)
2486
+ continue;
2487
+ const agent = this.store.getAgent(name);
2488
+ if (agent?.status !== 'active' || this.conducts(agent) || this.inTurn(agent))
2489
+ continue;
2490
+ const carried = this.store
2491
+ .jobTasks({ to: name, states: ['working'] })
2492
+ .flatMap((task) => jobOf(task) ?? []);
2493
+ for (const job of carried) {
2494
+ if (!this.owesReport(job))
2495
+ continue;
2496
+ if (job.reportAskedAt && now - Date.parse(job.reportAskedAt) < job.budget.replyTimeoutMs) {
2497
+ continue;
2498
+ }
2499
+ this.systemNote(tx, job, name, `You ended your turn, and job #${job.number} is still in progress: ${job.from} has no report from you. What you said in your own window nobody else reads. Report on the job with the report tool: when your answer is written there already, send that answer itself, whole, not a word about it. If you are not done, ask what you need, or say in a note what you wait for.`);
2500
+ await this.patchRecord(job.taskId, { reportAskedAt: this.iso(now) });
2501
+ }
2502
+ }
2503
+ return failed;
2504
+ }
2505
+ /**
2506
+ * Whether a job waits for nothing but the word of the agent that carries it out: its checks
2507
+ * do not run, it waits for no job handed over from inside it and for no answer of the person,
2508
+ * and no letter for the agent is on its way.
2509
+ */
2510
+ owesReport(job) {
2511
+ if (job.checking || this.waitsForPerson(job.number))
2512
+ return false;
2513
+ const parts = this.store.jobTasks({
2514
+ parent: job.number,
2515
+ states: ACTIVE_JOB_STATES,
2516
+ limit: 1,
2517
+ });
2518
+ if (parts.length > 0)
2519
+ return false;
2520
+ return this.store.countLetters({ to: job.to, states: ['queued'] }) === 0;
2521
+ }
2522
+ /** Whether the agent that carries a job out wrote a letter on it at or after a time. */
2523
+ wroteSince(job, since) {
2524
+ const [last] = this.store.listLetters({
2525
+ job: job.number,
2526
+ from: job.to,
2527
+ newestFirst: true,
2528
+ limit: 1,
2529
+ });
2530
+ return last !== undefined && Date.parse(last.createdAt) >= since;
2531
+ }
2532
+ /** Whether the harness of a session listed it in the middle of a turn the last time. */
2533
+ inTurn(agent) {
2534
+ return (agent !== undefined && this.presence.get(agent.harness)?.busy.has(agent.sessionId) === true);
2535
+ }
2452
2536
  /**
2453
2537
  * Asks the adapters that can list their sessions which of them still run, once in
2454
2538
  * `limits.presenceCheckMs`. A session that was listed and then is not, two times in a row, is
@@ -2473,7 +2557,7 @@ export class BridgeDispatcher extends EventEmitter {
2473
2557
  const asked = now;
2474
2558
  this.track(within(adapter.liveSessions(), this.limits.deliveryTimeoutMs, `Listing the ${harness} sessions`)
2475
2559
  .then((sessions) => this.mutate(async (tx) => {
2476
- await this.applyPresence(tx, harness, new Set(sessions.map((session) => session.sessionId)), adapter.ownsSessions === true, asked);
2560
+ await this.applyPresence(tx, harness, new Set(sessions.map((session) => session.sessionId)), adapter.ownsSessions === true, asked, new Set(sessions.flatMap((session) => (session.busy ? [session.sessionId] : []))));
2477
2561
  for (const session of sessions) {
2478
2562
  if (!session.waitingFor)
2479
2563
  continue;
@@ -2486,8 +2570,13 @@ export class BridgeDispatcher extends EventEmitter {
2486
2570
  .finally(() => this.listing.delete(harness)));
2487
2571
  }
2488
2572
  }
2489
- async applyPresence(tx, harness, live, certain, asked) {
2490
- const known = this.presence.get(harness) ?? { live, seen: new Set(), missed: new Set() };
2573
+ async applyPresence(tx, harness, live, certain, asked, busy = new Set()) {
2574
+ const known = this.presence.get(harness) ?? {
2575
+ live,
2576
+ seen: new Set(),
2577
+ missed: new Set(),
2578
+ busy: new Set(),
2579
+ };
2491
2580
  const missed = new Set();
2492
2581
  for (const sessionId of live)
2493
2582
  known.seen.add(sessionId);
@@ -2506,7 +2595,7 @@ export class BridgeDispatcher extends EventEmitter {
2506
2595
  known.seen.delete(id);
2507
2596
  await this.agentGone(tx, agent, `the session of ${agent.name} is not running any more`);
2508
2597
  }
2509
- this.presence.set(harness, { live, seen: known.seen, missed });
2598
+ this.presence.set(harness, { live, seen: known.seen, missed, busy });
2510
2599
  }
2511
2600
  /**
2512
2601
  * Takes sessions that are not there out of the address book, so a harness word keeps reaching