salvage 2026-11-06: uncommitted work from scratch/darkwing-scratch/rv81b/wt (disk cleanup #824)
This commit is contained in:
1 parent
1e5f595865
commit
6441d7772e
13 files changed
+455
-30
No files matched your search
@@ -61,8 +61,8 @@ mosaic launches list [--json]
|
||||
- `talk` sends `<text>` to the role as a REQUEST, then polls the human's
|
||||
inbox every 2 s for up to `--wait` seconds (default 900). It prints every
|
||||
message that arrives and marks it read, and stops at the reply to its
|
||||
REQUEST. No reply in time exits 1; the reply still lands in the inbox.
|
||||
`--wait 0` only sends.
|
||||
REQUEST. No reply in time exits 1; the reply may still come, and the next
|
||||
`mosaic talk` prints it. `--wait 0` only sends.
|
||||
- `launches off` and `on` are the broker's `launch.revoke` and
|
||||
`launch.restore`. While off, every `role.launch` refuses with
|
||||
`launch-revoked`; running sessions keep running. Stop them with `stop`.
|
||||
|
||||
@@ -209,7 +209,7 @@ async function talk(rest, io, deps) {
|
||||
if (m.in_reply_to === sent.id) answered = true;
|
||||
}
|
||||
if (answered) return;
|
||||
if (Date.now() >= deadline) throw new CliError(`no reply from ${to} within ${wait} s; it may still come, and the next mosaic talk or mosaic inbox shows it`, 1);
|
||||
if (Date.now() >= deadline) throw new CliError(`no reply from ${to} within ${wait} s; it may still come, and the next mosaic talk shows it`, 1);
|
||||
await new Promise((r) => setTimeout(r, pollMs));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,22 @@ test("talk --wait 0 only sends; no reply within --wait exits 1 and says where it
|
||||
assert.deepEqual(s.calls.map((c) => c.verb), ["message.send"]);
|
||||
const slow = await s.run(["talk", "coder", "hello", "--wait", "1", "--business", "demo"]);
|
||||
assert.equal(slow.code, 1);
|
||||
assert.match(slow.error, /no reply from coder within 1 s; .*mosaic inbox/);
|
||||
// Row 81 (#1575): only mosaic talk shows a late reply; mosaic inbox lists decisions, never messages.
|
||||
assert.equal(slow.error, "no reply from coder within 1 s; it may still come, and the next mosaic talk shows it");
|
||||
});
|
||||
|
||||
test("a late reply the Console has listed still reaches the next talk", async (t) => {
|
||||
const s = setup(t);
|
||||
assert.equal((await s.run(["talk", "coder", "hello", "--wait", "1", "--business", "demo"])).code, 1);
|
||||
const { id } = s.store.get("SELECT id FROM messages WHERE from_role='human' ORDER BY seq DESC LIMIT 1");
|
||||
assert.equal(call(s.b, s.coder, "message.receive")[0].id, id);
|
||||
const answer = call(s.b, s.coder, "message.send", { to: "human", body: "late answer", class: "RESULT", in_reply_to: id });
|
||||
// What the Console's send receipt reads, through its reader session.
|
||||
assert.deepEqual(s.read("replies", { id }).map((m) => m.id), [answer.id]);
|
||||
const next = await s.run(["talk", "coder", "again", "--wait", "1", "--business", "demo"]);
|
||||
assert.equal(next.code, 1, "no answer to the second one");
|
||||
assert.match(next.io.out.text, new RegExp(`coder \\(RESULT, re ${id.slice(0, 8)}\\) ${answer.id.slice(0, 8)}:\nlate answer\n`));
|
||||
assert.deepEqual(s.calls.filter((c) => c.verb === "message.read").map((c) => c.args.id), [answer.id]);
|
||||
});
|
||||
|
||||
test("talk, stop and launches off/on refuse inside an agent run; bad arguments are usage errors", async (t) => {
|
||||
|
||||
Reference in new issue
Block a user