Skip to content

fix(workforce): a best-fit follow-up keeps its conversation's context (FIX-1828) - #2955

Merged
jhoffner merged 11 commits into
mainfrom
fix/FIX-1828-followup-context
Oct 9, 2026
Merged

jhoffner merged 11 commits into
mainfrom
fix/FIX-1828-followup-context

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

The problem

On a coordinator with routing: best-fit, a follow-up lost the conversation it belonged to. Best fit picked the delegate from the post's own words, and the delegate that took it saw only that post.

  • Someone asks about their laptop's wifi and the IT specialist answers. They write back "It sees it. It fails right after the password." On real models that went to the accounts specialist, because "password" is in its description.
  • In a scripted run, "Where can I buy it?" was answered "Buy what?".
  • The mailbox that coordinators replace kept the thread, so this was a regression for every desk moving off it.

What this does

Every post now travels with its conversation's recent lines: the person's posts, the coordinator's own replies, and the delegates' answers that landed, oldest first, each under who wrote it.

  • Best fit reads the post with them. Its one evaluation is handed { recent, post } and asked to send a post that follows up on a delegate's answer to that delegate. The laptop follow-up now reaches the IT specialist.
  • The delegate that takes a post sees them too, whatever the routing. They reach its model as one user-role message just before the post, for that one turn, never as system text, so a line written like an instruction has no more authority than the post. The delegate's own session never keeps them.
  • An answer that has just landed counts. A follow-up sent the moment an answer shows up is routed and delivered with that answer among its lines, even before the request that landed it has finished.
  • Bounded: the last 10 lines, at most 4,000 characters in all, newest kept first. The line that crosses the cap is cut short with …; older ones are left out. That is roughly 1,000 extra tokens per evaluation and per delegate turn, at most.
  • This conversation only. The lines are read from the coordinator conversation's own stored messages. A delegate never sees another conversation.

Judgment routing is unchanged: its turn already reads the conversation. Round robin and everyone route as before; their deliveries carry the lines because the delegate needs them.

What's asked of you

Nothing here is yours to decide: you already decided that follow-ups keep the conversation's context, and this implements that. One thing to know: under routing: everyone, each delegate's turn now carries up to 4,000 characters of lines. That is the cost of the decision, and it is bounded.

This unblocks FIX-1792 P1 (#2938), which restores its retired followup and context legs (a-routed-post-gets-one-answer) once this merges. Best fit's evaluation state is { recent, post }, with each line as { from, text }. That is the shape the mailbox's evaluation had, so those legs' scripted route reads it unchanged.

Parts worth reviewing closely

  • SessionItem gains role (packages/core/src/types/scope.ts, packages/engine/src/context/history.ts). This is a small additive change in two framework packages. Without it, items.all() can't tell the person's post from the coordinator's own "Nobody took this post" message: neither carries an agentName, and history() has the role but drops who wrote each line, which is what best fit needs. The reasoning is in "Engineering calls".
  • coordinator-lines.ts: which messages count as lines, who wrote each one, and the two bounds.
  • delegatedPostHistory (delegated-post.ts): a new export. The entry notes the post's lines in request state. delegatedPostHistory is a generator history that inserts them as one user-role message between the earlier turns and this request's own items, so just before the post. It is resolved per call and never stored. The built-in agent's generator uses it in place of history: true, and on any other turn it is that history unchanged. A custom delegate flow sets it as its own generator's history. The door's { message } input is unchanged, so no existing door breaks.
  • landedAnswers (session state, server-owned): the claim that lands an answer keeps it (the last 10, each cut to 4,000 characters) in the same atomic write that releases the hold. A reader adds each kept answer whose request isn't among its loaded items yet. This closes the window between an answer appearing and its request finishing.
  • postOf's dual-read: a request whose post state was written before this change, and resumed since, reads as having no lines (BP-030). It is not under test, because building a cross-version resume needs a durable host. Cleanup: remove it once no such request can resume.

Spec: none (bug route) · Linear: FIX-1828 · Epic: FIX-1786 · Merges independently; #2938 follows it.

How to review this

How to review this. This is a bug fix on the direct route: there is no spec and no
spec PR, because the hard part was the diagnosis and it happened in code. This PR is the
only gate
, so unlike a spec-backed change, the approach is in scope: nothing here was
signed off upstream.

Most valuable here: the diagnosis chain. Does the repro actually reproduce the reported
failure, is the named cause the real one, does the fix address that cause rather than the
symptom, and does the regression test fail without the fix? Then the second path (the legacy
shape, the null boundary, the concurrent case, the cancel path).

In scope to challenge: where the guard was placed, any behaviour change a user could
notice, and whether this should have been a spec'd feature instead of a fix.

Engineering calls
  • Lines come from the conversation's own items, not a new ledger. The mailbox kept a copy of its last 20 lines in session state, because its reads and fan-outs used up the request's history window. A coordinator conversation's requests are posts, answers and route-ons, so the window (its last 50 completed turns by default, each request one turn) holds its recent lines, and a second store would be a copy of the items that has to be kept in step. Limit: a line older than the window isn't offered, even when it is within the 10.
  • Read once per post, carried everywhere. postStateOf reads the lines into the post's request state. Best fit's case and every deliveryOf, under every policy including the judgment turn's handOff, take them from there. No second read can disagree with the first.
  • Who wrote a line. role: user is the person (the session's user id). An assistant message under a delegate's agentName is that delegate. An assistant message under coordinator-judgment*, or with no agentName (the "Nobody took this post" message), is the coordinator's worker id. Only messages visible in the conversation and its history count, so the skill classifier's hidden output never becomes a line.
  • Why role on SessionItem. The fix belongs where the information is lost. outputItemToSessionItem dropped the message's role, so all() / selectForContext(), documented for building custom prompt context, could not say who spoke. The change is additive and optional, and appears only on message items. I considered three alternatives and rejected each. Giving the coordinator's notice an agentName changes what clients render under every policy. Inferring the person's post from item order relies on engine internals. Zipping history() with all() is fragile under concurrent requests.
  • Bounds: 10 lines, 4,000 characters. Fixed constants (RECENT_LINES, RECENT_CHARS), as the brief asked and as the mailbox's 20 was. Cutting the crossing line, rather than dropping it, keeps the newest answer, which is the one a follow-up most often continues. If a caller needs different bounds, they could become defaulted options on defineCoordinatorFlow; that wasn't added here.
  • A per-call user-role message, not the post's text and not the system text. The lines never go into the delegated post's message text, because that text is stored as the delegate's user turn. They would pile up in the delegate's history and break FIX-1792 P1: coordinators without boards (kitchen-sink's help desk, the pentest lab, the desk fixtures) #2938's context leg, which checks that the delegate's stored conversation holds no other post's line. They never go into a context slot either: those render into the system message, which would give an earlier post system authority. A generator history entry is the framework's per-call, never-stored message, so the lines go there, with the user role, just before the post. Note for FIX-1792 P1: coordinators without boards (kitchen-sink's help desk, the pentest lab, the desk fixtures) #2938: its scripted answer should look for the item in that user-role message, not in the system text. This also leaves the door's input contract alone, so a custom door with a strict input schema still works.
  • Exact coordinator names. A line is the coordinator's only when its agentName is one of the judgment turn's generator names, which agentWorkerTurn now returns (answerNames), or absent. A delegate named coordinator-judgment-… keeps its own id.
  • Just-landed answers through session state. The engine gives a block only finished requests' items and doesn't expose an in-flight sibling's. So the coordinator keeps each landed answer in session state before saying it, and readers merge in the ones their items don't hold yet. A kept answer older than the oldest message in reach is left out, as its request is.
  • BP-031. The routing decision reads only the post text and the conversation's stored messages. Who wrote each line comes from the runtime-set role and from the coordinator's own agentName, which it stamps from the delivery record. The lines reach a delegate only on the internal onDelegatedPost entry. A caller can't hand lines in through run: its input is { message }, and the agent's action schema strips anything else.
  • Changesets: a patch for @flow-state-dev/workforce (the behaviour and delegatedPostHistory), and a patch for @flow-state-dev/core + @flow-state-dev/engine (SessionItem.role).
  • Docs were written in-session, then revised after a docs-editor pass (REVISE). The revisions: the follow-up wording now says what best fit can do, the README drops shapes no public API shows, the coordinator page shows a filled-in context section and who each line names, the history window is counted in completed turns, and role lists only the two roles the framework writes. The docs site builds with no broken links or anchors.
  • A doc inaccuracy fixed on the way: coordinators.md said every reply the coordinator writes itself carries an agentName starting with coordinator-judgment. Its "Nobody took this post" message carries none, and the page now says so.
Everything else: verification and file-by-file

Red, then green (scripted models, packages/workforce/test/coordinator-followup-context.test.ts)

On main at ddaec6167, the three conversation tests fail. The unit tests for the new module were left out of that run, since the module doesn't exist there.

  • best fit: the follow-up went to accounts (want devices, which answered the opener);
  • the delegate never sent the item post answered Buy what? (want Buy the item-… at the shop.);
  • the first post's evaluation state had no recent (want []).

On this branch all 12 pass. They cover: the follow-up goes to devices by evaluation, which was handed [{from: alice, …}, {from: devices, …}], and devices' turn was shown both lines; under round robin, accounts (never sent the item post) answers from the lines, and its own stored conversation keeps no message carrying them; an app's own delegate flow with delegatedPostHistory sees them; the first post has no lines and no section; who wrote each line; the 10-line cap; the 4,000-character cap with the crossing line cut.

Three tests from the review round each failed on 3398e44a9 and pass on 3f9fd8ace:

  • never as system text: an earlier post holding an instruction-shaped line. On 3398e44a9 the system text contained it. Now it is only in the one user-role lines message.
  • an answer that has landed while its request is still finishing: the answer request's completion write is held open. On 3398e44a9 the follow-up went to accounts. Now it goes to devices, with the answer among the evaluation's lines. Mutating the reader to ignore kept answers turns it red again.
  • a delegate whose id starts like the coordinator's own turn: a delegate coordinator-judgment-specialist. On 3398e44a9 its answer was labelled desk and the follow-up went to accounts. Now it keeps its id and gets the follow-up back.

Mutations, each reverted:

  • role dropped in outputItemToSessionItem: both conversation tests fail.
  • The delegate-side lines removed from the agent turn (an earlier round, on the capability): the context assertions fail (Buy what?) while routing still passes.
  • The same removed from the app's own generator: that test fails with Buy what?.

Real models: goals/coordinators/routes-a-follow-up-by-its-conversation. This is a new goal with two held-out threads, each a follow-up whose words alone point at another specialist.

  • PASS on attempt 1 of 3. Both follow-ups reached the opener's specialist by: evaluated, one answer each.
  • GOAL_CONTROL=no-recent (the evaluation handed { post } alone) fails at followup:delegate on both threads and nothing else. "It sees it. It fails right after the password." went to accounts.
  • Under the control, the misrouted delegate still answered on topic, because it was shown the lines. That is criterion 2 on real models, as a side effect.
  • The container's model-override env vars swapped the answer model on the first two runs. The runner now strips them; the verdict log records both pairs.

Suites

  • pnpm --filter @flow-state-dev/workforce test: 99 files, 1348 tests pass, on the head merged with main.
  • @flow-state-dev/engine vitest: 271 files, 3635 pass (6 skipped), including two new outputItemToSessionItem cases.
  • pnpm exec turbo run typecheck --concurrency=2: 74/74. The root guards (package boundaries, updater purity, side-chain vocabulary, goals control shape) pass.
  • tsc -p goals --noEmit: clean.
  • node scripts/validate-changeset-refs.mjs: every new changeset names its issue.

Files

  • packages/workforce/src/coordinator/coordinator-lines.ts (new): the line shape, readRecentLines, recentLines, the bounds.
  • coordinator-flow.ts: lines read in postStateOf, carried in the post state, best fit's case, the evaluation's state and question, and every delivery; the postOf dual-read.
  • delegated-post.ts: recent on the post, noted in request state; delegatedPostHistory.
  • coordinator-keys.ts, coordinator-delegates.ts: landedAnswers, server-owned.
  • agent-worker-flow.ts: the agent turn's generator history is delegatedPostHistory, and the turn returns its answerNames. coordinator/index.ts: exports delegatedPostHistory.
  • packages/core/src/types/scope.ts, packages/engine/src/context/history.ts (+ spec): SessionItem.role.
  • Docs: apps/docs/docs/workforce/coordinators.md (follow-ups and recent lines; custom flows), apps/docs/docs/streaming/items.md, docs/architecture/generator-identity.md, packages/workforce/README.md.
  • goals/coordinators/routes-a-follow-up-by-its-conversation/ (new); two .changeset fragments.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV


Generated by Claude Code


Note

Medium Risk
Changes coordinator routing, delegate prompt assembly, and public SessionItem shape; behavior is bounded but affects every delegated post and best-fit evaluation.

Overview
Fixes FIX-1828: best-fit coordinators no longer route follow-ups from the post text alone, and delegates no longer answer with only that post.

Conversation recent lines are read once when a post opens (last 10 messages, up to 4,000 characters, this conversation only). Best fit’s evaluator now gets { recent, post } and is prompted to send follow-ups back to the delegate that last answered. Every delivery carries the same lines, regardless of routing policy.

Delegates see those lines for one turn as a single user-role message inserted via new generator history helper delegatedPostHistory (built-in agent uses it instead of history: true). Lines are not stored in the delegate session and are not injected as system text.

SessionItem now includes optional role on message items from all(), client(), and selectForContext(), so line assembly can distinguish the caller from coordinator vs delegate replies (outputItemToSessionItem in engine).

landedAnswers session state records answers at claim time so a follow-up routed while the landing request is still in flight still includes that answer in recent.

Docs, changesets, integration tests (coordinator-followup-context.test.ts), and a real-model goal exercise the behavior; a no-recent control confirms routing fails without lines while delegates still get context on delivery.

Reviewed by Cursor Bugbot for commit 21b737a. Configure here.


Generated by Claude Code

claude added 2 commits October 9, 2026 17:43
… (FIX-1828)

Best fit chose a delegate from the post's words alone, and the delegate
that took a post saw only that post. A follow-up like "It sees it. It
fails right after the password." went to whichever delegate's
description mentioned passwords, and "Where can I buy it?" got "Buy
what?".

Each post now opens with its conversation's recent lines, read once
from the coordinator conversation's own items: the person's posts, the
coordinator's replies and the delegates' answers that landed, the last
10 and at most 4,000 characters, newest kept first. Best fit's
evaluation reads { recent, post }, and every delivery, by any policy,
carries the lines to the delegate. delegatedPostCapability shows them
to the delegate's model for that turn only; the built-in agent turn has
it, and an app's own delegate flow adds it to its generator's uses.

To tell a person's post from the coordinator's own notice in
items.all(), a SessionItem for a message now carries its role.

Adds a goal, coordinators/routes-a-follow-up-by-its-conversation, with
a no-recent control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…nd log its verdicts (FIX-1828)

The container's FSDEV_DEFAULT_MODEL / FSDEV_INTENT_* overrides swapped
the delegates' answer model under the app's resolver, so the run now
strips them first, and installs a silent runtime logger so the attempts
and the verdict are what it prints. The verdict log records the green
runs and the no-recent control failing at followup:delegate alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Oct 9, 2026 8:17pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 9, 2026 8:17pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 9, 2026 8:17pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 9, 2026

Copy link
Copy Markdown

FIX-1828

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: ef21a837-a823-4a53-b520-00afced1734d)

…line names (FIX-1828)

Docs-editor fold on the coordinator page and the workforce README:

- A follow-up "can go back to" its delegate under best fit; the other
  policies don't route by the lines.
- The README drops shapes no public API shows, keeping the one an
  evaluation model passed as routeModel is handed.
- A filled-in context section, with who each line names.
- The history window is counted in completed turns, as the other pages
  and the engine count it.
- A message item's role: the framework writes user and assistant only.
- The coordinator's "Nobody took this post" message carries no
  agentName.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 0370b5a1-dbaf-499d-806b-bf786e8a4c89)

… desk writes (FIX-1828)

The example put a coordinator hand-off line in a best-fit desk's
conversation, but a best-fit hand-off writes only a routing record,
which is never a line. The example keeps the person's line and the
delegate's, and a note says when a coordinator line does appear: a
reply from its own turn, or "Nobody took this post".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 8c6ddecc-d6d3-4f29-a518-35f7b9aa3cd3)

@jhoffner
jhoffner marked this pull request as ready for review October 9, 2026 18:08
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 50a062aa-5a8b-425c-833b-21125e1eb4b2)

@jhoffner

jhoffner commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T18:15:15.698335Z 3398e44 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Snob — already tight. No POC.

Head 3398e44a9803f86a69ab9903ea18df52b3a845c8. I read packages/workforce/src/coordinator/coordinator-lines.ts, delegated-post.ts, coordinator-flow.ts, packages/workforce/src/agent-worker-flow.ts, packages/core/src/types/scope.ts, packages/engine/src/context/history.ts, and packages/workforce/test/coordinator-followup-context.test.ts.

A rewrite would not shrink the contract:

  • recentLines is the pure bound the unit tests call. readRecentLines is the one session query. Folding them makes those tests stub items.all(), which is more code.
  • A uses entry can only add generator context through a preset. One preset, on by default, is the smallest capability. Putting recent on the turn input, the way the mailbox already does, would change the door's { message } input this PR kept so a strict custom door still accepts a delivery.
  • Best fit copies { recent, post } onto the case because that is the evaluation state a scripted route reads. Reading it back off request state inside state() saves a field and ties.
  • SessionItem.role is one optional field and one spread. The other ways to name the speaker are already recorded on this PR.

The new desk in the follow-up test is not a second coordinator-harness.ts. Those doors are handlers, so they never see a context section.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify review (FIX-1828)

Verdict: The core approach looks right for the problem. Recent lines have to exist in two places at once — best-fit’s evaluation and the delegate’s one turn — while delegates run in their own sessions, so read once when the post opens and carry a bounded snapshot on PostState → delivery → delegated post is simpler than re-reading the coordinator session at dispatch time or teaching delegates to pull from the filing session. SessionItem.role on core/engine is the minimal platform fix for attribution; splitting that into a follow-up PR would not shrink this change much.

Where the diff is heavier than it needs to be (follow-ups, not blockers):

  1. Duplicate transcript formatting — delegatedPostLines mirrors recentLinesContext in agent-worker-flow.ts (heading + - writer: text bullets). One small shared formatter (mailbox + coordinator headings as parameters) would cut drift risk.
  2. Second mini harness — coordinator-followup-context.test.ts reimplements much of coordinator-harness.ts (openDesk, scripted route, HTTP boot). Extending the existing harness for state.recent and [follow-up] routing would shrink ~200 lines and keep coordinator tests on one pattern.
  3. recent optional vs always-present — PostState normalizes to recent: [] (BP-030), but delegated post / delivery state still uses “omit when empty” in several places. Picking always an array on the wire (or one includeRecent(recent) helper used everywhere) would remove repeated undefined || length === 0 branches.
  4. readRecentLines → items.all — Correct for “what the person sees,” but it scans the full history window before keeping 10 lines. Fine at default limits; if post-open latency ever matters, a newest-first walk (or a tail-biased items API) would be a localized optimization, not a redesign.

Alternative considered: Load recent lines inside delegatedPostEntry from filingSessionId instead of threading through schemas. That avoids four schema touchpoints but adds cross-session I/O, auth, and “lines before this post” timing on every delegate turn — more moving parts than copying ≤4k chars once.

Skipped (needs product call): Unifying RECENT_LINES (10) with mailbox’s 20; auto-injecting context without delegatedPostCapability (capability opt-in matches mailbox and custom flows).

No major concerns — approving with the nits above as optional tighten-ups before or after merge.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3398e44a98

ℹ️ 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".

claude added 3 commits October 9, 2026 18:33
…ude a just-landed answer, and never mistake a delegate for the coordinator (FIX-1828)

Three review findings, each with a test that failed on the previous head:

- The lines reached a delegate's model through a generator context slot,
  which renders into the system message, so an earlier post written like
  an instruction got system authority over the delegate's instructions.
  delegatedPostHistory replaces delegatedPostCapability: a generator
  history that puts the lines in as one user-role message just before
  the post, for that call only and never stored.
- A request reads only finished requests' items, and an answer is in the
  conversation a moment before the request that landed it finishes. The
  claim that lands an answer now keeps it in session state
  (landedAnswers, server-owned, the last 10), and a reader adds each one
  whose request its items don't hold yet.
- A delegate whose id starts with coordinator-judgment was read as the
  coordinator. Lines now match the judgment turn's exact generator names,
  which the agent turn returns.

linesField is the one rule for a post's recent: present only when there
are any. Docs, README and the changeset follow the delivery change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
PASS on attempt 1, and the no-recent control failing at
followup:delegate alone, with the lines delivered as a user-role
message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 1dabc449-6378-4363-af06-3563ade807aa)

claude added 3 commits October 9, 2026 19:55
# Conflicts:
#	packages/workforce/src/agent-worker-flow.ts
… for a closed round's pass-on (FIX-1840)

Every delegate's answer, every routing and every pass-on writes the one
coordinator conversation's state, and the flow ran on the engine's
default CAS budget of 3 retries. Under contention a pass-on's delivery
write could lose four times in a row; its request then failed after its
round had already closed, and the round's answers never went back out.

The coordinator flow's session now sets cas.maxRetries to 8. The new
test makes the write that opens a pass-on delivery lose to another
writer four times in a row: at the default budget the delegate never
gets the other's answer; at 8 it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
… serves reports blocked (FIX-1828)

Each model the run calls must have a key that serves it here. Only the
gateway serves the route model, so an OpenAI-only box reports blocked,
naming the model and the keys that would serve it, as the other
coordinator goals do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV

jhoffner commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

About the red Test (2/3) on fd687c3b3. It failed at coordinator-rounds.test.ts:602, in a delegate that never answers › closes an overdue round on the conversation's next wake, once, and the new post routes as well. The coder never got the EM's answer from the overdue round.

It isn't this PR's. Under CPU load, main's own sources fail the same test at the same rate: 4 of 30 runs, against 5 of 45 on this branch. Every failure is the same:

  • The request that passes the closed round's answers on (routeOn) failed with concurrent_modification after 4 attempts.
  • At that moment, the conversation's answers, routing and pass-on all write the same record. The coordinator ran on the engine's default budget of 3 retries.
  • The round had already closed, so its answers never went back out.

What's done. The fix is FIX-1840 (#2983): the coordinator's session allows 8 retries. It is ported into this branch as d2a15b52b, and becomes a no-op once #2983 merges.


Generated by Claude Code

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 4300849d-6d8f-4e71-bfc9-32daf3495072)

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 2a90ea0e-2e89-407b-bd8a-56de569f3e8b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants