teapot-coding-agent 0.19.0 → 0.19.1
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/agent.js +20 -19
- package/package.json +1 -1
- package/public/assets/{index-BZ402UD7.js → index-B7e29JKk.js} +10 -10
- package/public/assets/index-B7e29JKk.js.map +1 -0
- package/public/assets/{index-DdGEBXdF.css → index-BE_Iu8Yy.css} +1 -1
- package/public/assets/{shiki-BeMWgsGx.js → shiki-g5IhKfqD.js} +2 -2
- package/public/assets/{shiki-BeMWgsGx.js.map → shiki-g5IhKfqD.js.map} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-BZ402UD7.js.map +0 -1
package/dist/agent/agent.js
CHANGED
|
@@ -1378,11 +1378,22 @@ export class Agent {
|
|
|
1378
1378
|
// ledger stayed unsolved — it then re-sent a voluntary report_progress
|
|
1379
1379
|
// right after, and the timeline showed every requested report TWICE.
|
|
1380
1380
|
const res = await this.llmCall(this.buildMessages(), allToolSpecs());
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1381
|
+
const calls = res.message.tool_calls ?? [];
|
|
1382
|
+
// the assistant turn MUST enter history before its tool answers, or the
|
|
1383
|
+
// sequence [user, tool] is invalid and every later request 400s
|
|
1384
|
+
this.messages.push(res.message);
|
|
1385
|
+
await this.log.append("message", this.currentSession, this.currentBranch, {
|
|
1386
|
+
role: "assistant",
|
|
1387
|
+
content: res.message.content ?? "",
|
|
1388
|
+
reasoning: res.reasoning,
|
|
1389
|
+
...(calls.length ? { toolCalls: calls.map((c) => ({ id: c.id, name: c.function.name })) } : {}),
|
|
1390
|
+
progressEcho: true,
|
|
1391
|
+
});
|
|
1392
|
+
let reported = calls.some((c) => c.function.name === "report_progress");
|
|
1393
|
+
for (const call of calls) {
|
|
1394
|
+
if (call.function.name === "report_progress") {
|
|
1395
|
+
await this.recordProgress(call.function.arguments);
|
|
1396
|
+
}
|
|
1386
1397
|
this.messages.push({ role: "tool", tool_call_id: call.id, content: "progress recorded" });
|
|
1387
1398
|
// log both sides so restores replay the exact exchange (meta-style)
|
|
1388
1399
|
await this.log.append("tool_call", this.currentSession, this.currentBranch, {
|
|
@@ -1398,21 +1409,11 @@ export class Agent {
|
|
|
1398
1409
|
durationMs: 0,
|
|
1399
1410
|
result: "progress recorded",
|
|
1400
1411
|
});
|
|
1401
|
-
reported = true;
|
|
1402
1412
|
}
|
|
1403
|
-
if (!reported && (res.message.content ?? "").trim()) {
|
|
1404
|
-
//
|
|
1405
|
-
//
|
|
1406
|
-
|
|
1407
|
-
// filters marked rows out).
|
|
1408
|
-
await this.recordProgress(JSON.stringify({ freeform: res.message.content }));
|
|
1409
|
-
await this.log.append("message", this.currentSession, this.currentBranch, {
|
|
1410
|
-
role: "assistant",
|
|
1411
|
-
content: res.message.content ?? "",
|
|
1412
|
-
reasoning: res.reasoning,
|
|
1413
|
-
progressEcho: true,
|
|
1414
|
-
});
|
|
1415
|
-
this.messages.push(res.message);
|
|
1413
|
+
if (!reported && !(res.message.content ?? "").trim()) {
|
|
1414
|
+
// degenerate: neither a tool call nor prose — record a stub so the
|
|
1415
|
+
// operator sees SOMETHING at the requested moment
|
|
1416
|
+
await this.recordProgress(JSON.stringify({ freeform: "(no report produced)" }));
|
|
1416
1417
|
}
|
|
1417
1418
|
}
|
|
1418
1419
|
/* ---------- context compaction ---------- */
|