Repository navigation
FIX-2156: a delegate a worker can message still takes its tasks - #4262
Conversation
The closure re-run of FIX-2152 on main (863a0e1) found the default prompt layer (FIX-2334) listing a worker's messageable delegates only as teammates to message. The Claude Code-style lab's main session then sent both research pieces to its researcher as messages and filed no task: session mode failed 0 of 6 attempts, and passed on attempt 1 with the layer patched out. The Teammates lab's Chief of Staff, on its new default model, also looked its teammates up with listDelegates (3 of 3). The layer now marks a messageable delegate as taking the worker's tasks, adds one line that work for a delegate goes as a task, and says the teammates list is current so no lookup is needed. Verdict rows for the closure re-run go in the three goals it touched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiH4wEhbNtsBnU8xobe
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture pass (read-only review)Verdict: the approach is right and small. Fixing the prompt (mark the delegate, say work goes as a task) is the leanest lever. Making 1. The "takes your tasks" mark can be false (worth fixing)
Failure case: a worker lists a messageable-only custom flow (no
The built-in Suggested change: derive the mark from the existing fact, e.g. 2. Two behaviours in one change, only one has a unit testThe Related: the evidence table changes mark, rule and "current" wording together, so it can't show which one fixed the session-mode lab. That is fine for shipping. If the prompt grows again, run the lab with the rule alone to see whether the per-line mark earns its place. 3. Notes (no action needed)
No docs, changeset or BP-022/BP-034 gaps found. The changeset edit to the unreleased FIX-2334 fragment is the right call. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfd90fabff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
/simplify review (FIX-2156)
Verdict: approve. The failure mode is clear from the goal closure rows: a messageable delegate never appeared under "Workers that take tasks only," so models routed research-sized work through sendMessage and the board never got rows. Fixing that in the default identity layer matches FIX-2334 and workforce-default-worker-flow.md — this is "who you can reach and how," not a new board rule. The diff stays small (~25 lines of logic), tests are targeted, and I would expect a runtime-only or send-time heuristic fix to be more complex and brittle.
Did the approach go too far?
Mostly no. Two layers of prompt (inline DELEGATE_MARK + standalone DELEGATE_RULE) are slightly redundant with text that already exists elsewhere (createTask in the task-only block; sendMessage's BASE_DESCRIPTION already says work goes through createTask). For the lab failure you saw, that redundancy may be load-bearing — I would not strip it without re-running the closure goals. What does feel broader than FIX-2156 is the teammates intro rewrite (listDelegates / "it is current, so no tool call is needed"). That tracks teammates-lab leg 2 on gpt-6-luna, not the delegate→task bug. Worth calling out in the PR description so revert/blame stay honest; splitting would be cleaner if you expect churn on either line.
Simpler alternatives considered
| Approach | Tradeoff |
|---|---|
Annotate delegates in sendMessage's recipientsLine only |
Hits the model at tool-choice time; duplicates formatting unless shared with identity (see recipients.ts header). Good follow-up if identity-only text drifts again. |
Shared helper (isWorkerDelegate(me, worker) in delegates/ or recipients.ts) |
Removes duplicated delegates === "all" || includes and the (typeof taskOnly) typing quirk when isDelegate is applied to messageable. Small hygiene win. |
Keep DELEGATE_* unexported |
Tests could assert substrings; only worth it if you want zero new public constants ( TOOL_USE_RULE is already exported the same way). |
Runtime redirect/refuse sendMessage → delegate for "work-shaped" messages |
Stronger guarantee, much larger product/design surface; out of scope for a closure fix. |
Skipped (not worth blocking)
- Second pass
messageable.some(isDelegate)beforemap— roster capped at 25; irrelevant. teammate()one-liner — readability is fine either way.
Checks
pnpm --filter @flow-state-dev/workforce test -- worker-identity (full workforce suite) — 1717 tests passed on this branch.
Cursor automation — simplify pass
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob
The prompt is already the small shape. DELEGATE_MARK, DELEGATE_RULE, one line that appends the mark, and one line that adds the rule when a messageable delegate exists. I left that text, the changeset, the architecture sentence, and the goal logs alone. I also left the recorded delegate-check note alone: using flowTakes changes who gets the mark.
The extra size is two new tests that boot the board again for eng.ana and eng.bo. Those turns already exist in "lists who a message reaches" and "never tells a worker to file a task for a task-only worker that isn't its delegate". Fold the four expects into those turns: the cy line with the mark, the unmarked bo line, DELEGATE_RULE, and the absence of the mark and the rule on bo.
Draft POC, do not merge: #4264 (poc/shorter-delegate-identity-tests @ 7fc8c977795be4acc0ff5e3752e776b6bc7ddd9e).
packages/workforce vitest run test/worker-identity.test.ts: 6 passed. With the mark and the rule removed, the ana turn fails on - cy (eng.cy): Researches. (your delegate: takes your tasks too).
Agent on this PR: fold that subtraction, then close the POC unmerged after this PR lands.
Head bfd90fabff7cdd7dcea46f6343e2f13689e73577.
Sent by Cursor Automation: Code Snob
Codex review: the mark read the worker's file, while the board takes a task for the conversation's list once addDelegate or removeDelegate has set it. The layer now reads that list when it is set, else the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiH4wEhbNtsBnU8xobe
Review (Code Snob): the two new tests booted the board again for turns the file already runs; their expects move into those turns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiH4wEhbNtsBnU8xobe
|
Code Snob's fold is applied in c6d6508: the delegate-mark expects now run in the existing ana and bo turns, and the two extra board boots are gone (8 tests pass). The POC #4264 can be closed unmerged once this lands. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6d6508a1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review: with delegates: all (or an explicit default), a messageable worker whose flow lacks the contributor role was marked as taking tasks, and the board's delegate check refuses its task. The mark now reads flowTakes, the same fact the check reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiH4wEhbNtsBnU8xobe
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3d6b03193
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review: the lists stop at MAX_LISTED_RECIPIENTS, so past the cap a delegate can be missing while the layer said no lookup was needed. A cut list now sends the model to listDelegates for the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiH4wEhbNtsBnU8xobe


Requested by Jake · project thread
What broke
FIX-2152's closure re-run on main
863a0e13found a regression in the default prompt layer added by FIX-2334 (#4223). The layer lists a worker's messageable delegates only as teammates you can message, and it never says they take tasks.desk.researcherwithsendMessageand filed no task. No row showed, so nothing could be stopped. It failed 0 of 6 attempts over two runs. With the layer patched out (the goal's module-patch hook), the same run passed on attempt 1.gpt-6-luna, Chief of Staff looked its teammates up withlistDelegatesin 3 of 3 runs (1 of 3 ongpt-5.4-mini).The change
In
packages/workforce/src/messages/worker-identity.ts:(your delegate: takes your tasks too).createTask.The contract line in
docs/architecture/workforce-default-worker-flow.mdand the still-unreleased FIX-2334 changeset are updated to match.Evidence
worker-identity.test.ts(new test)answer-again-offno-identityAll of these ran with real models (gpt-5.4 / gpt-6-luna, plus Claude Code for the coding steps) in a headless browser. Verdict rows are added to the three goals' logs.
Note for review: on main, the worker-talks step 5 also failed once. Its "no project on the page" check matched Chief of Staff's own words "the current project", which is model wording and not a project the lab showed. The run on this change passed. If it flakes again, that check needs narrowing to the lab's project UI.
No Linear issue was filed for this finding yet, because the Linear write is blocked in this session. It is tracked under the closure issue FIX-2156 until one exists.
Generated by Claude Code