@agentsignalnet/claude-plugin 0.2.98 → 0.2.99

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentsignal",
3
3
  "displayName": "AgentSignal",
4
- "version": "0.2.98",
4
+ "version": "0.2.99",
5
5
  "description": "Page a human from inside Claude Code, or become an addressable agent that other agents can reach.",
6
6
  "author": {
7
7
  "name": "Data Group AI",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsignalnet/claude-plugin",
3
- "version": "0.2.98",
3
+ "version": "0.2.99",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -335,12 +335,42 @@ async function considerResponding(watched) {
335
335
  for (const message of spool.messages ?? []) {
336
336
  const verdict = mayRespond(message, { now, config, ledger, lockHeldBy, handled });
337
337
  if (!verdict.ok) {
338
- // Only the interesting refusals. "within_grace" and "already_handled"
339
- // are the system working and would drown the ledger they share with the
340
- // decisions somebody actually needs to read.
341
- if (!['disabled', 'within_grace', 'already_handled'].includes(verdict.why)) {
342
- recordResponder({ event: 'refused', at: now, why: verdict.why,
343
- delivery_id: message.delivery_id, peer: verdict.peer ?? null });
338
+ /*
339
+ Only the interesting refusals, and each of them ONCE.
340
+
341
+ "within_grace" and "already_handled" were excluded from the start
342
+ because they are the system working and would drown the decisions
343
+ somebody actually needs to read. That list was not enough. Two of the
344
+ remaining reasons are PERMANENT -- a message with no spool stamp will
345
+ never grow one, and `already_answered` is true forever by design --
346
+ so they were re-recorded every cycle for as long as the message sat
347
+ there. Measured on the machine this was written on: 1,447 refusals in
348
+ two hours, twelve a minute, one delivery refused 291 times, and a
349
+ ledger growing about a megabyte and a half a day that is re-read on
350
+ every cycle.
351
+
352
+ Excluding them outright would trade a flood for a silence -- the
353
+ first refusal is exactly the line somebody needs when they ask why a
354
+ message was never answered. So it is recorded once per delivery and
355
+ reason, and repeats are dropped. A reason that CHANGES still gets its
356
+ own line, because that is a different fact about the world.
357
+ */
358
+ const alreadySaid =
359
+ !['disabled', 'within_grace', 'already_handled'].includes(verdict.why) &&
360
+ ledger.some(
361
+ (e) =>
362
+ e.event === 'refused' &&
363
+ e.delivery_id === message.delivery_id &&
364
+ e.why === verdict.why,
365
+ );
366
+
367
+ if (!['disabled', 'within_grace', 'already_handled'].includes(verdict.why) && !alreadySaid) {
368
+ const entry = { event: 'refused', at: now, why: verdict.why,
369
+ delivery_id: message.delivery_id, peer: verdict.peer ?? null };
370
+ recordResponder(entry);
371
+ // Kept in the in-memory copy too, so a second message in this same
372
+ // pass cannot write the line this one just wrote.
373
+ ledger.push(entry);
344
374
  say(`responder declined ${message.delivery_id}: ${verdict.why}`);
345
375
  }
346
376
  continue;