@botbuddy/cli 1.64.27 → 1.64.29

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,7 +1,7 @@
1
1
  {
2
- "release_version": "1.64.27",
3
- "source_commit": "76c0819a881fb81e0b91a1f49958776f93505e90",
4
- "source_sha256": "040d1d49de6ef1851fde865475e0e2acc747b1e0aad8d583b84eea50d86e3136",
2
+ "release_version": "1.64.29",
3
+ "source_commit": "03ff10bbdbf29436bb0775b0342dd6ae558ba2a0",
4
+ "source_sha256": "5ba023d785ba672d4e912b4c1fdb61ab0d9ccc76356d3372ac42590064516fc2",
5
5
  "target": "darwin-arm64",
6
- "sha256": "dc94439a277cf41dfe347dd4aa33d6797017c6ddc974baba329d790f2dc6e131"
6
+ "sha256": "3817107c1e0ad8ccd208d010482435b382db9ac16da9b5f4de7641e4d7dd8d71"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.64.27",
3
- "source_commit": "76c0819a881fb81e0b91a1f49958776f93505e90",
4
- "source_sha256": "040d1d49de6ef1851fde865475e0e2acc747b1e0aad8d583b84eea50d86e3136",
2
+ "release_version": "1.64.29",
3
+ "source_commit": "03ff10bbdbf29436bb0775b0342dd6ae558ba2a0",
4
+ "source_sha256": "5ba023d785ba672d4e912b4c1fdb61ab0d9ccc76356d3372ac42590064516fc2",
5
5
  "target": "linux-x64",
6
- "sha256": "6f7dca4db3fad58ac479797a06c0358acb749c6463f4a6dd14346d1b547f0be3"
6
+ "sha256": "06465a1240a4bd24033a873be038436dd059078a14009496158f6b1f32e89507"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.64.27",
4
- "source_commit": "76c0819a881fb81e0b91a1f49958776f93505e90",
5
- "source_sha256": "040d1d49de6ef1851fde865475e0e2acc747b1e0aad8d583b84eea50d86e3136",
3
+ "release_version": "1.64.29",
4
+ "source_commit": "03ff10bbdbf29436bb0775b0342dd6ae558ba2a0",
5
+ "source_sha256": "5ba023d785ba672d4e912b4c1fdb61ab0d9ccc76356d3372ac42590064516fc2",
6
6
  "targets": {
7
7
  "darwin-arm64": {
8
8
  "goos": "darwin",
9
9
  "goarch": "arm64",
10
10
  "binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
11
- "sha256": "dc94439a277cf41dfe347dd4aa33d6797017c6ddc974baba329d790f2dc6e131",
11
+ "sha256": "3817107c1e0ad8ccd208d010482435b382db9ac16da9b5f4de7641e4d7dd8d71",
12
12
  "mode": "0755"
13
13
  },
14
14
  "linux-x64": {
15
15
  "goos": "linux",
16
16
  "goarch": "amd64",
17
17
  "binary": "daemon/bin/linux-x64/botbuddy-daemon",
18
- "sha256": "6f7dca4db3fad58ac479797a06c0358acb749c6463f4a6dd14346d1b547f0be3",
18
+ "sha256": "06465a1240a4bd24033a873be038436dd059078a14009496158f6b1f32e89507",
19
19
  "mode": "0755"
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.64.27",
3
+ "version": "1.64.29",
4
4
  "description": "BotBuddy \u2014 Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/stack.mjs CHANGED
@@ -3951,6 +3951,25 @@ export async function runStackLifecycle(opts, childArgv, adapters = {}) {
3951
3951
  /** BOT-2467: where a lifecycle result carries its outcome-record channel. */
3952
3952
  export const OUTCOME_CHANNEL = Symbol.for("botbuddy.stackRunOutcomeChannel");
3953
3953
 
3954
+ /** The lease calls `bb stack run` makes over its retrying caller (`rpc.call(name, args, opts)`). */
3955
+ export function defaultStackRunApi(rpc) {
3956
+ return {
3957
+ request: (args) => rpc.call("request_stack_lease", args),
3958
+ // BOT-2780 (beta requester origin): BOT-2499's identified admission, never a fallback.
3959
+ requestIdentified: (args) => rpc.call("request_stack_lease_identified", args),
3960
+ getAdmission: (args) => rpc.call("get_stack_lease_admission", args),
3961
+ get: (leaseId, { signal } = {}) => rpc.call("get_stack_lease", { lease_id: leaseId }, { signal }),
3962
+ // BOT-1803: a heartbeat carries the measured client use when there is one. BOT-3095: it is the
3963
+ // RUN's heartbeat, so it says the run is alive — the server then keeps a quiet live run out of
3964
+ // `no_use` idling (and preemption) up to its ceiling. `bb stack touch` never sends this.
3965
+ touch: (leaseId, usage, { signal } = {}) => rpc.call("touch_stack_lease", { lease_id: leaseId, ...(usage ? { usage } : {}), run_alive: true }, { signal }),
3966
+ // BOT-1803: `{ idle: true }` idles an ACTIVE lease instead of reaping it.
3967
+ release: (leaseId, signal, { idle = false } = {}) => rpc.call("release_stack_lease", { lease_id: leaseId, disposition: "destroy", ...(idle ? { idle: true } : {}) }, { signal }),
3968
+ // BOT-2400: keep a queued lease's place when the park deadline passes.
3969
+ hold: (leaseId, holdSecs) => holdQueuePlace((name, args) => rpc.call(name, args), leaseId, holdSecs),
3970
+ };
3971
+ }
3972
+
3954
3973
  async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
3955
3974
  // BOT-1750 (Codex R9/R11 P2): `stack run` is a lease-creating entry point AND a
3956
3975
  // long-lived one (queue → provision → child → heartbeat → cleanup). A cached token
@@ -3972,19 +3991,7 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
3972
3991
  });
3973
3992
  // BOT-2467: cmdRun records the run's outcome with the credential this run ended on.
3974
3993
  incidentBox.outcomeChannel = { get auth() { return rpc.auth; }, callTool: adapters.callTool ?? callToolJson };
3975
- const api = adapters.api ?? {
3976
- request: (args) => rpc.call("request_stack_lease", args),
3977
- // BOT-2780 (beta requester origin): BOT-2499's identified admission, never a fallback.
3978
- requestIdentified: (args) => rpc.call("request_stack_lease_identified", args),
3979
- getAdmission: (args) => rpc.call("get_stack_lease_admission", args),
3980
- get: (leaseId, { signal } = {}) => rpc.call("get_stack_lease", { lease_id: leaseId }, { signal }),
3981
- // BOT-1803: a heartbeat carries the measured client use when there is one.
3982
- touch: (leaseId, usage, { signal } = {}) => rpc.call("touch_stack_lease", { lease_id: leaseId, ...(usage ? { usage } : {}) }, { signal }),
3983
- // BOT-1803: `{ idle: true }` idles an ACTIVE lease instead of reaping it.
3984
- release: (leaseId, signal, { idle = false } = {}) => rpc.call("release_stack_lease", { lease_id: leaseId, disposition: "destroy", ...(idle ? { idle: true } : {}) }, { signal }),
3985
- // BOT-2400: keep a queued lease's place when the park deadline passes.
3986
- hold: (leaseId, holdSecs) => holdQueuePlace((name, args) => rpc.call(name, args), leaseId, holdSecs),
3987
- };
3994
+ const api = adapters.api ?? defaultStackRunApi(rpc);
3988
3995
  // An injected api double without `hold` keeps the pre-BOT-2400 release unless the test also
3989
3996
  // injected the tool transport (never a real network call from a test).
3990
3997
  const holdPlace = api.hold ?? (adapters.callTool ? (leaseId, holdSecs) => holdQueuePlace((name, args) => rpc.call(name, args), leaseId, holdSecs) : null);
@@ -5296,6 +5303,10 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
5296
5303
  };
5297
5304
  heartbeat = clock.setInterval(touchLease, cadenceMs);
5298
5305
  heartbeat.unref?.();
5306
+ // BOT-3095: one heartbeat as the child starts, not a full cadence later, so a run that
5307
+ // re-adopted an idle stack says it is alive before the next minute's idle pass.
5308
+ const firstTouch = clock.setTimeout(() => touchLease(), 0);
5309
+ firstTouch?.unref?.();
5299
5310
  if (opts.hardTtl) hardTimer = clock.setTimeout(() => stopChild("SIGTERM", EXIT.TIMEOUT), opts.hardTtl * 1000);
5300
5311
  hardTimer?.unref?.();
5301
5312
  childResult = await waitForChild(child);