@ouro.bot/cli 0.1.0-alpha.757 → 0.1.0-alpha.759

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.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.759",
6
+ "changes": [
7
+ "Retry unresolved tool failures across repeated requests when the current response says the lane is down.",
8
+ "Accept Unraid's live server PrefixedID shape when grounding storage and system reads."
9
+ ]
10
+ },
11
+ {
12
+ "version": "0.1.0-alpha.758",
13
+ "changes": [
14
+ "Prevent repeated requests from borrowing stale tool failures after the tool becomes available again."
15
+ ]
16
+ },
4
17
  {
5
18
  "version": "0.1.0-alpha.757",
6
19
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.757",
2
+ "runtimeVersion": "0.1.0-alpha.759",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-08-30T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>Mendelow Cloud Butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.757</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.759</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -555,7 +555,59 @@ function messageContentText(content) {
555
555
  }
556
556
  function isHarnessCorrectiveUserText(text) {
557
557
  return text.startsWith("no tool was called this turn. you must end every turn")
558
- || text.startsWith("private-return acknowledgement claimed work was queued, but no ponder packet was created this turn.");
558
+ || text.startsWith("private-return acknowledgement claimed work was queued, but no ponder packet was created this turn.")
559
+ || text.startsWith("this exact request previously reached a tool that is advertised again now.");
560
+ }
561
+ function claimsCurrentToolFailure(text) {
562
+ const normalized = text.replace(/\s+/g, " ").trim().toLowerCase();
563
+ return /\b(?:still|currently|now)\s+(?:down|offline|unavailable|broken|failing|unreachable)\b/.test(normalized)
564
+ || /\b(?:runtime|tool|service|server|system|lane)\b.{0,40}\b(?:is|remains?|seems?)\s+(?:still\s+)?(?:down|offline|unavailable|broken|failing|unreachable)\b/.test(normalized)
565
+ || /\b(?:i|we)\s+(?:can(?:not|'t)|could(?:not|n't)|am unable to|are unable to)\s+(?:call|use|access|reach|run|change)\b/.test(normalized)
566
+ || /\b(?:already\s+)?tried\b.{0,80}\b(?:failed|failure|error|down|offline|unavailable)\b/.test(normalized);
567
+ }
568
+ function historicalFailedToolsForExactRepeatedRequest(messages) {
569
+ const userRequests = [];
570
+ for (let index = 0; index < messages.length; index += 1) {
571
+ const message = messages[index];
572
+ if (message?.role !== "user")
573
+ continue;
574
+ const text = messageContentText(message.content).replace(/\s+/g, " ").trim();
575
+ if (!text || isHarnessCorrectiveUserText(text))
576
+ continue;
577
+ userRequests.push({ index, text });
578
+ }
579
+ const current = userRequests.at(-1);
580
+ if (!current)
581
+ return [];
582
+ const prior = userRequests.slice(0, -1).find((request) => request.text === current.text);
583
+ if (!prior)
584
+ return [];
585
+ const namesByCallId = new Map();
586
+ const failedNames = new Set();
587
+ for (let index = prior.index + 1; index < current.index; index += 1) {
588
+ const message = messages[index];
589
+ if (message?.role === "assistant" && Array.isArray(message.tool_calls)) {
590
+ for (const call of message.tool_calls) {
591
+ if (call.type === "function" && call.id && call.function.name) {
592
+ namesByCallId.set(call.id, call.function.name);
593
+ }
594
+ }
595
+ continue;
596
+ }
597
+ if (message?.role !== "tool")
598
+ continue;
599
+ const content = messageContentText(message.content).trim().toLowerCase();
600
+ const name = namesByCallId.get(message.tool_call_id);
601
+ if (!name)
602
+ continue;
603
+ if (content.startsWith("error:") || content.startsWith("invalid tool arguments:")) {
604
+ failedNames.add(name);
605
+ }
606
+ else {
607
+ failedNames.delete(name);
608
+ }
609
+ }
610
+ return [...failedNames];
559
611
  }
560
612
  function latestUserMessageText(messages) {
561
613
  for (let i = messages.length - 1; i >= 0; i -= 1) {
@@ -1042,6 +1094,8 @@ async function runAgent(messages, callbacks, channel, signal, options) {
1042
1094
  // a ponder packet created the return obligation in this turn.
1043
1095
  let noToolCallRetries = 0;
1044
1096
  const NO_TOOL_CALL_MAX_RETRIES = 2;
1097
+ const historicalFailedToolNames = historicalFailedToolsForExactRepeatedRequest(messages);
1098
+ let historicalToolFailureRetryIssued = false;
1045
1099
  let providerIterations = 0;
1046
1100
  const toolLoopState = (0, tool_loop_1.createToolLoopState)();
1047
1101
  const toolFrictionLedger = (0, tool_friction_1.createToolFrictionLedger)();
@@ -1391,6 +1445,32 @@ async function runAgent(messages, callbacks, channel, signal, options) {
1391
1445
  })
1392
1446
  : null;
1393
1447
  if (!result.toolCalls.length) {
1448
+ const retryableHistoricalTools = historicalToolFailureRetryIssued
1449
+ ? []
1450
+ : historicalFailedToolNames.filter((name) => activeToolNames.has(name));
1451
+ const responseClaimsCurrentToolFailure = claimsCurrentToolFailure(messageContentText(msg.content));
1452
+ if (retryableHistoricalTools.length > 0 && responseClaimsCurrentToolFailure) {
1453
+ historicalToolFailureRetryIssued = true;
1454
+ streamCallbackBuffer?.discard();
1455
+ callbacks.onClearText?.();
1456
+ (0, runtime_1.emitNervesEvent)({
1457
+ level: "warn",
1458
+ component: "engine",
1459
+ event: "engine.historical_tool_failure_retry",
1460
+ message: "text-only response borrowed a historical failure for a currently advertised tool; retrying the exact repeated request",
1461
+ meta: {
1462
+ provider: providerRuntime.id,
1463
+ model: providerRuntime.model,
1464
+ toolNames: retryableHistoricalTools,
1465
+ },
1466
+ });
1467
+ pushGenerated(msg);
1468
+ messages.push({
1469
+ role: "user",
1470
+ content: `this exact request previously reached a tool that is advertised again now. The latest recorded result for ${retryableHistoricalTools.join(", ")} was a historical failure; that does not prove current unavailability. Re-evaluate whether the requested effect is still unsatisfied. If it is, call the currently advertised tool before reporting a current failure. Do not repeat an effect that already succeeded.`,
1471
+ });
1472
+ continue;
1473
+ }
1394
1474
  if (privateReturnTextAckRetryError) {
1395
1475
  streamCallbackBuffer?.discard();
1396
1476
  callbacks.onClearText?.();
@@ -136,9 +136,7 @@ function validTimestamp(value) {
136
136
  return Number.isFinite(time) ? new Date(time).toISOString() : null;
137
137
  }
138
138
  function liveSourceIdentityDigest(value) {
139
- const prefixedId = identifier(value, "server identity", 129);
140
- if (!/^[0-9a-f]{64}:[0-9a-f]{64}$/u.test(prefixedId))
141
- throw new unraid_client_1.UnraidClientError("invalid_response", "server identity is invalid");
139
+ const prefixedId = unraid_client_1.UnraidClient.assertPrefixedId(identifier(value, "server identity", 129));
142
140
  return (0, node_crypto_1.createHash)("sha256").update(prefixedId).digest("hex");
143
141
  }
144
142
  function createUnraidReadTools(client) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.757",
3
+ "version": "0.1.0-alpha.759",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.757",
9
+ "version": "0.1.0-alpha.759",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@azure/identity": "^4.13.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.757",
3
+ "version": "0.1.0-alpha.759",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },