teapot-coding-agent 0.37.193 → 0.37.194
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/master.js +26 -3
- package/package.json +1 -1
- package/public/assets/index-BQyZ_d2Q.js +190 -0
- package/public/assets/index-BQyZ_d2Q.js.map +1 -0
- package/public/assets/{index-CKhsrErp.css → index-tONy0KwE.css} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-ehAVu0Z_.js +0 -190
- package/public/assets/index-ehAVu0Z_.js.map +0 -1
package/dist/master.js
CHANGED
|
@@ -263,6 +263,15 @@ export class Master {
|
|
|
263
263
|
tasks = [];
|
|
264
264
|
childWaiters = new Map();
|
|
265
265
|
reportedRunning = new Set();
|
|
266
|
+
/**
|
|
267
|
+
* Children that have already delivered a final report.
|
|
268
|
+
*
|
|
269
|
+
* `finish` logs its final message BEFORE the loop ends and the status turns `idle`, so by the time
|
|
270
|
+
* `onControlStatusChange` sees `idle` the parent has the result. Announcing "idle without having called finish()" on top
|
|
271
|
+
* of it is a contradiction the parent cannot resolve. Cleared when the child starts a new task, so a later silent exit is
|
|
272
|
+
* still reported.
|
|
273
|
+
*/
|
|
274
|
+
finishedChildren = new Set();
|
|
266
275
|
startedAt = Date.now();
|
|
267
276
|
config;
|
|
268
277
|
configPath;
|
|
@@ -743,9 +752,17 @@ export class Master {
|
|
|
743
752
|
bus.emit("update", { kind: "event", agentId: e.agent, event: e });
|
|
744
753
|
this.onChildEvent(ac, e);
|
|
745
754
|
};
|
|
746
|
-
agent.onControlStatusChange = (
|
|
755
|
+
agent.onControlStatusChange = (_agentId, status) => {
|
|
747
756
|
if (!ac.parent)
|
|
748
757
|
return;
|
|
758
|
+
/**
|
|
759
|
+
* The id comes from the closure, not from the callback argument.
|
|
760
|
+
*
|
|
761
|
+
* `Agent.setStatus` passes `this.opts.id`, which the master does not set, so the argument is `undefined` — the note
|
|
762
|
+
* said "@undefined is now idle" and the reported/finished bookkeeping below keyed on `undefined`, which made every
|
|
763
|
+
* child share one entry.
|
|
764
|
+
*/
|
|
765
|
+
const agentId = ac.id;
|
|
749
766
|
const parent = this.agents.get(ac.parent);
|
|
750
767
|
if (!parent)
|
|
751
768
|
return;
|
|
@@ -758,13 +775,18 @@ export class Master {
|
|
|
758
775
|
* "サブエージェントがエラー落ちしたときの親への通知がびみょい" (#245). The generic note exists for statuses that have
|
|
759
776
|
* no event of their own (`idle`, `stopped`, `waiting`).
|
|
760
777
|
*/
|
|
761
|
-
if (this.reportedRunning.has(agentId) &&
|
|
778
|
+
if (this.reportedRunning.has(agentId) &&
|
|
779
|
+
SETTLED.has(status) &&
|
|
780
|
+
status !== "error" &&
|
|
781
|
+
!this.finishedChildren.has(agentId))
|
|
762
782
|
parent.enqueuePrompt(`[harness] Sub-agent @${agentId} is now ${status} without having called finish(), so it has not reported a result.` +
|
|
763
783
|
(status === "stopped"
|
|
764
784
|
? ` It may have been stopped mid-task; message it to resume, or re-spawn it.`
|
|
765
785
|
: ` If you expected a result, message it or re-spawn it.`), "harness");
|
|
766
|
-
if (status === "running")
|
|
786
|
+
if (status === "running") {
|
|
767
787
|
this.reportedRunning.add(agentId);
|
|
788
|
+
this.finishedChildren.delete(agentId);
|
|
789
|
+
}
|
|
768
790
|
else if (SETTLED.has(status))
|
|
769
791
|
this.reportedRunning.delete(agentId);
|
|
770
792
|
};
|
|
@@ -1044,6 +1066,7 @@ When this task is done (or truly blocked), call finish() with a summary for @${p
|
|
|
1044
1066
|
if (!parent)
|
|
1045
1067
|
return;
|
|
1046
1068
|
if (e.type === "message" && e.data.final) {
|
|
1069
|
+
this.finishedChildren.add(ac.id);
|
|
1047
1070
|
const d = e.data;
|
|
1048
1071
|
const summary = String(d.content ?? "").trim();
|
|
1049
1072
|
let report = summary;
|