Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Hand-offs: work parked on the person gets a reminder and a limit

Milind Soni7dd032b8d7ac
diff --git a/docs/runtime-contract.md b/docs/runtime-contract.md
index c2ae842fef..5e8bd14e54 100644
--- a/docs/runtime-contract.md
+++ b/docs/runtime-contract.md
@@ -30,7 +30,7 @@ Storage: SQLite (`node:sqlite`, like `messages.db`) in `DATA_DIR/runtime.db`: `a
queued ──admit──> running ──turn ends──> completed | failed | cancelled
│ └──handed out work──> waiting ──all children settled, or a child's new question──> resume ──> running
└──question for the person──> needs_input ──answer──> running
- (or, at Full access, its requester) └──wait expires (only a host's finite inputWaitMs)──> failed(expired)
+ (or, at Full access, its requester) └──wait expires (handed-off work, a host's finite inputWaitMs)──> failed(expired)
```
- **Enqueue** checks the parent is running (or there is no parent), refuses work back to an ancestor (one exception, `ownThread` in `server/runtime/tree.ts`: a direct conversation may hand work to a new thread of its own bot, which `start_thread`'s `report_back` uses; only the requesting turn is passed over, never a conversation already in the chain, so that thread cannot open another of its own), dedupes (same brief, same assignee, same parent, unless `rework`), checks depth and the root's budgets, computes the level, writes the row with event `enqueued`. Refusals return a typed reason; they never throw into a turn.
@@ -69,7 +69,7 @@ Model-written fields that imitate the envelope's opening marker are escaped. The
## 5. One restart policy
-Downtime is nobody's budget: every window restarts at boot. At open, before anything is dispatched:
+Downtime is nobody's budget: every window but the wait on the person restarts at boot. At open, before anything is dispatched:
| State at shutdown | What happens |
|---|---|
@@ -88,9 +88,9 @@ What a cut turn did outward is the host's knowledge, read through the optional p
Three budgets per root, counted since the root's last durable progress (a settlement, a completed turn): `requests`, `executions`, `wakes`. Progress renews them; nothing else does. The owed follow-up turn of a node whose children all settled is never refused for budget.
-Three clocks and no others: a queue bound (`queueMs`, expired means `failed(expired)`, "never started"); a per-root stall window on durable progress (`stallMs`, fails the tree); a per-turn activity window (`turnStallMs`, on the monotonic clock, so a laptop sleep is not a stall; a tool visibly in flight counts as activity through `progress()`). Time spent parked on the person is charged to no window. A wait on the person's words is bounded by `inputWaitMs`, which is infinite unless a host sets it: a question waits for the person however long they take. Where a host sets it, expiry is `failed(expired)`: not run, not refused, never reported as approved.
+Three clocks and no others: a queue bound (`queueMs`, expired means `failed(expired)`, "never started"); a per-root stall window on durable progress (`stallMs`, fails the tree); a per-turn activity window (`turnStallMs`, on the monotonic clock, so a laptop sleep is not a stall; a tool visibly in flight counts as activity through `progress()`). Time spent parked on the person is charged to no window. Handed-off work parked on the person, on words or on cards, is bounded by `inputWaitMs` on the wall clock, restarts included, since a window each boot reopened would never close on a host that restarts. It is infinite unless a host sets it; OpenMausBot sets three days. `inputRemindMs` (one day here) reminds the person once, and the rest of the window always follows that reminder. Expiry is `failed(expired)`: not run, not refused, never reported as approved.
-Waiting never expires where nothing of the runtime's is held: a node parked on the person's **cards** has no clock at all (the answer, however late, resumes it; a non-finite `inputWaitMs` makes every wait on the person like that), and a node **queued to continue** in place (a seat the host holds it for) is bounded by neither `queueMs` nor the tree's stall window; the only bound on a computer wait is the host's own person-hold rule.
+Waiting never expires where nothing of the runtime's is held: a root parked on the person's **cards** has no clock at all (the answer, however late, resumes it, and no requester waits on it; a non-finite `inputWaitMs` makes every wait on the person like that), and a node **queued to continue** in place (a seat the host holds it for) is bounded by neither `queueMs` nor the tree's stall window; the only bound on a computer wait is the host's own person-hold rule.
Two loop guards bound a node that continues in place, read from the evidence of its continuing executions (`TurnEvidence.okToolCalls`, `errors`) and kept on the row (`guard`): after two consecutive continuations with no successful tool call, or when the last three error texts across continuing executions are identical, the node ends `failed(stalled)` instead of continuing (event `stalled` "no progress: …", then the settlement). A continuation whose evidence names no ok count is progress-unknown and counts neither way; a turn that ends any other way (parks, waits, settles) clears the guard. The executions budget stays as the backstop.
diff --git a/server/coordinator.ts b/server/coordinator.ts
index 9070b79f0f..d60d135ed2 100644
--- a/server/coordinator.ts
+++ b/server/coordinator.ts
@@ -144,6 +144,8 @@ export interface CoordinatorHost {
names(node: HandoffView, parent?: HandoffView): EnvelopeNames;
/** `restored` shows the question again only if the first showing never happened; a root parked on its own cards shows nothing more. */
park(node: HandoffView, question: string, restored?: boolean): void;
+ /** Handed-off work has waited a day on the person; it closes at `closesAt` if nobody answers. Called once for each wait. */
+ remind?(node: HandoffView, closesAt: number): void;
/** The level the target thread will really run with, so the envelope states the truth, and, when that came down a Chief's
* chain, the Chief conversation's level. A Chief's level flows into a room with the hand-off, never onto the shared thread,
* so it resolves from `source`, the requester's node, whose parents lead up the chain. */
diff --git a/server/host/ask-cards.test.ts b/server/host/ask-cards.test.ts
index 538a5e42be..267a4e3c5d 100644
--- a/server/host/ask-cards.test.ts
+++ b/server/host/ask-cards.test.ts
@@ -57,6 +57,7 @@ function world(options: { inboxThread?: string; live?: string[] } = {}) {
return { ok: true as const };
}),
answeredIn: (threadId, requestId) => (threadId === "inbox" && requestId.startsWith("req") ? "work" : threadId),
+ now: () => 0,
answerNode: (id, text) => {
const parked = nodes.get(id);
if (!parked || parked.status !== "waiting") return false;
@@ -361,6 +362,28 @@ describe("a typed line answers a question card", () => {
});
});
+describe("a reminder of work parked on the person", () => {
+ const closesAt = 2 * 24 * 60 * 60_000;
+
+ it("names the question and when it closes, and adds no second row", () => {
+ const w = world();
+ const node = w.node({ status: "waiting", question: "Which region?\nDefault: eu-west" });
+ w.cards.remind(node, closesAt);
+ expect(w.notified).toHaveLength(1);
+ expect(w.notified[0]).toMatchObject({ kind: "question", botId: "ledger", threadId: "work", body: expect.stringContaining("Which region?") });
+ expect(w.notified[0]!.body).toContain("2 days");
+ expect(w.notified[0]!.body).not.toContain("eu-west");
+ expect(w.rows("work")).toEqual([]);
+ });
+
+ it("does not read a card's internal wait description to the person", () => {
+ const w = world();
+ w.cards.remind(w.node({ status: "waiting", question: "Waiting on the person: provide API key", cards: ["m1"] }), closesAt);
+ expect(w.notified[0]!.body).not.toContain("Waiting on the person");
+ expect(w.notified[0]!.body).toContain("2 days");
+ });
+});
+
describe("the chip in the conversation that handed the work on", () => {
const asker = { id: "ledger", name: "Ledger", color: "teal" } as BotRecord;
diff --git a/server/host/ask-cards.ts b/server/host/ask-cards.ts
index 89cd0ca693..264b7f8845 100644
--- a/server/host/ask-cards.ts
+++ b/server/host/ask-cards.ts
@@ -16,10 +16,11 @@ import { isStopCommand } from "../room-holds.ts";
import { needsInputQuestion } from "../runtime-coordinator.ts";
import { withDefault } from "../runtime/questions.ts";
import type { BotRecord, Message, Store } from "../store.ts";
-import { conversationLanguage } from "../server-lines.ts";
+import { conversationLanguage, serverLine } from "../server-lines.ts";
import { settledWaitingChip } from "../waiting-on-person.ts";
const OPEN_QUESTION = "needs-input-";
+const DAY_MS = 24 * 60 * 60_000;
const NEEDS_INPUT_LINE = /^needs input:/i;
export interface AskCardsDeps {
@@ -39,6 +40,7 @@ export interface AskCardsDeps {
answerCard(input: { auth: RequestAuth; threadId: string; requestId: string; behavior: "answer"; message: string }): Promise<{ ok: true } | { ok: false; status: number; error: string }>;
/** The conversation a card in `threadId` was asked in: an inbox copy's original. */
answeredIn(threadId: string, requestId: string): string;
+ now?: () => number;
}
/** The name a bot's model calls its question tool by: its engine's, unless the bot's tool selection leaves it out. The
@@ -73,6 +75,7 @@ const ownQuestionCard = (message: Message): boolean =>
export function createAskCards(deps: AskCardsDeps) {
const { store, delegatorOf, notify } = deps;
+ const now = deps.now ?? Date.now;
const waitingOnPersonChips = new Map<string, { threadId: string; messageId: string; name: string; kind: string }>();
function showWaitingOnPersonChip(threadId: string, requestId: string, asker: BotRecord, kind: "approval" | "answer") {
@@ -170,6 +173,21 @@ export function createAskCards(deps: AskCardsDeps) {
{ avatarUrl: bot.avatarUrl, ...(room ? { group: { id: room.id, name: room.name } } : {}) }));
}
+ /** Work handed on has waited a day on the person: one notification says what it needs and when it closes. Its open card
+ * is already its row in the inbox, so nothing is added there. */
+ function remind(node: HandoffView, closesAt: number): void {
+ const bot = store.bot(node.botId);
+ if (!bot) return;
+ const days = Math.max(1, Math.ceil((closesAt - now()) / DAY_MS));
+ const language = conversationLanguage(node.threadId);
+ const room = node.groupId ? store.group(node.groupId) : undefined;
+ const body = node.cards?.length ? serverLine(language, "server.teammates.stillWaitingCard", { days })
+ : serverLine(language, "server.teammates.stillWaiting", { days, question: withDefault(node.question ?? "").question.slice(0, 180) });
+ notify(buildNotification("question", bot, node.threadId, body, { avatarUrl: bot.avatarUrl, ...(room ? { group: { id: room.id, name: room.name } } : {}) }));
+ if (room) store.patchGroup(room.id, { unread: true });
+ else store.patchTask(bot.id, node.threadId, { unread: true });
+ }
+
/** A question its requester decided, or that went on with its asker's default: its card says what was picked, and by
* whom; the person can still change it. */
function decided(node: HandoffView, answerer: string): void {
@@ -259,5 +277,5 @@ export function createAskCards(deps: AskCardsDeps) {
questionCard({ id: `${botId}-${turnId}`, threadId, botId, executions: 1, createdAt: reply.at, startedAt: reply.at } as HandoffView, question);
}
- return { park, decided, closed, askedAgain, answerParked, answeredInWords, typed, ownQuestion, showWaitingOnPersonChip, settleWaitingOnPersonChips };
+ return { park, remind, decided, closed, askedAgain, answerParked, answeredInWords, typed, ownQuestion, showWaitingOnPersonChip, settleWaitingOnPersonChips };
}
diff --git a/server/index.ts b/server/index.ts
index 2aee79bbd3..46a0866d46 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -3939,7 +3939,7 @@ const handoffTicks = createHandoffTicks(), coordinator: Coordinator = createCoor
if (directThreadIds.size > 0) drainQueuedSends();
},
report: (child, parent) => {
- askCards.closed(child);
+ askCards.closed(child); if (child.outcome === "expired" && child.cards?.length) stopCards(child.threadId, new Set(child.cards));
if (!parent) {
parkedSeats.delete(child.id);
const followupEnded = followupEndedRoots.has(child.id);
@@ -4086,7 +4086,7 @@ const handoffTicks = createHandoffTicks(), coordinator: Coordinator = createCoor
...(node.answeredBy?.kind === "bot" ? { answerer: store.bot(node.answeredBy.botId)?.name ?? "Teammate" } : {}),
};
},
- park: (node, question, restored) => askCards.park(node, question, restored),
+ park: (node, question, restored) => askCards.park(node, question, restored), remind: (node, closesAt) => askCards.remind(node, closesAt),
levelOf: (target, source) => delegatedLevel.levelOf(target, source),
chiefOf: address => chiefLevel(store.bot(address.botId)),
// A person's cut root never reruns after a follow-up in its thread: that would hand the person's words to a model again, or redo an older request.
diff --git a/server/runtime-coordinator.ts b/server/runtime-coordinator.ts
index 013038cc82..892d8c57fc 100644
--- a/server/runtime-coordinator.ts
+++ b/server/runtime-coordinator.ts
@@ -35,6 +35,10 @@ const NEEDS_INPUT = /^needs input:/i;
/** Per-turn stalls belong to the host's watchdog: this only keeps the runtime's window out of its way. */
const TURN_STALL_MS = 24 * 60 * 60_000;
+/** Handed-off work parked on the person: a reminder after a day, closed after three. */
+const PARKED_REMIND_MS = 24 * 60 * 60_000;
+const PARKED_LIMIT_MS = 72 * 60 * 60_000;
+
const REQUESTS_PER_ROOT = 64;
const EXECUTIONS_PER_ROOT = 96;
@@ -160,7 +164,7 @@ export class RuntimeCoordinator implements Coordinator {
this.store = options.wrote ? announcingWrites(store, options.wrote) : store;
this.runtime = new Runtime(this.store, this.runner(), {
clock: { now: () => this.now(), monotonic: () => performance.now() },
- limits: { depth: 4, requests: REQUESTS_PER_ROOT, executions: EXECUTIONS_PER_ROOT, turnStallMs: TURN_STALL_MS, ...options.runtimeLimits },
+ limits: { depth: 4, requests: REQUESTS_PER_ROOT, executions: EXECUTIONS_PER_ROOT, turnStallMs: TURN_STALL_MS, inputWaitMs: PARKED_LIMIT_MS, inputRemindMs: PARKED_REMIND_MS, ...options.runtimeLimits },
...(options.log ? { log: options.log } : {}),
});
}
@@ -568,6 +572,7 @@ export class RuntimeCoordinator implements Coordinator {
},
run: (a, input, signal) => this.run(a, input, signal),
park: (a, question, restored) => host.park(this.project(a), question, restored),
+ remind: (a, closesAt) => host.remind?.(this.project(a), closesAt),
report: (a, parent) => host.report(view(a, parent), parent && this.project(parent)),
changed: rows => {
const groups = new Set<string>();
diff --git a/server/runtime/runtime.test.ts b/server/runtime/runtime.test.ts
index d5bce94a7f..2a5f67122f 100644
--- a/server/runtime/runtime.test.ts
+++ b/server/runtime/runtime.test.ts
@@ -887,6 +887,88 @@ describe("Runtime: a root's later executions (every turn a root)", () => {
invariants(w);
});
+ it("reminds the person once when handed-off work has waited, then closes it, across a restart and on the wall clock", async () => {
+ const store = openRuntimeStore(":memory:");
+ const w = world((a) => a.assignee.botId === "builder" ? { kind: "needs_input", question: "Region?" } : undefined, { inputRemindMs: 1_000, inputWaitMs: 3_000 }, store);
+ const reminded: Array<{ id: string; closesAt: number }> = [];
+ w.runner.remind = (a, closesAt) => { reminded.push({ id: a.id, closesAt }); };
+ const root = w.runtime.begin(beginReq());
+ const child = ok(w.runtime.enqueue(toBot("builder", root.id)));
+ w.runtime.tick(); await flush();
+ w.runtime.end(root.id, { ok: true, text: "" });
+ const parkedAt = w.store.get(child.id)!.lastActivityAt;
+ w.clock.advance(1_000);
+ w.runtime.tick();
+ expect(reminded).toEqual([]);
+ w.clock.advance(1);
+ w.runtime.tick(); w.runtime.tick();
+ expect(reminded).toEqual([{ id: child.id, closesAt: parkedAt + 3_001 }]);
+ expect(w.store.events(child.id).filter(e => e.kind === "reminded")).toHaveLength(1);
+
+ const again = new Runtime(store, w.runner, { clock: w.clock, limits: { inputRemindMs: 1_000, inputWaitMs: 3_000 }, log: () => {} });
+ again.open();
+ w.clock.advance(1_999);
+ again.tick();
+ expect(reminded).toHaveLength(1);
+ expect(store.get(child.id)?.status).toBe("needs_input");
+ w.clock.advance(2);
+ again.tick();
+ expect(store.get(child.id)).toMatchObject({ status: "failed", outcome: "expired", outcomeDetail: "the person did not answer" });
+ });
+
+ it("reminds late work first and still gives it the rest of the window after a long downtime", async () => {
+ const w = world((a) => a.assignee.botId === "builder" ? { kind: "needs_input", question: "Region?" } : undefined, { inputRemindMs: 1_000, inputWaitMs: 3_000 });
+ const reminded: number[] = [];
+ w.runner.remind = (_a, closesAt) => { reminded.push(closesAt); };
+ const root = w.runtime.begin(beginReq());
+ const child = ok(w.runtime.enqueue(toBot("builder", root.id)));
+ w.runtime.tick(); await flush();
+ w.runtime.end(root.id, { ok: true, text: "" });
+ w.clock.advance(50_000);
+ w.runtime.tick();
+ expect(reminded).toEqual([w.clock.t + 2_000]);
+ expect(w.store.get(child.id)?.status).toBe("needs_input");
+ w.clock.advance(2_000);
+ w.runtime.tick();
+ expect(w.store.get(child.id)?.status).toBe("needs_input");
+ w.clock.advance(1);
+ w.runtime.tick();
+ expect(w.store.get(child.id)).toMatchObject({ status: "failed", outcome: "expired" });
+ });
+
+ it("a newer question restarts the wait and its reminder; a question its requester decides reminds nobody", async () => {
+ const asks: RunResult = { kind: "needs_input", question: "Region?" };
+ const w = world((a) => a.assignee.botId === "builder" ? asks : undefined, { inputRemindMs: 1_000, inputWaitMs: 3_000 });
+ const reminded: string[] = [];
+ w.runner.remind = (a) => { reminded.push(a.id); };
+ const root = w.runtime.begin(beginReq());
+ const child = ok(w.runtime.enqueue(toBot("builder", root.id)));
+ w.runtime.tick(); await flush();
+ w.runtime.end(root.id, { ok: true, text: "" });
+ w.clock.advance(1_001);
+ w.runtime.tick();
+ expect(reminded).toEqual([child.id]);
+ expect(w.runtime.answer(child.id, "eu-west")).toBe(true);
+ w.runtime.tick(); await flush();
+ expect(w.store.get(child.id)).toMatchObject({ status: "needs_input" });
+ expect(w.store.get(child.id)?.remindedAt).toBeUndefined();
+ w.clock.advance(1_001);
+ w.runtime.tick();
+ expect(reminded).toEqual([child.id, child.id]);
+
+ const quiet = world((a) => a.assignee.botId === "builder" ? { kind: "needs_input", question: "Region?", decide: {} } : undefined, { inputRemindMs: 1_000, inputWaitMs: 3_000 });
+ const told: string[] = [];
+ quiet.runner.remind = (a) => { told.push(a.id); };
+ const root2 = quiet.runtime.begin(beginReq());
+ const decided = ok(quiet.runtime.enqueue(toBot("builder", root2.id)));
+ quiet.runtime.tick(); await flush();
+ expect(quiet.store.get(decided.id)?.decide).toEqual({});
+ quiet.clock.advance(3_001);
+ quiet.runtime.tick();
+ expect(told).toEqual([]);
+ expect(quiet.store.get(decided.id)).toMatchObject({ status: "failed", outcome: "expired" });
+ });
+
it("a root parked on cards never expires; a child's question does; a non-finite inputWaitMs never expires anything", async () => {
const w = world((a) => a.assignee.botId === "builder" ? { kind: "needs_input", question: "Region?" } : undefined, { inputWaitMs: 1_000 });
const root = w.runtime.begin(beginReq());
diff --git a/server/runtime/runtime.ts b/server/runtime/runtime.ts
index dff670d019..96a0a18772 100644
--- a/server/runtime/runtime.ts
+++ b/server/runtime/runtime.ts
@@ -262,8 +262,8 @@ export class Runtime {
if (!n || isTerminal(n)) continue;
if (n.status === "queued" && !n.continuation && now - this.since(n.lastActivityAt) > this.limits.queueMs) {
this.cancelTree(n, n.executions > 0 ? "not resumed" : "never started", "failed", "expired");
- } else if (n.status === "needs_input" && this.inputExpires(n) && now - this.since(n.lastActivityAt) > this.limits.inputWaitMs) {
- this.cancelTree(n, "the person did not answer", "failed", "expired");
+ } else if (n.status === "needs_input" && this.inputExpires(n)) {
+ this.chaseParked(n, now);
} else if (n.status === "running") {
const turn = this.turns.get(n.id);
if (turn && mono - turn.activeAt > this.limits.turnStallMs) {
@@ -482,7 +482,7 @@ export class Runtime {
}
delete n.guard;
if (result.kind === "needs_input") {
- n.status = "needs_input"; n.question = clip(result.question, BRIEF_MAX); n.lastActivityAt = now;
+ n.status = "needs_input"; n.question = clip(result.question, BRIEF_MAX); n.lastActivityAt = now; delete n.remindedAt;
if (result.cards?.length) n.cards = result.cards; else delete n.cards;
const choice = result.decide?.default?.trim();
if (result.decide && n.parentId && !n.cards) n.decide = choice ? { default: clip(choice, BRIEF_MAX) } : {}; else delete n.decide;
@@ -745,7 +745,24 @@ export class Runtime {
}
private inputExpires(n: Assignment): boolean {
- return Number.isFinite(this.limits.inputWaitMs) && !(n.cards && n.cards.length > 0);
+ return Number.isFinite(this.limits.inputWaitMs) && n.parentId !== undefined;
+ }
+
+ /** One reminder, then expiry. Not on this.since(): a window every boot reopened would never close on a host that restarts. A
+ * question its requester decides asks the person nothing, so it gets no reminder. */
+ private chaseParked(n: Assignment, now: number): void {
+ const { inputWaitMs, inputRemindMs } = this.limits;
+ const closesAt = n.lastActivityAt + inputWaitMs;
+ if (n.remindedAt === undefined && Number.isFinite(inputRemindMs) && !n.decide) {
+ if (now - n.lastActivityAt <= inputRemindMs) return;
+ n.remindedAt = now;
+ this.store.update(n, { kind: "reminded", at: now, detail: "waiting on the person" });
+ this.touch(n);
+ this.safe("remind", () => this.runner.remind?.(n, Math.max(closesAt, now + inputWaitMs - inputRemindMs)));
+ return;
+ }
+ const notBefore = n.remindedAt === undefined ? closesAt : Math.max(closesAt, n.remindedAt + inputWaitMs - inputRemindMs);
+ if (now > notBefore) this.cancelTree(n, "the person did not answer", "failed", "expired");
}
/** Whether its requester takes a turn for its question: a one-way notice's never does, nor a `poll` root. */
diff --git a/server/runtime/store.ts b/server/runtime/store.ts
index f73676e80c..25d77f1724 100644
--- a/server/runtime/store.ts
+++ b/server/runtime/store.ts
@@ -68,6 +68,7 @@ const assignmentSchema = z.object({
reportedAt: z.number().optional(),
rework: z.boolean(),
question: z.string().optional(),
+ remindedAt: z.number().optional(),
decide: z.object({ default: z.string().optional() }).optional(),
answer: z.string().optional(),
answeredBy: z.discriminatedUnion("kind", [z.object({ kind: z.literal("bot"), botId: z.string().min(1) }), z.object({ kind: z.literal("default") })]).optional(),
diff --git a/server/runtime/types.ts b/server/runtime/types.ts
index fa1e8925cd..d18c520fdd 100644
--- a/server/runtime/types.ts
+++ b/server/runtime/types.ts
@@ -126,6 +126,8 @@ export interface Assignment {
/** Its reply only acknowledged: its requester takes no turn for it (status-reply.ts). */
statusOnly?: boolean;
question?: string;
+ /** While parked: when the person was reminded of it, so a restart never reminds them twice. */
+ remindedAt?: number;
/** While parked under Full access ("Just do it"): the question is its requester's to answer, never the person's.
* Still unanswered when the requester's turn that carries it ends, the assignee goes on with `default`, or with its
* own pick when it named none. */
@@ -174,7 +176,7 @@ export interface TurnEvidence {
export type EventKind =
| "enqueued" | "refused" | "admitted" | "started" | "progress" | "parked" | "answered"
| "waiting" | "resume_due" | "settled" | "reported" | "woken" | "cancelled"
- | "restart_reconciled" | "budget" | "stalled" | "continued" | "held";
+ | "restart_reconciled" | "budget" | "stalled" | "continued" | "held" | "reminded";
export interface AssignmentEvent {
id: number;
@@ -306,6 +308,8 @@ export interface TurnRunner {
/** The assignment is parked on the person; show what it needs. `restored`
* is the restart's re-park: show it again only if it never got shown. */
park(a: Assignment, question: string, restored?: boolean): void;
+ /** Work parked on the person has waited inputRemindMs: remind them, once. `closesAt`: when it expires. */
+ remind?(a: Assignment, closesAt: number): void;
/** A settled child, into its requester's conversation (a chip, a line), or
* a root that ended alone, into its own. Called once per settlement. */
report(a: Assignment, parent?: Assignment): void;
@@ -340,9 +344,12 @@ export interface Limits {
/** A turn with no activity for this long is stalled (the host says what
* counts as activity by touching progress()). */
turnStallMs: number;
- /** How long a parked assignment waits on the person's words before it expires: not run, not refused. Infinite
- * unless a host sets it: a question waits for the person. */
+ /** How long handed-off work parked on the person waits before it expires: not run, not refused. On the wall clock,
+ * restarts included. Infinite unless a host sets it. A root waits on no one above it and has no such limit. */
inputWaitMs: number;
+ /** How long that work waits before the person is reminded of it, once. The rest of inputWaitMs always follows the
+ * reminder, however late a restart let it go out. Infinite: no reminder. */
+ inputRemindMs: number;
}
export const DEFAULT_LIMITS: Limits = {
@@ -354,6 +361,7 @@ export const DEFAULT_LIMITS: Limits = {
stallMs: 4 * 60 * 60_000,
turnStallMs: 20 * 60_000,
inputWaitMs: Number.POSITIVE_INFINITY,
+ inputRemindMs: Number.POSITIVE_INFINITY,
};
export interface LiveEdge {
diff --git a/src/locales/de.json b/src/locales/de.json
index e067bd6265..85662ca7af 100644
--- a/src/locales/de.json
+++ b/src/locales/de.json
@@ -257,6 +257,8 @@
"server.teammates.goal.stopped": "Ziel gestoppt: {detail}",
"server.teammates.goal.failed": "Ziel fehlgeschlagen: {detail}",
"server.teammates.noAnswerInTime": "Niemand hat die Frage von {who} rechtzeitig beantwortet",
+ "server.teammates.stillWaiting": "Wartet noch auf deine Antwort: {question} Diese Arbeit wird in {days} Tagen beendet, wenn niemand antwortet.",
+ "server.teammates.stillWaitingCard": "Diese Arbeit wartet noch auf dich. Sie wird in {days} Tagen beendet, wenn sich nichts ändert.",
"server.teammates.noApprovalInTime": "Niemand hat die Freigabe von {who} rechtzeitig erteilt, dieser Schritt lief nicht",
"server.teammates.turnEndedBeforeAnswer": "Der Zug von {who} endete, bevor jemand seine Frage beantwortet hat",
"server.teammates.approvalClosed": "Die Freigabe von {who} wurde geschlossen, bevor jemand geantwortet hat, dieser Schritt lief nicht",
diff --git a/src/locales/en.json b/src/locales/en.json
index 1354da1a07..c3d8fadd9a 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -384,6 +384,8 @@
"server.teammates.goal.stopped": "Goal stopped: {detail}",
"server.teammates.goal.failed": "Goal failed: {detail}",
"server.teammates.noAnswerInTime": "Nobody answered {who}'s question in time",
+ "server.teammates.stillWaiting": "Still waiting on your answer: {question} This work closes in {days} days if nobody answers.",
+ "server.teammates.stillWaitingCard": "This work is still waiting on you. It closes in {days} days if nothing changes.",
"server.teammates.noApprovalInTime": "Nobody answered {who}'s approval in time — that step did not run",
"server.teammates.turnEndedBeforeAnswer": "{who}'s turn ended before anyone answered its question",
"server.teammates.approvalClosed": "{who}'s approval closed before anyone answered — that step did not run",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 3cc07ce43b..d1e3d18093 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -367,6 +367,8 @@
"server.teammates.goal.stopped": "Objetivo interrompido: {detail}",
"server.teammates.goal.failed": "O objetivo falhou: {detail}",
"server.teammates.noAnswerInTime": "Ninguém respondeu à pergunta de {who} a tempo",
+ "server.teammates.stillWaiting": "Ainda aguardando sua resposta: {question} Este trabalho será encerrado em {days} dias se ninguém responder.",
+ "server.teammates.stillWaitingCard": "Este trabalho ainda está esperando por você. Ele será encerrado em {days} dias se nada mudar.",
"server.teammates.noApprovalInTime": "Ninguém respondeu ao pedido de aprovação de {who} a tempo — essa etapa não foi executada",
"server.teammates.turnEndedBeforeAnswer": "A sessão de {who} terminou antes de alguém responder à pergunta dele",
"server.teammates.approvalClosed": "O pedido de aprovação de {who} foi encerrado antes de alguém responder — essa etapa não foi executada",