@ouro.bot/cli 0.1.0-alpha.1038 → 0.1.0-alpha.1041

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,18 @@
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.1041",
6
+ "changes": [
7
+ "Renumber main above 1038: #1215 landed as 1033 after #1211's 1038, so installs would read main as older than it is"
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1033",
12
+ "changes": [
13
+ "Keep one result per tool call on replay; a duplicate (placeholder plus real result) made every later turn 400"
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1038",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1038",
2
+ "runtimeVersion": "0.1.0-alpha.1041",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1038</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1041</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -648,6 +648,9 @@ function repairSessionMessages(messages) {
648
648
  });
649
649
  return result.map(toProviderMessage);
650
650
  }
651
+ function isLostResultPlaceholder(content) {
652
+ return typeof content === "string" && content.startsWith("error: this tool call's result was lost");
653
+ }
651
654
  function repairToolCallSequences(messages, inlineReasoningStrippedCallIds = new Set()) {
652
655
  const normalized = messages.map(normalizeMessage);
653
656
  // Position-aware orphan detection. A tool result is orphaned if there is
@@ -679,6 +682,41 @@ function repairToolCallSequences(messages, inlineReasoningStrippedCallIds = new
679
682
  meta: { removed },
680
683
  });
681
684
  }
685
+ // One result per tool call. Parallel tool calls can leave a call answered twice (a "result was lost"
686
+ // placeholder written while it was still running, then its real result), and providers reject that with
687
+ // HTTP 400 on every replay. Keep the real result when there is one, else the first.
688
+ const duplicates = new Set();
689
+ for (let i = 0; i < repaired.length; i++) {
690
+ if (repaired[i].role !== "assistant")
691
+ continue;
692
+ const resultsById = new Map();
693
+ for (let j = i + 1; j < repaired.length && repaired[j].role !== "assistant" && repaired[j].role !== "user"; j++) {
694
+ const following = repaired[j];
695
+ if (following.role !== "tool")
696
+ continue;
697
+ const id = following.toolCallId;
698
+ resultsById.set(id, [...(resultsById.get(id) ?? []), j]);
699
+ }
700
+ for (const indices of resultsById.values()) {
701
+ if (indices.length < 2)
702
+ continue;
703
+ const keep = indices.find((j) => !isLostResultPlaceholder(repaired[j].content)) ?? indices[0];
704
+ for (const j of indices)
705
+ if (j !== keep)
706
+ duplicates.add(j);
707
+ }
708
+ }
709
+ if (duplicates.size > 0) {
710
+ (0, runtime_1.emitNervesEvent)({
711
+ level: "info",
712
+ event: "mind.session_duplicate_tool_result_repair",
713
+ component: "mind",
714
+ message: "kept one result per tool call; dropped duplicates that providers reject",
715
+ meta: { removed: duplicates.size },
716
+ });
717
+ for (const j of [...duplicates].sort((x, y) => y - x))
718
+ repaired.splice(j, 1);
719
+ }
682
720
  let injected = 0;
683
721
  for (let i = 0; i < repaired.length; i++) {
684
722
  const msg = repaired[i];
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1038",
3
+ "version": "0.1.0-alpha.1041",
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.1038",
9
+ "version": "0.1.0-alpha.1041",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.18",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1038",
3
+ "version": "0.1.0-alpha.1041",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },