Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 285 --json
JSON
/christopher/abso-core/versions/285?format=json

abso news --stream (abso 690): read the ticket's expiry as the ISO time the server sends (staging 1418) as well as milliseconds. It printed 'within NaN seconds', and the stream mark that stands the hooks mod's poll down came out NaN, so the poll kept running. Found in the staging proof. Tests: client/test/news-stream.test.ts.

of shared·box-grants··Not checked

Version 284 · Files at version 285

3 files, 17 lines added, 4 removed.

--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -1003,7 +1003,7 @@
10031003 }
10041004
10051005 /** A ticket that opens this agent's news stream once, within a minute (abso 690; news-stream.ts). */
1006− newsTicket(): Promise<{ url: string; protocols: string[]; expiresAt: number }> {
1006+ newsTicket(): Promise<{ url: string; protocols: string[]; expiresAt: number | string }> {
10071007 return this.json("POST", this.agentPath("news/ticket"), {});
10081008 }
10091009
--- a/client/src/news-stream.ts
+++ b/client/src/news-stream.ts
@@ -15,9 +15,16 @@
1515export interface NewsTicket {
1616 readonly url: string;
1717 readonly protocols: readonly string[];
18− readonly expiresAt: number;
18+ /** When the ticket stops working: the server sends an ISO time; milliseconds are taken too. */
19+ readonly expiresAt: number | string;
1920}
2021
22+/** A ticket's expiry in milliseconds, whichever form the server sent; now when it can't be read. */
23+export function expiresAtMs(ticket: NewsTicket, now: number): number {
24+ const at = typeof ticket.expiresAt === "number" ? ticket.expiresAt : Date.parse(ticket.expiresAt);
25+ return Number.isFinite(at) ? at : now;
26+}
2128/** A Monitor lasts at most 30 minutes; the skill re-arms it when it ends. */
2229export const MONITOR_TIMEOUT_MS = 30 * 60_000;
2330
@@ -36,7 +43,7 @@
3643
3744/** The text --stream prints: the call to make, then the arguments as one line of JSON. */
3845export function streamText(ticket: NewsTicket, project: string, agent: string, now = Date.now()): string {
39− const seconds = Math.max(0, Math.round((ticket.expiresAt - now) / 1000));
46+ const seconds = Math.max(0, Math.round((expiresAtMs(ticket, now) - now) / 1000));
4047 return [
4148 `Open this with Monitor within ${seconds} seconds (the ticket opens ${agent}'s news stream once). When the Monitor ends or the socket closes, run abso news --stream again; the new socket sends what arrived in between.`,
4249 JSON.stringify(monitorArgs(ticket, project, agent)),
@@ -48,7 +55,7 @@
4855
4956/** How long --stream's mark holds: the Monitor's 30 minutes, and the minute the ticket waits to be used. */
5057export function streamMarkUntil(ticket: NewsTicket, now: number): number {
51− return Math.max(now, ticket.expiresAt) + MONITOR_TIMEOUT_MS;
58+ return Math.max(now, expiresAtMs(ticket, now)) + MONITOR_TIMEOUT_MS;
5259}
5360
5461/** The part of a WebSocket --follow uses: the platform's own, or a test's. */
--- a/client/test/news-stream.test.ts
+++ b/client/test/news-stream.test.ts
@@ -3,6 +3,7 @@
33import assert from "node:assert/strict";
44import { test } from "node:test";
55import {
6+ expiresAtMs,
67 type FollowDeps,
78 follow,
89 isRefusal,
@@ -41,6 +42,11 @@
4142 assert.match(text[0]!, /within 45 seconds/);
4243 assert.match(text[0]!, /run abso news --stream again/);
4344 assert.deepEqual(JSON.parse(text[1]!), args);
45+ // The server sends the expiry as an ISO time (staging 1418); the countdown and the stream mark read it the same.
46+ const iso = { ...ticket(1), expiresAt: new Date(NOW + 60_000).toISOString() };
47+ assert.match(streamText(iso, "abso", "fe", NOW + 15_000), /within 45 seconds/);
48+ assert.equal(streamMarkUntil(iso, NOW), NOW + 60_000 + MONITOR_TIMEOUT_MS);
49+ assert.equal(expiresAtMs({ ...ticket(1), expiresAt: "soon" }, NOW), NOW);
4450});
4551
4652test("a refusal close stops --follow; any other close opens again, waiting 1 s doubling to a minute", () => {