@pentatonic-ai/ai-agent-sdk 0.10.35 → 0.10.36

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/dist/index.cjs CHANGED
@@ -878,7 +878,7 @@ function fireAndForgetEmit(clientConfig, sessionOpts, messages, result, model) {
878
878
  }
879
879
 
880
880
  // src/telemetry.js
881
- var VERSION = "0.10.35";
881
+ var VERSION = "0.10.36";
882
882
  var TELEMETRY_URL = "https://sdk-telemetry.philip-134.workers.dev";
883
883
  function machineId() {
884
884
  const raw = typeof process !== "undefined" ? `${process.env?.USER || process.env?.USERNAME || "u"}:${process.platform || "x"}:${process.arch || "x"}` : "browser";
package/dist/index.js CHANGED
@@ -847,7 +847,7 @@ function fireAndForgetEmit(clientConfig, sessionOpts, messages, result, model) {
847
847
  }
848
848
 
849
849
  // src/telemetry.js
850
- var VERSION = "0.10.35";
850
+ var VERSION = "0.10.36";
851
851
  var TELEMETRY_URL = "https://sdk-telemetry.philip-134.workers.dev";
852
852
  function machineId() {
853
853
  const raw = typeof process !== "undefined" ? `${process.env?.USER || process.env?.USERNAME || "u"}:${process.platform || "x"}:${process.arch || "x"}` : "browser";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentatonic-ai/ai-agent-sdk",
3
- "version": "0.10.35",
3
+ "version": "0.10.36",
4
4
  "description": "TES SDK — LLM observability and lifecycle tracking via Pentatonic Thing Event System. Track token usage, tool calls, and conversations. Manage things through event-sourced lifecycle stages with AI enrichment and vector search.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -2448,6 +2448,27 @@ def claim_next_batch(conn: psycopg.Connection) -> list[dict[str, Any]]:
2448
2448
  LLM call on filtered events. They're cheap UPDATE statements scoped
2449
2449
  to the current pending set."""
2450
2450
  with conn.cursor() as cur:
2451
+ # Sweep: retire retry-budget-exhausted rows stuck in 'pending'. The
2452
+ # claim below filters `attempts < MAX_ATTEMPTS`, so a row that reached
2453
+ # MAX_ATTEMPTS while still 'pending' is UNCLAIMABLE — no worker can ever
2454
+ # process it or transition it to 'failed'. Such rows accumulate (legacy
2455
+ # gotcha #11: claiming used to increment attempts; a burst of
2456
+ # deploy-reclaims could push a row to MAX in 'pending') and then pin the
2457
+ # distiller autoscaler awake forever via its flush-on-age trigger (it
2458
+ # counts pending by age) — an idle GPU billed 24/7 for events it can't
2459
+ # touch (62 such rows, oldest 26d, found 2026-07-14). Fail them here so
2460
+ # 'pending' only ever holds claimable work. Terminal by definition:
2461
+ # they already spent the full retry budget.
2462
+ cur.execute(
2463
+ """
2464
+ UPDATE distillation_queue SET
2465
+ status = 'failed',
2466
+ completed_at = NOW(),
2467
+ last_error = COALESCE(last_error, '') || ' | swept: attempts_exhausted_in_pending'
2468
+ WHERE status = 'pending' AND attempts >= %s
2469
+ """,
2470
+ (MAX_ATTEMPTS,),
2471
+ )
2451
2472
  # Pre-filter: agent's-own-output events (by source_kind). Covers any
2452
2473
  # agent producer without enumerating its source label.
2453
2474
  if SKIP_AGENT_SOURCE_KIND: