pi-roundtable 0.53.1 → 0.53.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.53.2] - 2026-11-19
9
+
10
+ ### Changed
11
+
12
+ - Messages between an agent and its own temp knights no longer count toward the cap of 8 agent messages without the owner in between: the parent's `message_agent` to its temp knight, and the temp knight's to its parent, count on their own, toward a cap of 40 (`MAX_HELPER_MESSAGES`) that only stops the two writing to each other forever. The cap of 8 still holds for messages between independent agents, in the same run.
13
+
8
14
  ## [0.53.1] - 2026-11-18
9
15
 
10
16
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-roundtable",
3
- "version": "0.53.1",
3
+ "version": "0.53.2",
4
4
  "description": "A plugin-driven Pi agent server for one owner, reached through Discord or the web",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -19,6 +19,7 @@ import {
19
19
  agentReplyText,
20
20
  chainLimitReason,
21
21
  deliveredMessagePost,
22
+ helperChainLimitReason,
22
23
  } from "./agent-prompt.ts";
23
24
  import { answersTo } from "./agent-rules.ts";
24
25
  import type { Agent } from "./agent-store.ts";
@@ -26,6 +27,7 @@ import { conversationLabel, messageTarget } from "./message-target.ts";
26
27
  import {
27
28
  type Chain,
28
29
  MAX_CHAIN_MESSAGES,
30
+ MAX_HELPER_MESSAGES,
29
31
  type TurnHost,
30
32
  } from "./team-turn-types.ts";
31
33
 
@@ -77,7 +79,16 @@ export class AgentMessages {
77
79
  throw new AgentError(
78
80
  "message_agent can only be used during an agent turn.",
79
81
  );
80
- if (chain.messages >= MAX_CHAIN_MESSAGES)
82
+ // Between an agent and its own temp knight the run is one agent's work, so it does not count
83
+ // toward the chain cap; a higher cap of its own only stops the two writing to each other forever.
84
+ const kin = target.parent === caller.name || sender.parent === target.name;
85
+ if (kin && (chain.helperMessages ?? 0) >= MAX_HELPER_MESSAGES)
86
+ throw new AgentError(
87
+ helperChainLimitReason(
88
+ addressee(chain.speaker, this.#host.options.owner),
89
+ ),
90
+ );
91
+ if (!kin && chain.messages >= MAX_CHAIN_MESSAGES)
81
92
  throw new AgentError(
82
93
  chainLimitReason(addressee(chain.speaker, this.#host.options.owner)),
83
94
  );
@@ -87,7 +98,8 @@ export class AgentMessages {
87
98
  throw new AgentError(
88
99
  `"${target.name}" is a temp knight of "${target.parent}" and answers only the conversation that made it; ask "${target.parent}" there.`,
89
100
  );
90
- chain.messages += 1;
101
+ if (kin) chain.helperMessages = (chain.helperMessages ?? 0) + 1;
102
+ else chain.messages += 1;
91
103
  // A temp knight is working from the moment a message is handed to it until it has answered.
92
104
  this.#host.helpers.begin(target.name);
93
105
  // The request shows in the sender's turn channel as a small card under the sender's name.
@@ -190,6 +190,12 @@ export function chainLimitReason(who: OwnerIdentity): string {
190
190
  return `This chain of agent messages has reached 8 messages without ${o.name} in between, so it is stopped. Tell ${o.him} what was done and ask whether to continue.`;
191
191
  }
192
192
 
193
+ /** Why a parent and its own temp knights stop writing to each other without the owner in between. */
194
+ export function helperChainLimitReason(who: OwnerIdentity): string {
195
+ const o = ownerWords(who);
196
+ return `You and your temp knights have sent each other 40 messages without ${o.name} in between, so this is stopped. Tell ${o.him} what was done and ask whether to continue.`;
197
+ }
198
+
193
199
  /**
194
200
  * Where a turn's conversation is: the surface of the turn's conversation (`home`: the agent's own
195
201
  * channel or room, or the group's in a group round), named by its `label`, and the other surfaces the agents have places on:
@@ -25,11 +25,18 @@ import type { TeamPlaces } from "./team-places.ts";
25
25
 
26
26
  /** Agent messages without an owner message in between (spec behavior 13). */
27
27
  export const MAX_CHAIN_MESSAGES = 8;
28
+ /**
29
+ * Messages between an agent and its own temp knights in one run, which `MAX_CHAIN_MESSAGES` does
30
+ * not count; this higher cap only stops a parent and its temp knight writing to each other forever.
31
+ */
32
+ export const MAX_HELPER_MESSAGES = 40;
28
33
  export const BACKLOG_LIMIT = 40;
29
34
 
30
35
  /** A run of agent messages started by one owner message, schedule, or report. */
31
36
  export interface Chain {
32
37
  messages: number;
38
+ /** Messages between an agent and its own temp knights, counted apart from `messages`. */
39
+ helperMessages?: number;
33
40
  /** Whoever started the run; the agents it wakes work for the same person. */
34
41
  speaker: Speaker;
35
42
  }