Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 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
9413821
FIX-2238: every worker flow on an installation hears a message
claude Oct 27, 2026
1feba42
FIX-2238: docs, changeset, goal amended, epic seams updated
claude Oct 27, 2026
b03e4fe
Merge main into FIX-2238; review fixes
claude Oct 27, 2026
acdd330
FIX-2238: one chain for a task filed held; drop the dead messaged-wor…
claude Oct 27, 2026
752d290
FIX-2238: a received message's budget is what its chain has left
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
0e91fad
FIX-2238 follow-up: a fresh budget for a task held before it starts, …
claude Oct 28, 2026
0232b15
Merge the merged FIX-2238 branch history (no changes): the follow-up …
claude Oct 28, 2026
570849b
FIX-2238 follow-up: read a finished task session the way the steer ro…
claude Oct 28, 2026
d9d39a5
goal(FIX-2238): the goal's text for sendMessage, and its verdict
claude Oct 28, 2026
c14d50c
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Oct 28, 2026
5bb75da
goal(FIX-2238): leg 6's one failure was the goal's timing, fixed in #…
claude Oct 28, 2026
cccdd43
Merge branch 'main' into claude/project-thread-n6abql
jhoffner Oct 28, 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
FIX-2238: docs, changeset, goal amended, epic seams updated
Docs and READMEs describe sendMessage, onMessageReceived, the received
item (which now carries the budget left), the landing rules, the budget and
the refusals. The workers-message-each-other goal gets the spec's new legs,
controls and sweep. The epic's seam table, ER-6 and stack order follow the
cross-spec review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiDWiB5JZRCvyAFUpe9
  • Loading branch information
claude committed Oct 27, 2026
commit 1feba4213dca9edddb7fbf5a390e19b1330ee542
7 changes: 7 additions & 0 deletions .changeset/a-worker-hears-a-message-on-receipt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@flow-state-dev/workforce": minor
---

Workers message each other with `sendMessage({ to, text, inReplyTo? })` and hear one through the `onMessageReceived` entry, which `hireWorkforce` now requires on every worker flow on an installation (FIX-2238). A received message lands as a history line plus its own client item (`workforce:received`, with `from`, `id` and `inReplyTo`), and nothing is relayed: a worker answers by sending a message with `inReplyTo`, and its plain text reaches no one. An answer lands in the session its original was sent from, and a message to the worker that filed the sender's task lands in the filing conversation. One budget covers a typed message: 6 messages in all, 3 per request. A task filed held starts a fresh budget when released, and filing or a refused send spends nothing. Coordinators can be messaged whatever their routing, and a worker that hears only in its tasks' sessions (`hears: "task-sessions"`) is refused by name with `task_sessions_only`.

**Migration.** `messageWorker` is now `sendMessage`. `onWorkerMessage` is now `onMessageReceived`; build it with `messageReceivedEntry({ installation, flowKind, turn?, hears? })` (or spread the session kit's `entries`), and add `workerMessagesResources` to a flow without the kit. `replyTo` is now `inReplyTo`. The removed exports are `MESSAGE_WORKER_TOOL`, `WORKER_MESSAGE_ENTRY`, `messageWorkerInputSchema`, `sendWorkerMessage`, `SendWorkerMessage` and `takesWorkerMessages`, and the new ones are `SEND_MESSAGE_TOOL`, `MESSAGE_RECEIVED_ENTRY`, `RECEIVED_MESSAGE_COMPONENT`, `sendMessageInputSchema`, `sendMessage` and `SendMessageInput`. The refusals `takes_tasks_only` and `no_turn` are gone, `hop_limit` is now `budget`, and `per_turn_limit` is now `per_request_limit`. A message row no longer carries `answerTo`.
2 changes: 1 addition & 1 deletion apps/docs/docs/shift-manager/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ In your own app, `openWorkstream` takes whichever lead you name. See [Projects](

Shift Coordinator, a workstream and a task also have a panel on the right. The sidebar and the right panel each collapse from their own toggle or from the keyboard: `[` for the sidebar, which shrinks to a column of icons, and `]` for the right panel, which shrinks to a strip. Each one's state is kept in the browser for the signed-in user. On a window narrower than 1180px, the right panel starts collapsed and opens over the center.

In a conversation, a message the worker sent another worker shows as its own line, *To &lt;worker&gt;: &lt;text&gt;*, with a link to Messages. One that was refused says it wasn't sent, and why. A message a worker received shows as *From &lt;worker&gt;: &lt;text&gt;*, under the sender's name.
In a conversation, a message the worker sent another worker shows as its own line, *To &lt;worker&gt;: &lt;text&gt;*, with a link to Messages. One that was refused says it wasn't sent, and why. A message the worker received shows as its own item: the sender's name, the time it arrived, *answering your message* when it answers one the worker sent, a *Messages ›* link, and the text.

A board has five columns: QUEUED, RUNNING, IN REVIEW, NEEDS YOU and DONE. In a workstream's composer, a message that starts with `@` and a worker's name goes to that worker's task in the workstream.

Expand Down
6 changes: 3 additions & 3 deletions apps/docs/docs/workforce/delegating-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ What the kit gives you, and where each piece goes:
| Field | Put it in |
|-------|-----------|
| `tools` | The `uses` of the block that runs the model. It carries the task tools only while the session files, and nothing otherwise. |
| `messages` | The same `uses`. It carries `messageWorker`, which [messages another worker](./messaging-workers.md). Leave it out and the flow's workers can receive messages but not send them. |
| `messages` | The same `uses`. It carries `sendMessage`, which [messages another worker](./messaging-workers.md). Leave it out and the flow's workers can receive messages but not send them. |
| `actions` | The flow's `actions`: the task tools as `<tool>_tasks`, plus `addDelegate`, `removeDelegate`, `setFallback` and `listDelegates`. |
| `progress` | The same `uses`. It carries `reportProgress` on a turn working a task. |
| `delegateTools` | The same `uses`. It carries `listDelegates`, and `addDelegate`, `removeDelegate` and `setFallback` on a worker set to `editsOwnDelegates: true`. |
| `resources` | The flow's `resources`. |
| `sessionStateShape` | `installation.session(...)`. |
| `serverOwned` | The flow's `session.serverOwned`. |
| `planned(turn)` | Wrap the block that answers a message, and use what it returns wherever that block runs as the worker: the `respond` action, the task entry's `turn`, and `entries`. The steps the worker files for itself then run in the same request. See [Working in steps](#working-in-steps). Leave it out and the flow's workers file no steps. |
| `entries(turn)` | The flow's `internal: { actions }`. Pass the block that answers a message; it is woken with a line when a task the session filed ends, and when another worker messages this one. The entries include `dispatch`, which runs the session's board one pass at a time, and `onTaskSettled`, where each of those endings arrives. |
| `entries(turn)` | The flow's `internal: { actions }`. Pass the block that answers a message; it is woken with a line when a task the session filed ends, and when another worker messages this one. The entries include `dispatch`, which runs the session's board one pass at a time, `onTaskSettled`, where each of those endings arrives, and `onMessageReceived`, where another worker's message arrives. |
| `files(ctx)` | Read it when you need to know whether the running session files now. |
| `taskDelegates(ctx)` | The session's delegates as a task sees them: `available` (worker id to flow) and `unavailable` (worker id to why). |

Expand Down Expand Up @@ -216,7 +216,7 @@ A worker given a task can split it into pieces for its own delegates. A piece fo

The pieces go on the task session's own board. The worker either waits on a piece in the same turn, with `getTask({ id, wait: true })`, or files them and ends its turn. Waits nest up to five deep, so a task's turn can wait on a piece whose own turn waits on another. When the turn ends instead, nothing runs for the task while the pieces are worked, but the task stays `in_progress`, with `waitingOn: "filed"` on its row, and it isn't handed out again while it waits. See [When a dispatched task is done](../orchestration/task-board.md#when-a-dispatched-task-is-done) for the rule every dispatched task follows.

Each piece's ending wakes the worker for a turn in the task session, where it reads the result and decides what it means. A turn can file more pieces, and the task waits on those too. A message to the worker in its task session doesn't hold the task and isn't part of it. While the task's turn is running, the worker answers it after that turn; while the task waits on its pieces, it may answer it before the task is done. Either way the answer can't write to the task, and a failure in it doesn't fail the task.
Each piece's ending wakes the worker for a turn in the task session, where it reads the result and decides what it means. A turn can file more pieces, and the task waits on those too. A message to the worker in its task session doesn't hold the task and isn't part of it. While the task's turn is running, the worker hears it after that turn; while the task waits on its pieces, it may hear and answer it before the task is done. Either way its turn on the message can't write to the task, and a failure in it doesn't fail the task.

The task completes once no piece is open and the worker has had a turn on every piece's ending. Its output follows the same rule as any task's: the latest checkpoint the worker reported with `reportProgress`, or, with none, the answer from the last turn a piece's ending woke. A message's answer is never the output.

Expand Down
Loading
Loading