abso-hooks mod: ask for news every 5 minutes, not 30 seconds, and not at all in a chat with no tool call for 10 minutes (its next tool call starts it again). Prod abso's object reset under the load of every chat asking every 30 seconds (Agent VCS, 5:10 PM CT). abso announce says so. Tests: node client/test-mods.ts. Version 272 of shared· box-grants· Oct 15 (2026-10-15 22:07 UTC) · Not checked
Version 271 · Files at version 272
3 files, 41 lines added, 11 removed.
--- a/client/hooks/register.test.ts
+++ b/client/hooks/register.test.ts
@@ -40,15 +40,17 @@
40 40 appended.push((e.message.content as { text: string }[])[0]!.text); 43 + // Tools the chat calls run as asked. 44 + on("tool.call", () => ({ result: { isError: false, text: "ok" } }) as never); 43 45 return { clock, asked, auth, clients, appended, written }; 46 − test("the news poll asks every 30 seconds in an abso folder, and keeps each item once", async ($, on) => {
48 + test("the news poll asks every 5 minutes in an abso folder, and keeps each item once", async ($, on) => { 47 49 // The kit has no conversation to append to, so the append itself is checked in a live session (#25); 48 50 // here: the poll's timing, the call, and the news log the view mod reads. 49 51 const w = world(on, true, [["Announcement from lead: stop pushing until v12 lands"], []]); 50 52 await $.session.start({ cwd: "/w/p" }); 51 − await w.clock.advance(29_000);
53 + await w.clock.advance(299_000); 52 54 expect(w.asked).toEqual([]); 53 55 await w.clock.advance(1_000); 54 56 expect(w.asked).toEqual(["https://avcs.test/p/p/a/bob/news"]); @@ -56,7 +58,8 @@
56 58 expect(w.auth[0]).toBe("none"); 57 59 // Which mod asked: avcs-mod/<version> once installed, avcs-mod/checkout from a checkout (#29). 58 60 expect(w.clients[0]).toMatch(/^avcs-mod\/(checkout|\d+\.\d+\.\d+(\+[\w.]+)?)$/); 59 − await w.clock.advance(30_000);
61 + await $.tool.call({ tool: "Bash", command: "ls" } as never); 62 + await w.clock.advance(300_000); 60 63 expect(w.asked).toHaveLength(2); 61 64 const log = w.written.get("/w/p/.abso/news.log") ?? ""; 62 65 expect(log.split("\n").filter((l) => l.includes("Announcement from lead"))).toHaveLength(1); @@ -64,14 +67,28 @@
65 68 test("while the seat holds its news stream (abso 690), the poll stands down, and asks again once the mark runs out", async ($, on) => { 66 69 const w = world(on, true, [[], []]); 67 − w.written.set("/w/p/.abso/news-stream.json", JSON.stringify({ until: 1_000_000 + 95_000 }));
70 + w.written.set("/w/p/.abso/news-stream.json", JSON.stringify({ until: 1_000_000 + 400_000 })); 68 71 await $.session.start({ cwd: "/w/p" }); 69 − await w.clock.advance(90_000);
72 + await w.clock.advance(300_000); 70 73 expect(w.asked).toEqual([]); 71 − await w.clock.advance(30_000);
74 + await $.tool.call({ tool: "Bash", command: "ls" } as never); 75 + await w.clock.advance(300_000); 72 76 expect(w.asked).toEqual(["https://avcs.test/p/p/a/bob/news"]); 79 + test("a chat with no tool call for 10 minutes stops asking for news; its next tool call starts it again", async ($, on) => { 80 + const w = world(on, true, [[], [], []]); 81 + await $.session.start({ cwd: "/w/p" }); 82 + await w.clock.advance(300_000); 83 + expect(w.asked).toHaveLength(1); 84 + // Idle since the start: at 10 and 15 minutes it doesn't ask. 85 + await w.clock.advance(600_000); 86 + expect(w.asked).toHaveLength(1); 87 + await $.tool.call({ tool: "Read", file_path: "/w/p/a.ts" } as never); 88 + await w.clock.advance(300_000); 89 + expect(w.asked).toHaveLength(2); 75 92 test("outside an abso folder it never asks", async ($, on) => { 76 93 const w = world(on, false, [["should not arrive"]]); 77 94 await $.session.start({ cwd: "/w/p" }); @@ -85,7 +102,6 @@
85 102 w.written.set("/w/p/.abso/known/fuzz.ts", "one\ntwo\nthree\n"); 86 103 w.written.set("/w/p/fuzz.ts", "one\ntwo\nth\u0000ree\n"); 87 104 on("fs.stat", () => ({ value: { realPath: "/w/p/fuzz.ts" } }) as never); 88 − on("tool.call", () => ({ result: { isError: false, text: "ok" } }) as never);
89 105 on("session.id", () => ({ value: "sess" })); 90 106 await $.session.start({ cwd: "/w/p" }); 91 107 await $.tool.call({ --- a/client/hooks/register.ts
+++ b/client/hooks/register.ts
@@ -89,8 +89,15 @@
89 89 let draining = false; 91 91 const roots = new Map<string, { root: string | undefined; at: number }>(); 92 − /** How often to ask for news without an edit (announcements reach an agent that isn't editing). */
93 − const NEWS_POLL_MS = 30_000;
93 + * How often to ask for news without an edit (announcements reach an agent that isn't editing). Every 5 minutes, and 94 + * not at all in a chat that has made no tool call for IDLE_MS: prod abso's object reset under the load of every chat 95 + * asking every 30 seconds (2026-10-15). abso news --stream (abso 690) wakes a chat without asking. 97 + const NEWS_POLL_MS = 5 * 60_000; 98 + const IDLE_MS = 10 * 60_000; 99 + /** When this chat last made a tool call (or started). */ 94 101 /** The abso folder this chat works in: the session's folder, or the first edited file's. */ 95 102 let newsRoot: string | undefined; 96 103 let polling = false; @@ -108,8 +115,10 @@
109 116 // Outside an abso folder each tick only reads a variable. 110 117 newsRoot = await findRoot($, `${slash(await $.session.cwd())}/.`).catch(() => undefined); 111 − $.clock.every(NEWS_POLL_MS, () => {
118 + activeAt = await $.clock.now(); 119 + $.clock.every(NEWS_POLL_MS, async () => { 112 120 if (polling || newsRoot === undefined) return; 121 + if ((await $.clock.now()) - activeAt >= IDLE_MS) return; 114 123 void pollNews($, newsRoot).finally(() => { @@ -118,6 +127,11 @@
130 + on("tool.call", async ($, e, next) => { 131 + activeAt = await $.clock.now(); 121 135 on("tool.call", { tool: TOOLS }, async ($, e, next) => { 122 136 const ran = await next(e); --- a/client/src/announce.ts
+++ b/client/src/announce.ts
@@ -28,7 +28,7 @@
28 28 const answer = await api.announce(text, to); 29 29 const who = answer.to.length === 0 ? "nobody (no other agents yet)" : answer.to.join(", "); 31 − text: `Announced to ${who}. Each gets it once, as news on their next edit, or within about 30 seconds where the abso mod runs.`,
31 + text: `Announced to ${who}. Each gets it once, as news on their next edit, within about 5 minutes in a working chat where the abso mod runs, or at once where it holds its news stream.`, 32 32 json: { id: answer.id, to: answer.to },