teapot-coding-agent 0.14.5 → 0.14.7

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.
@@ -51,7 +51,10 @@ Session state is not injected into prompts — fetch it with tools instead:
51
51
  save_skill(name, description, content, files=[{name, content}]) so future
52
52
  sessions can load_skill them — helper scripts go through files and are made
53
53
  executable automatically.
54
- - When you make meaningful progress, call report_progress.
54
+ - When you make meaningful progress, call report_progress. Its output is
55
+ shown to the operator directly (rendered as markdown in the progress
56
+ panel) — do NOT also repeat the same content as a chat message; end the
57
+ turn right after the call (a short "reported." is fine).
55
58
  - Be frugal: prefer small precise edits, avoid runaway loops.`;
56
59
  export class Agent {
57
60
  log;
@@ -592,15 +595,22 @@ export class Agent {
592
595
  });
593
596
  }
594
597
  setStatus(s, reason = "") {
595
- if (this.status !== s) {
598
+ // Update the field FIRST. log.append fires onEvent synchronously, and the
599
+ // master's child-event hook wakes parked wait_children callers — those
600
+ // re-check agent.status at that instant. Updating after the append made
601
+ // every waiter observe the OLD status ("running"), conclude "someone is
602
+ // still working", and stay parked until timeout even though the child had
603
+ // just settled.
604
+ const prev = this.status;
605
+ this.status = s;
606
+ this.statusReason = reason;
607
+ if (prev !== s) {
596
608
  void this.log.append("state", this.currentSession, this.currentBranch, {
597
- from: this.status,
609
+ from: prev,
598
610
  to: s,
599
611
  reason,
600
612
  });
601
613
  }
602
- this.status = s;
603
- this.statusReason = reason;
604
614
  bus.emit("update", { kind: "agent-update", agentId: this.opts.id });
605
615
  }
606
616
  /** Main auto-run loop: turn -> tools -> turn ... -> done/idle/stop. */
@@ -1004,10 +1014,16 @@ export class Agent {
1004
1014
  this.messages.push({ role: "user", content: request });
1005
1015
  const res = await this.llmCall(this.buildMessages(), []); // no tools: pure report
1006
1016
  await this.recordProgress(JSON.stringify({ freeform: res.message.content }));
1017
+ // The report's content is ALREADY shown by the progress embed — logging a
1018
+ // plain assistant message with the same text made the timeline show every
1019
+ // requested report twice. Keep logging it (session restores replay the
1020
+ // exchange faithfully and rebuildMessages needs it) but mark it as an echo;
1021
+ // the web UI filters marked rows out.
1007
1022
  await this.log.append("message", this.currentSession, this.currentBranch, {
1008
1023
  role: "assistant",
1009
1024
  content: res.message.content ?? "",
1010
1025
  reasoning: res.reasoning,
1026
+ progressEcho: true,
1011
1027
  });
1012
1028
  this.messages.push(res.message);
1013
1029
  }
@@ -809,9 +809,13 @@ export const TOOLS = [
809
809
  // park VISIBLY: the UI shows idle ("waiting on sub-agents") instead of a
810
810
  // running spinner, and any user prompt / stop wakes us instantly
811
811
  ctx.onIdlePark?.(`waiting on sub-agent${ids?.length === 1 ? ` ${ids[0]}` : "s"}`);
812
+ // the child's report is about to land in our mailbox — a progress report
813
+ // right after it would be pure noise, so re-arm the gate here
814
+ ctx.onProgressGateReset?.();
812
815
  try {
813
816
  const r = await sa.wait(ids, ms);
814
817
  ctx.onIdleUnpark?.();
818
+ ctx.onProgressGateReset?.(); // also after: waiting itself isn't "activity"
815
819
  return { ok: true, result: r.note };
816
820
  }
817
821
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.14.5",
3
+ "version": "0.14.7",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",