Repository navigation
feat(workforce): a worker message lands once (FIX-2240) #4008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
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 86f9091
feat(workforce): a received message is its own item, and nothing is r…
claude f201a3e
FIX-2238: landing rules, task-sessions refusal and one budget
claude 0a814fe
refactor(orchestration): lift the take rule and resend backoff into p…
claude cdc1107
refactor(orchestration): lift the take rule and resend backoff into p…
claude 874afbf
feat(workforce): a worker message lands once (FIX-2240)
claude dbd9e84
feat(workforce): a taken message is never ended for its age; sends re…
claude b1b86b4
feat(shift-manager): a message reads on its way until taken, and coul…
claude 6b3a3bb
docs(workforce): a message lands once: delivery, statuses, the late-f…
claude 393f159
Merge remote-tracking branch 'origin/claude/project-thread-3uc91a' in…
claude dd932cb
chore(workforce): say user, not person, in the delivery comments (FIX…
claude 9413821
FIX-2238: every worker flow on an installation hears a message
claude 933dc2f
feat(orchestration,engine): a task id finds its partition, and a bloc…
claude ddd8a9b
feat(harness-manager): harnessTalkTurn, the session door's talk half,…
claude a30cfd9
feat(workforce): sendMessage takes { task } and { session }, checked …
claude c8f0c0c
fix(workforce): name a message row's target field addressedBy
claude ce4902a
docs(workforce): leave FIX-2238's renames to its own PR (FIX-2240)
claude b42660c
feat(shift-manager): the coder answers a message to its finished task…
claude 1feba42
FIX-2238: docs, changeset, goal amended, epic seams updated
claude 77f3584
Merge FIX-2160 into FIX-2240 for the stack
claude 85da1aa
spec(FIX-2240): record the three seams folded while building
claude d94227d
feat(orchestration,engine): a task id finds its partition, and a bloc…
claude aa3852c
feat(harness-manager): harnessTalkTurn, the session door's talk half,…
claude dfd7fe1
feat(workforce): sendMessage takes { task } and { session }, checked …
claude c3e3cb6
fix(workforce): name a message row's target field addressedBy
claude cf5e871
feat(shift-manager): the coder answers a message to its finished task…
claude ae2bb6b
test(goals): legs 6-8 message a task, a conversation and the coder's …
claude 0979138
test(workforce): a taker that dies after the take is resent and lands…
claude b03e4fe
Merge main into FIX-2238; review fixes
claude 759d851
docs: message a task or a conversation by id; harnessTalkTurn; the le…
claude c6d6191
test(goals): leg 6 opens a delegate session for leg 7; goal.md names …
claude 39b85ea
fix: parse id-index markers with their schema; the request host is cl…
claude 0b01f18
Merge FIX-2160 (#4012) into FIX-2240 for the stack
claude acdd330
FIX-2238: one chain for a task filed held; drop the dead messaged-wor…
claude b5a893e
Merge FIX-2238's branch (main merged) into FIX-2160
claude a0149c2
spec(FIX-2160): notes from the cross-spec review, recorded at impleme…
claude 973404f
fix(workforce): a { task } target counts only partitions that hold th…
claude dd83e61
Merge FIX-2160 (#4012, with main) into FIX-2240
claude e088b23
chore(workforce): keep undeliveredLine module-private (FIX-2240)
claude 752d290
FIX-2238: a received message's budget is what its chain has left
claude 0961e69
fix(goals): type leg 8's setWorkProject call (FIX-2160)
claude c748982
Merge FIX-2160 (#4012) into FIX-2240
claude 367eb69
FIX-2238: an answer reaches a worker that hears only in its tasks' se…
claude 5d7ca95
FIX-2238 goal: the ring's own hand-offs aren't stray rows; the herald…
claude bfbae4c
FIX-2238 goal: 3:budget-left grades what the chain had left when heard
claude fa37e7d
fix(workforce): record a message delivered only once its items are st…
claude d19f32a
spec(FIX-2240): record the accepted fast-path loss window
claude 0776b40
refactor(workforce): one close step in the message pass; parse the ow…
claude 67b7ee5
Merge FIX-2238's latest into FIX-2160
claude 18268d2
refactor(workforce): the take answers the row or nothing; one refusal…
claude 00fef9e
Merge FIX-2160 (#4012) into FIX-2240
claude 6b3987d
fix(workforce): a worker's other conversation can answer it (FIX-2160)
claude 594fd76
fix(workforce): a resent answer keeps the send's answering exception …
claude 7b5466b
fix(workforce): a taken message whose destination is gone ends past t…
claude 3aecb45
fix(workforce): a repeat of a refused send answers the refusal (FIX-2…
claude 5efdc4d
fix(workforce): a resend to a task refuses once the task moved sessio…
claude ac6d701
Merge remote-tracking branch 'origin/claude/project-thread-i68jr1' in…
claude eec5d61
Merge main (FIX-2238 #4010 and FIX-2160 #4012 landed) into FIX-2240
claude 6123c83
fix(engine): a failed item write rejects the filesystem store's flush…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| "@flow-state-dev/workforce": minor | ||
| "@flow-state-dev/orchestration": minor | ||
| "@flow-state-dev/engine": patch | ||
| --- | ||
|
|
||
| A worker message lands once (FIX-2240). The recipient's `onMessageReceived` takes a message on its log row before it lands, so a late copy lands nothing, and the sending session's board pass sends a message again, backing off from 2 s to 5 min, until it is delivered, refused or past the host's debt age. A message that can't land after the send returned leaves a line in the sending session, which its next turn reads. | ||
|
|
||
| **Migration.** The `sendMessage` tool answers `{ sent }` only: `unconfirmed` is gone, and `SendOutcome` no longer carries it. A log row's `status` is one of `unconfirmed` (on its way), `delivered` (landed in the recipient's conversation, not just accepted by its host), `refused` or `undeliverable`, and gains `toState`, `takenBy`, `deliveredAs`, `deliveredAt`, `resent` and `toldAt`. `dispatch-rejected`, `no-dispatch-operation` and `flow-not-found` are no longer final. The session's 500-id seen window (`workerMessagesSeen`, `messageReceivedStateShape`) is removed. The server function `sendMessage` takes an optional `{ id }`, so a repeated send under one server-chosen id is one message. Orchestration exports the take rule (`takeRule`, `decideTake`, `TakeRule`, `hasEnded`) and the resend backoff (`nextResendAt`, `NOTICE_RESEND_CAP_MS`) its task notices and worker messages share. | ||
|
|
||
| The filesystem request store's `flushItems` now rejects when an item write failed, as `flushEvents` does, so a resolved flush means the items are stored. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the filesystem adapter, an item-write failure can still leave a message marked delivered without durable received items. The fresh evidence beyond the earlier ordering finding is that
FilesystemRequestStore.flushItemsonly drains its queue, whilecreateSerializedWriteQueuecatches write failures and resolves its drain waiters; the item queue's error callback logs rather than rethrows. Consequently, this new barrier resolves even after persistence fails, allowingmarkDeliveredortellSenderto recorddeliveredortoldAt. A crash before the request's final items write then permanently loses the message or notification because subsequent passes trust those markers. Make the barrier propagate item-persistence failures before treating its completion as proof of storage.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Fixed in 6123c83, at the store rather than in the barrier. The filesystem request store now records an item write's error and rethrows it from
flushItems, the same wayflushEventsalready does and the Postgres store's flush already rejects. With that, a failed write makes the entry throw beforemarkDeliveredortoldAtis written. The row stays taken, and the pass's resend takes it over once that request has ended. New test inpersist-error-observable.test.ts: a failed item write rejectsflushItemsonce and is reported. Without the recorded error it fails. The full engine suite passes (4104), and an engine patch line is added to the changeset.Generated by Claude Code