teapot-coding-agent 0.34.1 → 0.34.3

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.
@@ -977,8 +977,20 @@ export class Agent {
977
977
  return false;
978
978
  this.parkedByTool = true;
979
979
  this.preParkedStatus = { status: this.status, reason: this.statusReason };
980
- this.status = "idle";
981
- this.statusReason = `${reason} (idle — send a message to take over; resumes automatically when a sub-agent settles)`;
980
+ /**
981
+ * `waiting`, NOT `idle`.
982
+ *
983
+ * A parked loop is alive and will resume by itself, so showing "idle" contradicted the
984
+ * stop button beside it: the badge read idle while the header offered ■ stop, and the
985
+ * operator reasonably concluded the UI was broken. `live` was already true for exactly this
986
+ * reason (a parked tool counts as work in flight), so only the DISPLAYED status was wrong.
987
+ *
988
+ * The two park reasons are named separately because they mean different things to the
989
+ * operator: a `wait_children` park resumes when a sub-agent settles, and a background-shell
990
+ * park resumes when a `wait_children`/round-end wakes it.
991
+ */
992
+ this.status = "waiting";
993
+ this.statusReason = `${reason} — send a message to take over; resumes by itself`;
982
994
  bus.emit("update", { kind: "agent-update", agentId: this.opts.id });
983
995
  return true;
984
996
  }
@@ -1696,7 +1708,20 @@ export class Agent {
1696
1708
  snapshot() {
1697
1709
  return {
1698
1710
  id: this.opts.id,
1699
- status: this.status,
1711
+ /**
1712
+ * The DISPLAYED status, which must never contradict `live`.
1713
+ *
1714
+ * MEASURED report: "バックグラウンドbash待ちで finish_reason: stop でAIが止まると表示は
1715
+ * idle なのにコントロールは stop ボタンが表示されてて微妙" — and the same for
1716
+ * `wait_children`. `live` was already true for both (a parked tool and a running
1717
+ * background shell are work in flight, and stop() ends them), so only the badge was
1718
+ * wrong: it said idle while the header offered ■ stop.
1719
+ *
1720
+ * Rather than patch each site, the contradiction is fixed HERE: if there is work in
1721
+ * flight that stop would stop, the status says "waiting", never "idle". Callers that
1722
+ * need the raw state for logic use `live`, which is unchanged.
1723
+ */
1724
+ status: this.status === "idle" && this.isLive() ? "waiting" : this.status,
1700
1725
  statusReason: this.statusReason,
1701
1726
  /**
1702
1727
  * Is there work in flight that `stop` would actually stop?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.34.1",
3
+ "version": "0.34.3",
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",