@botbuddy/cli 1.63.22 → 1.63.23

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.63.22",
3
- "source_commit": "f92023885ef6f9fc477091b12f6769cae9d85560",
4
- "source_sha256": "2dde93a23b6af3842f96d073bd0bd0113f5a6f3a3343dbb5a0037627aff377e9",
2
+ "release_version": "1.63.23",
3
+ "source_commit": "d51ef61947fbda05da967f8f6a6d30affb2ff2bf",
4
+ "source_sha256": "f3a066d0c0a41b186a8edc7602b00bd8ae522725aa5a8d678740235be11816b1",
5
5
  "target": "darwin-arm64",
6
- "sha256": "d06bccfe161d0f6e6d574c8ae01611b696b801705c565a091fbe3a9f2d4d04d8"
6
+ "sha256": "91dc67a61e2ec59657aab6a7c932bcc27d57c713a82e51747201576d570eeae6"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.63.22",
3
- "source_commit": "f92023885ef6f9fc477091b12f6769cae9d85560",
4
- "source_sha256": "2dde93a23b6af3842f96d073bd0bd0113f5a6f3a3343dbb5a0037627aff377e9",
2
+ "release_version": "1.63.23",
3
+ "source_commit": "d51ef61947fbda05da967f8f6a6d30affb2ff2bf",
4
+ "source_sha256": "f3a066d0c0a41b186a8edc7602b00bd8ae522725aa5a8d678740235be11816b1",
5
5
  "target": "linux-x64",
6
- "sha256": "a5ce863685465d6ef9a20ad98758c2d14f4306f5e60dfb013f6dc8388e8405b4"
6
+ "sha256": "bffecca81f03de0213a8800db20f787fd87538eb2ecb1e217028fcbf0aad19d5"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.63.22",
4
- "source_commit": "f92023885ef6f9fc477091b12f6769cae9d85560",
5
- "source_sha256": "2dde93a23b6af3842f96d073bd0bd0113f5a6f3a3343dbb5a0037627aff377e9",
3
+ "release_version": "1.63.23",
4
+ "source_commit": "d51ef61947fbda05da967f8f6a6d30affb2ff2bf",
5
+ "source_sha256": "f3a066d0c0a41b186a8edc7602b00bd8ae522725aa5a8d678740235be11816b1",
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": "d06bccfe161d0f6e6d574c8ae01611b696b801705c565a091fbe3a9f2d4d04d8",
11
+ "sha256": "91dc67a61e2ec59657aab6a7c932bcc27d57c713a82e51747201576d570eeae6",
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": "a5ce863685465d6ef9a20ad98758c2d14f4306f5e60dfb013f6dc8388e8405b4",
18
+ "sha256": "bffecca81f03de0213a8800db20f787fd87538eb2ecb1e217028fcbf0aad19d5",
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.63.22",
3
+ "version": "1.63.23",
4
4
  "description": "BotBuddy \u2014 Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/stack.mjs CHANGED
@@ -83,6 +83,7 @@ const ADMISSION_REPLAYABLE = new Set(["ADMISSION_UNCERTAIN", "RETRY_SAME_REQUEST
83
83
  // The key already has a ledger row (or had one): never replay it blindly or treat it as unallocated.
84
84
  const ADMISSION_COMMITTED_UNCERTAIN = new Set(["REQUEST_IDENTITY_MISMATCH", "REQUEST_CLOSED", "ORIGINAL_LEASE_UNAVAILABLE"]);
85
85
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
86
+ const SQLSTATE_RE = /^[0-9A-Z]{5}$/;
86
87
 
87
88
  /**
88
89
  * Codex #1077 P1 / BOT-2184: an sshd with `GatewayPorts yes` binds a `-R` forward on every
@@ -1364,6 +1365,11 @@ export function leaseRefusalError(data) {
1364
1365
  `Inspect with \`bb stack status ${data.lease_id}\`; after the owning batch ends, release with \`bb stack done ${data.lease_id} --reap\`, ` +
1365
1366
  `then wait with \`bb wait 'lease:id=${data.lease_id},state=reaped' --heartbeat\`.`;
1366
1367
  }
1368
+ // BOT-2812: a server fault, not the caller's: the database rolled the admission back.
1369
+ if (data?.code === "ADMISSION_FAILED") {
1370
+ return `the server's identified admission failed in the database${data.sqlstate ? ` (SQLSTATE ${data.sqlstate})` : ""} and rolled back, ` +
1371
+ "so no lease was created and this stack's port claim is released. This is a BotBuddy server fault: report it with this run's admission request id.";
1372
+ }
1367
1373
  return data?.message || REMOTE_REFUSAL_GUIDANCE[data?.code] || data?.code || "lease request refused";
1368
1374
  }
1369
1375
 
@@ -4207,6 +4213,8 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
4207
4213
  // for its reap and send this same request again; it is never adopted or released.
4208
4214
  else return { ...res, data: { success: false, code, ...(res.data?.message ? { message: res.data.message } : {}),
4209
4215
  ...(res.data?.phase ? { phase: res.data.phase } : {}), ...(res.data?.wait ? { wait: res.data.wait } : {}),
4216
+ // BOT-2812: the database ran the call and rolled it back; its SQLSTATE names the class.
4217
+ ...(code === "ADMISSION_FAILED" && SQLSTATE_RE.test(res.data?.sqlstate ?? "") ? { sqlstate: res.data.sqlstate } : {}),
4210
4218
  ...(code === HOST_CAPACITY_SOURCE_STALE_CODE ? capacityStaleReceiptFields(res.data) : {}) } };
4211
4219
  } else {
4212
4220
  const ack = identifiedAdmissionAck(res.data, leaseArgs.request_id);
@@ -4450,6 +4458,7 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
4450
4458
  return {
4451
4459
  exitCode: leaseRefusalExit(request.data?.code), outcome: "error", code: request.data?.code,
4452
4460
  ...capacityStaleReceiptFields(request.data), error: leaseRefusalError(request.data),
4461
+ ...(request.data?.sqlstate ? { sqlstate: request.data.sqlstate } : {}),
4453
4462
  ...(request.data.lease_id ? { leaseId: request.data.lease_id, state: request.data.state ?? null } : {}),
4454
4463
  };
4455
4464
  }