jeopi-ai 16.7.1 → 16.7.2

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.7.2] - 2026-11-20
6
+
7
+ ### Fixed
8
+
9
+ - Detect when consecutive reads of the same file return identical text even if the requested page changes, while allowing reads that return new content.
10
+
5
11
  ## [16.7.1] - 2026-11-20
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "jeopi-ai",
4
- "version": "16.7.1",
4
+ "version": "16.7.2",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/akillness/jeopi",
7
7
  "author": "Can Boluk",
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@bufbuild/protobuf": "^2.12.0",
41
- "jeopi-catalog": "16.7.1",
42
- "jeopi-utils": "16.7.1",
43
- "jeopi-wire": "16.7.1",
41
+ "jeopi-catalog": "16.7.2",
42
+ "jeopi-utils": "16.7.2",
43
+ "jeopi-wire": "16.7.2",
44
44
  "arktype": "2.2.3",
45
45
  "zod": "^4"
46
46
  },
@@ -166,7 +166,6 @@ export class ToolCallLoopGuard {
166
166
  #threshold: number;
167
167
  #exemptTools: ReadonlySet<string>;
168
168
  #callStreaks = new Map<string, number>();
169
- #lastReadStartByPath = new Map<string, number>();
170
169
  #cycleWindowSize: number;
171
170
  #recentCalls: Array<{ hash: string; toolNames: string[] }> = [];
172
171
  #lastCycleSignature: string | undefined;
@@ -192,12 +191,11 @@ export class ToolCallLoopGuard {
192
191
 
193
192
  #reset(): void {
194
193
  this.#callStreaks.clear();
195
- this.#lastReadStartByPath.clear();
196
194
  this.#recentCalls = [];
197
195
  this.#lastCycleSignature = undefined;
198
196
  }
199
197
 
200
- #computeLookupKey(toolCall: ToolCall, canonicalArgs: string, nextReadStartByPath: Map<string, number>): string {
198
+ #computeLookupKey(toolCall: ToolCall, canonicalArgs: string, toolResults: readonly ToolResultMessage[]): string {
201
199
  const args =
202
200
  toolCall.arguments && typeof toolCall.arguments === "object" && !Array.isArray(toolCall.arguments)
203
201
  ? (toolCall.arguments as Record<string, unknown>)
@@ -217,12 +215,15 @@ export class ToolCallLoopGuard {
217
215
  if (toolCall.name === "read" && args) {
218
216
  const target = parseReadTarget(args);
219
217
  if (target) {
220
- const prevStart = this.#lastReadStartByPath.get(target.basePath);
221
- nextReadStartByPath.set(target.basePath, target.startLine);
222
- if (prevStart !== undefined && target.startLine > prevStart) {
223
- return `read:page:${target.basePath}:${target.startLine}`;
218
+ // A changing selector is only progress if the read actually returns new content.
219
+ const result = toolResults.find(candidate => candidate.toolCallId === toolCall.id);
220
+ if (result && !result.isError && result.content.every(block => block.type === "text")) {
221
+ const textParts = result.content.map(block => block.text);
222
+ if (textParts.some(text => text.trim().length > 0)) {
223
+ return `read:result:${target.basePath}:${Bun.hash(JSON.stringify(textParts))}`;
224
+ }
224
225
  }
225
- return `read:file:${target.basePath}`;
226
+ return `read:page:${target.basePath}:${target.startLine}`;
226
227
  }
227
228
  }
228
229
 
@@ -242,7 +243,6 @@ export class ToolCallLoopGuard {
242
243
  return null;
243
244
  }
244
245
 
245
- const nextReadStartByPath = new Map<string, number>(this.#lastReadStartByPath);
246
246
  const turnEntries: Array<{
247
247
  lookupKey: string;
248
248
  toolCall: ToolCall;
@@ -252,14 +252,12 @@ export class ToolCallLoopGuard {
252
252
 
253
253
  for (const toolCall of trackedCalls) {
254
254
  const canonicalArgs = JSON.stringify(canonicalizeToolCallValue(toolCall.arguments));
255
- const lookupKey = this.#computeLookupKey(toolCall, canonicalArgs, nextReadStartByPath);
255
+ const lookupKey = this.#computeLookupKey(toolCall, canonicalArgs, turn.toolResults);
256
256
  if (seenLookupKeys.has(lookupKey)) continue;
257
257
  seenLookupKeys.add(lookupKey);
258
258
  turnEntries.push({ lookupKey, toolCall, canonicalArgs });
259
259
  }
260
260
 
261
- this.#lastReadStartByPath = nextReadStartByPath;
262
-
263
261
  const nextStreaks = new Map<string, number>();
264
262
  let hitEntry: { toolCall: ToolCall; canonicalArgs: string; count: number } | undefined;
265
263