@lawaty/lacode 1.3.0-beta.6 → 1.3.0-beta.7

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
@@ -7,6 +7,18 @@ All notable changes to LaCode are recorded here. The format follows
7
7
  Versions come from git release commits; the npm version is bumped in the same
8
8
  commit as the changelog entry it describes.
9
9
 
10
+ ## [1.3.0-beta.7] — only a rate-limit reset speaks
11
+
12
+ ### Changed
13
+
14
+ - **The slot notice is now a rate-limit reset notice, not a generic "slot
15
+ ready".** It fires only when a slot that was cooling for a quota/rate-limit
16
+ reason becomes usable again — either because its window lapsed or a probe
17
+ found it answering. Outages, auth failures, missing models and other
18
+ non-quota cooldowns no longer raise it, which is what made it frequent. The
19
+ title is `LaCode: rate limit reset` and the message says the rate limit has
20
+ reset.
21
+
10
22
  ## [1.3.0-beta.6] — a recovered slot says it is ready
11
23
 
12
24
  ### Added
package/dist/index.js CHANGED
@@ -3300,16 +3300,16 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3300
3300
  if (authBenched > 0) parts.push(`benched ${authBenched} auth-failed`);
3301
3301
  return parts.join(", ");
3302
3302
  };
3303
- const readyMessage = (models) => models.length === 1 ? `${models[0]} is back in the pool \u2014 ready for use.` : `${models.length} slots are back in the pool \u2014 ready for use: ${models.join(", ")}.`;
3303
+ const resetMessage = (models) => models.length === 1 ? `${models[0]} is available again \u2014 the rate limit has reset.` : `${models.length} slots are available again \u2014 their rate limits have reset: ${models.join(", ")}.`;
3304
3304
  const announceReady = (models) => {
3305
3305
  const fresh = models.filter((model) => claimDesktopNotice(model));
3306
3306
  if (fresh.length === 0) return;
3307
3307
  try {
3308
- notify("LaCode: slot ready", readyMessage(fresh));
3308
+ notify("LaCode: rate limit reset", resetMessage(fresh));
3309
3309
  } catch {
3310
3310
  }
3311
3311
  };
3312
- const announce = async (report) => {
3312
+ const announce = async (report, prior) => {
3313
3313
  if (!report.changed) return;
3314
3314
  const message = report.cleared.length > 0 ? `Re-admitted ${report.cleared.join(", ")} \u2014 they answer again.` : report.missing.length > 0 ? `Benched ${report.missing.join(", ")} \u2014 the provider does not serve them.` : `${report.kept.length} cooling model(s) re-checked, still limited.`;
3315
3315
  await log("info", `pool probe: ${message}`, { cleared: report.cleared, kept: report.kept });
@@ -3319,9 +3319,15 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3319
3319
  });
3320
3320
  } catch {
3321
3321
  }
3322
- if (report.cleared.length > 0) announceReady(report.cleared);
3322
+ const resets = report.cleared.filter((model) => isQuotaReason(prior.get(model)?.reason ?? ""));
3323
+ if (resets.length > 0) announceReady(resets);
3323
3324
  };
3324
3325
  const runProbe = async (models) => {
3326
+ let prior = /* @__PURE__ */ new Map();
3327
+ try {
3328
+ prior = readLimits(s);
3329
+ } catch {
3330
+ }
3325
3331
  let report = EMPTY_REPORT;
3326
3332
  try {
3327
3333
  report = await probeCooling(client, { state: s, directory, models });
@@ -3329,7 +3335,7 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3329
3335
  await log("error", `pool probe failed: ${String(error)}`);
3330
3336
  return EMPTY_REPORT;
3331
3337
  }
3332
- await announce(report);
3338
+ await announce(report, prior);
3333
3339
  return report;
3334
3340
  };
3335
3341
  const probeMs = opts.probeMs ?? PROBE_INTERVAL_MS;
@@ -3358,13 +3364,13 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3358
3364
  const back = [];
3359
3365
  for (const [model, reason] of coolingSeen) {
3360
3366
  if (still.has(model)) continue;
3361
- if (reason === AUTH_FAILURE_REASON || reason === MODEL_MISSING_REASON) continue;
3367
+ if (!isQuotaReason(reason)) continue;
3362
3368
  if (!providerReady(s, model)) continue;
3363
3369
  back.push(model);
3364
3370
  }
3365
3371
  coolingSeen = still;
3366
3372
  if (back.length > 0) {
3367
- void log("info", `pool: ${readyMessage(back)}`, { cleared: back });
3373
+ void log("info", `pool: ${resetMessage(back)}`, { cleared: back });
3368
3374
  announceReady(back);
3369
3375
  }
3370
3376
  }, expiryMs) : void 0;
@@ -3436,6 +3442,11 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3436
3442
  );
3437
3443
  };
3438
3444
  const runValidation = async (models) => {
3445
+ let prior = /* @__PURE__ */ new Map();
3446
+ try {
3447
+ prior = readLimits(s);
3448
+ } catch {
3449
+ }
3439
3450
  let report = EMPTY_REPORT;
3440
3451
  try {
3441
3452
  report = await probeModels(client, { state: s, directory, models });
@@ -3443,7 +3454,7 @@ var agentPoolHooks = (async ({ client, serverUrl, directory }, options) => {
3443
3454
  await log("error", `pool validation failed: ${String(error)}`);
3444
3455
  return EMPTY_REPORT;
3445
3456
  }
3446
- await announce(report);
3457
+ await announce(report, prior);
3447
3458
  return report;
3448
3459
  };
3449
3460
  const watchMs = opts.watchMs ?? SLOT_WATCH_MS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lawaty/lacode",
3
- "version": "1.3.0-beta.6",
3
+ "version": "1.3.0-beta.7",
4
4
  "description": "Ultimate opencode setup for Go users — cost-controlled pooled subagents, hang recovery, and notifications for opencode.",
5
5
  "license": "MIT",
6
6
  "type": "module",