@audienti/cli 0.1.62 → 0.1.63

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to the Audienti CLI are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.63] - 2026-09-10
8
+
9
+ ### Fixed
10
+
11
+ - `inbox-ops queue` retries a page read that returns HTTP 502, 503, or 504 up to three times with backoff before failing, since one Inbox Ops page can take the server most of the proxy timeout.
12
+
7
13
  ## [0.1.62] - 2026-09-10
8
14
 
9
15
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audienti/cli",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "description": "Agent-first command-line client for Audienti.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -84,6 +84,9 @@ const INBOX_OPS_BULK_LABELS = {
84
84
  const INBOX_OPS_SNAPSHOT_FILENAME = "inbox-ops-snapshot.json";
85
85
  const INBOX_OPS_MAX_PAGES = 50;
86
86
  const INBOX_OPS_BATCH_SIZE = 50;
87
+ const INBOX_OPS_PAGE_ATTEMPTS = 4;
88
+ const INBOX_OPS_RETRY_STATUSES = [502, 503, 504];
89
+ const INBOX_OPS_RETRY_DELAY_MS = 2000;
87
90
  const NETWORK_OPS_QUEUE_USAGE = "Usage: audienti network-ops queue [--page <n>] [--offset <n>|--cursor <token>] [--json] [--account <acct_id>]";
88
91
  const NETWORK_OPS_ACCEPT_USAGE = "Usage: audienti network-ops accept <row_id> [--json] [--account <acct_id>]";
89
92
  const NETWORK_OPS_DECLINE_USAGE = "Usage: audienti network-ops decline <row_id> [--json] [--account <acct_id>]";
@@ -3312,7 +3315,7 @@ async function inboxOpsQueue(args, context, { accountOverride } = {}) {
3312
3315
  return;
3313
3316
  }
3314
3317
 
3315
- const { rows, pages, truncated } = await fetchAllInboxOpsRows(client, accountId, query);
3318
+ const { rows, pages, truncated } = await fetchAllInboxOpsRows(client, accountId, query, context);
3316
3319
  await writeInboxOpsSnapshot(context, { accountId, rows });
3317
3320
  if (values.json) {
3318
3321
  return writeJson(context.stdout, {
@@ -3331,7 +3334,22 @@ async function inboxOpsQueue(args, context, { accountOverride } = {}) {
3331
3334
  }
3332
3335
  }
3333
3336
 
3334
- async function fetchAllInboxOpsRows(client, accountId, baseQuery) {
3337
+ // One inbox page read can take the server 15-30s, so a busy proxy sometimes
3338
+ // answers 502/503/504. Retry that page a few times before failing the listing.
3339
+ async function fetchInboxOpsPageWithRetry(client, accountId, query, context) {
3340
+ for (let attempt = 1; ; attempt += 1) {
3341
+ try {
3342
+ return await client.operatorQueue(accountId, query);
3343
+ } catch (error) {
3344
+ const retryable = error instanceof ApiError && INBOX_OPS_RETRY_STATUSES.includes(error.status);
3345
+ if (!retryable || attempt >= INBOX_OPS_PAGE_ATTEMPTS) throw error;
3346
+ writeLine(context.stderr, `Page read returned HTTP ${error.status}; retrying (${attempt}/${INBOX_OPS_PAGE_ATTEMPTS - 1})...`);
3347
+ await context.sleep(INBOX_OPS_RETRY_DELAY_MS * attempt);
3348
+ }
3349
+ }
3350
+ }
3351
+
3352
+ async function fetchAllInboxOpsRows(client, accountId, baseQuery, context) {
3335
3353
  const rows = [];
3336
3354
  const seen = new Set();
3337
3355
  let query = { ...baseQuery };
@@ -3339,7 +3357,7 @@ async function fetchAllInboxOpsRows(client, accountId, baseQuery) {
3339
3357
  let truncated = false;
3340
3358
 
3341
3359
  for (;;) {
3342
- const payload = await client.operatorQueue(accountId, query);
3360
+ const payload = await fetchInboxOpsPageWithRetry(client, accountId, query, context);
3343
3361
  pages += 1;
3344
3362
  for (const row of inboxOpsPayloadRows(payload)) {
3345
3363
  if (seen.has(row.id)) continue;