Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4eb29cb
refactor(workforce): rename worker messages to sendMessage and onMess…
claude Oct 27, 2026
86f9091
feat(workforce): a received message is its own item, and nothing is r…
claude Oct 27, 2026
f201a3e
FIX-2238: landing rules, task-sessions refusal and one budget
claude Oct 27, 2026
0a814fe
refactor(orchestration): lift the take rule and resend backoff into p…
claude Oct 27, 2026
cdc1107
refactor(orchestration): lift the take rule and resend backoff into p…
claude Oct 27, 2026
874afbf
feat(workforce): a worker message lands once (FIX-2240)
claude Oct 27, 2026
dbd9e84
feat(workforce): a taken message is never ended for its age; sends re…
claude Oct 27, 2026
b1b86b4
feat(shift-manager): a message reads on its way until taken, and coul…
claude Oct 27, 2026
6b3a3bb
docs(workforce): a message lands once: delivery, statuses, the late-f…
claude Oct 27, 2026
393f159
Merge remote-tracking branch 'origin/claude/project-thread-3uc91a' in…
claude Oct 27, 2026
dd932cb
chore(workforce): say user, not person, in the delivery comments (FIX…
claude Oct 27, 2026
9413821
FIX-2238: every worker flow on an installation hears a message
claude Oct 27, 2026
933dc2f
feat(orchestration,engine): a task id finds its partition, and a bloc…
claude Oct 27, 2026
ddd8a9b
feat(harness-manager): harnessTalkTurn, the session door's talk half,…
claude Oct 27, 2026
a30cfd9
feat(workforce): sendMessage takes { task } and { session }, checked …
claude Oct 27, 2026
c8f0c0c
fix(workforce): name a message row's target field addressedBy
claude Oct 27, 2026
ce4902a
docs(workforce): leave FIX-2238's renames to its own PR (FIX-2240)
claude Oct 27, 2026
b42660c
feat(shift-manager): the coder answers a message to its finished task…
claude Oct 27, 2026
1feba42
FIX-2238: docs, changeset, goal amended, epic seams updated
claude Oct 27, 2026
77f3584
Merge FIX-2160 into FIX-2240 for the stack
claude Oct 27, 2026
85da1aa
spec(FIX-2240): record the three seams folded while building
claude Oct 27, 2026
d94227d
feat(orchestration,engine): a task id finds its partition, and a bloc…
claude Oct 27, 2026
aa3852c
feat(harness-manager): harnessTalkTurn, the session door's talk half,…
claude Oct 27, 2026
dfd7fe1
feat(workforce): sendMessage takes { task } and { session }, checked …
claude Oct 27, 2026
c3e3cb6
fix(workforce): name a message row's target field addressedBy
claude Oct 27, 2026
cf5e871
feat(shift-manager): the coder answers a message to its finished task…
claude Oct 27, 2026
ae2bb6b
test(goals): legs 6-8 message a task, a conversation and the coder's …
claude Oct 27, 2026
0979138
test(workforce): a taker that dies after the take is resent and lands…
claude Oct 27, 2026
b03e4fe
Merge main into FIX-2238; review fixes
claude Oct 27, 2026
759d851
docs: message a task or a conversation by id; harnessTalkTurn; the le…
claude Oct 27, 2026
c6d6191
test(goals): leg 6 opens a delegate session for leg 7; goal.md names …
claude Oct 27, 2026
39b85ea
fix: parse id-index markers with their schema; the request host is cl…
claude Oct 27, 2026
0b01f18
Merge FIX-2160 (#4012) into FIX-2240 for the stack
claude Oct 27, 2026
acdd330
FIX-2238: one chain for a task filed held; drop the dead messaged-wor…
claude Oct 27, 2026
b5a893e
Merge FIX-2238's branch (main merged) into FIX-2160
claude Oct 27, 2026
a0149c2
spec(FIX-2160): notes from the cross-spec review, recorded at impleme…
claude Oct 27, 2026
973404f
fix(workforce): a { task } target counts only partitions that hold th…
claude Oct 27, 2026
dd83e61
Merge FIX-2160 (#4012, with main) into FIX-2240
claude Oct 27, 2026
e088b23
chore(workforce): keep undeliveredLine module-private (FIX-2240)
claude Oct 27, 2026
752d290
FIX-2238: a received message's budget is what its chain has left
claude Oct 27, 2026
0961e69
fix(goals): type leg 8's setWorkProject call (FIX-2160)
claude Oct 27, 2026
c748982
Merge FIX-2160 (#4012) into FIX-2240
claude Oct 27, 2026
367eb69
FIX-2238: an answer reaches a worker that hears only in its tasks' se…
claude Oct 27, 2026
5d7ca95
FIX-2238 goal: the ring's own hand-offs aren't stray rows; the herald…
claude Oct 27, 2026
bfbae4c
FIX-2238 goal: 3:budget-left grades what the chain had left when heard
claude Oct 27, 2026
fa37e7d
fix(workforce): record a message delivered only once its items are st…
claude Oct 27, 2026
d19f32a
spec(FIX-2240): record the accepted fast-path loss window
claude Oct 27, 2026
0776b40
refactor(workforce): one close step in the message pass; parse the ow…
claude Oct 27, 2026
67b7ee5
Merge FIX-2238's latest into FIX-2160
claude Oct 27, 2026
18268d2
refactor(workforce): the take answers the row or nothing; one refusal…
claude Oct 27, 2026
00fef9e
Merge FIX-2160 (#4012) into FIX-2240
claude Oct 27, 2026
6b3987d
fix(workforce): a worker's other conversation can answer it (FIX-2160)
claude Oct 27, 2026
594fd76
fix(workforce): a resent answer keeps the send's answering exception …
claude Oct 27, 2026
7b5466b
fix(workforce): a taken message whose destination is gone ends past t…
claude Oct 27, 2026
3aecb45
fix(workforce): a repeat of a refused send answers the refusal (FIX-2…
claude Oct 27, 2026
5efdc4d
fix(workforce): a resend to a task refuses once the task moved sessio…
claude Oct 27, 2026
ac6d701
Merge remote-tracking branch 'origin/claude/project-thread-i68jr1' in…
claude Oct 27, 2026
eec5d61
Merge main (FIX-2238 #4010 and FIX-2160 #4012 landed) into FIX-2240
claude Oct 27, 2026
6123c83
fix(engine): a failed item write rejects the filesystem store's flush…
claude Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(workforce): a taker that dies after the take is resent and lands…
… once (FIX-2240)

Pins the case a review on #4010 found: a claim before the items made a
retry read as a duplicate. The take alone isn't a delivery, so the
sender's pass resends and the next request takes it over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiDFT9s67hk1haKhCfg
  • Loading branch information
claude committed Oct 27, 2026
commit 09791384e6db02501ac1eb0a300b15ce75cae2a4
33 changes: 32 additions & 1 deletion packages/workforce/test/worker-messages-delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,23 @@
*/
import { afterEach, describe, expect, it, vi } from "vitest";

const fault = { throwFastPath: false, loseFastPath: false, refuseFastPath: false };
const fault = { throwFastPath: false, loseFastPath: false, refuseFastPath: false, throwAfterTake: false };

// A recipient that dies between its take and its items: the first message
// turn's start (a hop past the user's own) throws, once.
vi.mock("../src/messages/hop", async (original) => {
const actual = await original<typeof import("../src/messages/hop")>();
return {
...actual,
startTurnAtHop: (...args: Parameters<typeof actual.startTurnAtHop>) => {
if (fault.throwAfterTake && args[1] > 0) {
fault.throwAfterTake = false;
return Promise.reject(new Error("the process died after the take"));
}
return actual.startTurnAtHop(...args);
}
};
});

vi.mock("@flow-state-dev/core/types", async (original) => {
const actual = await original<typeof import("@flow-state-dev/core/types")>();
Expand Down Expand Up @@ -62,6 +78,7 @@ afterEach(async () => {
fault.throwFastPath = false;
fault.loseFastPath = false;
fault.refuseFastPath = false;
fault.throwAfterTake = false;
await open?.dispose();
open = undefined;
});
Expand Down Expand Up @@ -252,6 +269,20 @@ describe("the take on the row", () => {
// The taker's items landed with it; the copy's are the second: the one window left (D: "delivered" before the turn).
expect(await receivedIn(h, lead.id, row!.id)).toHaveLength(2);
}, 30_000);
it("is sent again when its taker died after the take and before the items: the pass resends it and it lands once", async () => {
fault.throwAfterTake = true;
const { h, otto } = await boot();
await h.post("alice", otto, "respond", { message: "Please ask the lead" }, "agent");
await h.settled();
const [first] = await logRows(h);
// Taken, then nothing: the take alone isn't a delivery, so the sender still owes it.
expect(first).toMatchObject({ status: "unconfirmed", takenBy: expect.any(String) });
const row = await rowUntil(h, (r) => r.status === "delivered");
expect(row).toMatchObject({ status: "delivered", resent: { n: 1 } });
expect(row!.takenBy).not.toBe(first!.takenBy);
await h.settled();
expect(await receivedIn(h, row!.toSession, row!.id)).toHaveLength(1);
}, 30_000);
});

describe("a message that can't land after its send returned", () => {
Expand Down