kiosapi 0.1.22 → 0.1.23
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/agent/run.js +10 -1
- package/package.json +1 -1
package/dist/agent/run.js
CHANGED
|
@@ -567,8 +567,17 @@ export async function runTurn(s, userText) {
|
|
|
567
567
|
? `${result.output.slice(0, MAX_STORED_RESULT)}\n…[dipotong — gunakan baca_file(path, baris_lanjutan) untuk membaca sisa file]`
|
|
568
568
|
: result.output;
|
|
569
569
|
s.messages.push({ role: 'tool', content: stored, tool_call_id: call.id });
|
|
570
|
-
if (result.modifiedPath)
|
|
570
|
+
if (result.modifiedPath) {
|
|
571
571
|
stepModified.add(result.modifiedPath);
|
|
572
|
+
// Invalidate cached reads for the modified file so the model can verify
|
|
573
|
+
// its own edits without getting stale content or spurious loop warnings.
|
|
574
|
+
for (const cacheSig of [...toolCache.keys()]) {
|
|
575
|
+
if (cacheSig.includes(result.modifiedPath)) {
|
|
576
|
+
toolCache.delete(cacheSig);
|
|
577
|
+
callCounts.delete(cacheSig);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
572
581
|
if (READ_ONLY_TOOLS.has(call.function.name))
|
|
573
582
|
toolCache.set(sig, stored);
|
|
574
583
|
if (result.done) {
|