omnius 1.0.539 → 1.0.540

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.js CHANGED
@@ -594320,12 +594320,13 @@ ${blob}
594320
594320
  this._readCoverage.set(iv.key, pruned.slice(0, 8));
594321
594321
  }
594322
594322
  _dedupeToolCallsForResponse(toolCalls, turn) {
594323
- if (toolCalls.length <= 1)
594324
- return toolCalls;
594323
+ const idDeduped = this._dedupeRepeatedToolCallIdsForResponse(toolCalls, turn);
594324
+ if (idDeduped.length <= 1)
594325
+ return idDeduped;
594325
594326
  const seen = /* @__PURE__ */ new Set();
594326
594327
  const deduped = [];
594327
594328
  let dropped = 0;
594328
- for (const tc of toolCalls) {
594329
+ for (const tc of idDeduped) {
594329
594330
  const fp = this._buildToolFingerprint(tc.name, tc.arguments ?? {});
594330
594331
  if (seen.has(fp)) {
594331
594332
  dropped++;
@@ -594343,6 +594344,36 @@ ${blob}
594343
594344
  }
594344
594345
  return deduped;
594345
594346
  }
594347
+ /**
594348
+ * A provider must never reuse a tool-call ID in one assistant response.
594349
+ * Keep the first occurrence as the canonical call and drop later copies
594350
+ * before either execution or transcript construction. This is deliberately
594351
+ * narrower than fingerprint dedupe: the brute-force loop must still permit
594352
+ * legitimate fresh reads that use distinct call IDs.
594353
+ */
594354
+ _dedupeRepeatedToolCallIdsForResponse(toolCalls, turn) {
594355
+ if (toolCalls.length <= 1)
594356
+ return toolCalls;
594357
+ const seenIds = /* @__PURE__ */ new Set();
594358
+ const deduped = [];
594359
+ let dropped = 0;
594360
+ for (const tc of toolCalls) {
594361
+ if (seenIds.has(tc.id)) {
594362
+ dropped++;
594363
+ continue;
594364
+ }
594365
+ seenIds.add(tc.id);
594366
+ deduped.push(tc);
594367
+ }
594368
+ if (dropped > 0) {
594369
+ this.emit({
594370
+ type: "status",
594371
+ content: `Response ID dedupe: dropped ${dropped} repeated tool call ID${dropped === 1 ? "" : "s"} before execution (turn ${turn})`,
594372
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
594373
+ });
594374
+ }
594375
+ return deduped;
594376
+ }
594346
594377
  _decodeToolFingerprint(fingerprint) {
594347
594378
  const colonIdx = fingerprint.indexOf(":");
594348
594379
  const toolName = colonIdx > 0 ? fingerprint.slice(0, colonIdx) : fingerprint;
@@ -602249,7 +602280,7 @@ ${this.options.maxTurns && this.options.maxTurns > 0 ? `You have ${this.options.
602249
602280
  if (msg.toolCalls && msg.toolCalls.length > 0) {
602250
602281
  consecutiveTextOnly = 0;
602251
602282
  consecutiveThinkOnly = 0;
602252
- msg.toolCalls = msg.toolCalls;
602283
+ msg.toolCalls = this._dedupeRepeatedToolCallIdsForResponse(msg.toolCalls, turn);
602253
602284
  if (msg.toolCalls.length === 0) {
602254
602285
  messages2.push({
602255
602286
  role: "system",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.539",
3
+ "version": "1.0.540",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.539",
9
+ "version": "1.0.540",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.539",
3
+ "version": "1.0.540",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",