Repository navigation
FIX-2429: task board changes reach open screens as notices, and the board polls go off - #4616
Conversation
Every change a task collection makes (the onChange adapter in getOrCreateTaskCollection) also publishes a `board` notice on the topic of the session that filed the row, narrowed to the board, through a new engine seam on the block context. The board views in Shift Manager, the Teammates and claude-code-style labs, and a live BoardList read on those notices through client.subscribe / useSubscription, with today's pace as the fallback where push can miss a change. Goal check: goals/task-board/a-settled-task-reaches-the-board/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Leg b's window could open on the last read of a view's opening burst (the filing's notice and the Postgres bus's resync landing after the sockets crossed). Both legs now wait until no view has sent a board read for 1 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
|
@codex review — least sure of: (1) Generated by Claude Code |
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. |
Mechanism check (advisory, never blocks)Rows from
If an export is a new mechanism, add a row. CI filled the mechanical fields; - id: TODO
job: TODO
package: "@flow-state-dev/core"
anchor: publishBoardChange
file: packages/core/src/types/board-notice.ts
builtOn: [] # TODO
overlaps: [] # TODO
status: canonical
doc: TODO |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96d51ebf7b
ℹ️ 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".
| listed = new Map(read.tasks.map((task) => [task.id as string, task])); | ||
| publish(); |
There was a problem hiding this comment.
Suppress board-read publication after unsubscribe
When a user switches conversations while a board read is in flight, its completion still calls publish() after watchTasks has been stopped. Because useWatch passes its state setter directly to the watcher, this can display the previous conversation's tasks under the new conversation. publish() also calls followRuns, potentially opening run-session subscriptions after cleanup has already traversed runFeeds, leaving those subscriptions unclosed. The live check in onBoardChange only guards starting a read; unlike the previous poll implementation, it does not guard delivery after the await. Check that the watcher is still active before updating listed and publishing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2d2e… (see edf30c5): watchTasks now sets a stopped flag on cleanup, and both the board read (after its await) and publish() check it, so a read landing after the watch stopped shows nothing and followRuns opens no run feed. Test first: labs/teammates/test/run-link.test.ts → "a board read still in flight when the watch stops" failed (expected … to have a length of 2 but got 4), then passed. The claude-code-style helper already checks live after its await; Shift Manager's reads are latest-started-wins and drop an older read, so neither had the gap.
🤖 Generated with Claude Code
Generated by Claude Code
… fixes - Teammates watchTasks: a read or lookup landing after the watch stopped shows nothing and follows no run (Codex r4459527555). - Keep LIVE_BOARD_POLL_MS and AFTER_A_MOVE_MS internal (Fallow). - Docs: listTasks_tasks screens subscribe both tasks and plan; editor wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
…tended (FIX-2429) fallow audit counts LabAdapter, Unsubscribe and createLabAdapter as duplicate exports once a PR touches both adapters. Each lab is its own app with the same adapter shape on purpose, so suppress only that rule, per file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
|
@codex review Your last review was on
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: 56a2872b58
ℹ️ 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".
| const tasks = await readConversationTasks(client, worker.kind, sessionId); | ||
| if (mine !== latest.current) return; | ||
| setRead({ tasks }); |
There was a problem hiding this comment.
Invalidate Shift Manager board reads on unmount
If a board re-read is in flight when the user navigates away, unmounting never changes latest.current, so this guard still accepts its completion. When that response shows a changed task status, it calls the shared refresh() and starts a full Lab refresh after the panel's subscription has stopped; React ignoring the local setters does not suppress that side effect. useSubscription only drops queued reads, not an already-running callback. The same gap exists in TaskBoardMeta.tsx's LiveBoard.readBoard. Restore lifetime invalidation for both readers so cleanup prevents late completions from publishing or refreshing, as the previous closed check did.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed at the cause (head 02d4072): useSubscription now hands read an AbortSignal (second argument), aborted when the subscription ends: on unmount, or when the topics or options change. TasksPanel.readTasks and LiveBoard.readBoard check signal.aborted after their await, before they set state or call refresh(). Their own readAt effects pass a signal of their own too, aborted on cleanup. Tests that failed first: useSubscription.test.ts (two cases: the signal aborts on unmount and on a topic change, Cannot read properties of undefined (reading 'aborted')); conversation-tasks-panel.test.tsx and task-card-in-feed.test.tsx, "reloads nothing when it unmounts with a read still in flight" (1 refresh, expected 0). All pass now. The signal is documented in the react README and api/react.md.
🤖 Generated with Claude Code
Generated by Claude Code
…ops reads that land after unmount A read already running when the subscription ends still finished and could set state or start a Lab refresh (Codex r4459947789). The hook now aborts a signal on cleanup; TasksPanel and LiveBoard check it after their await, and their own readAt effects pass one too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Brings in FIX-1506 (#4613). Conflicts resolved so both sides survive: ChangeKind keeps state and resource beside board; the board seam publishes through main's publishNotices (per-request folding); BoardList's board driver uses the shared LIVE_POLL_MS beside liveScopeDriver; docs list every kind and keep both halves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
…tended (FIX-2466) Same suppression as #4616: fallow audit counts the shared adapter exports as duplicates once a PR touches both labs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
There was a problem hiding this comment.
Simplify review (FIX-2429)
Problem this PR solves: open task-board views only heard changes on the conversation session stream, so a row settled in another session/process never woke the panel. The fix needs a server-trusted signal on the filer’s session, narrowed to the board, without treating every streaming items notice as a board refresh.
Verdict: the framework shape is the right simplification, not an overreach. A dedicated board notice + publishBoardChange at the existing onChange hook mirrors the dispatch seam, reuses publishNotices, and lets React drop followSession / namesBoard / per-item dedup in liveBoardDriver in favor of one narrowed client.subscribe. That is less machinery than continuing to filter the session stream.
Alternatives considered (and why I would not swap the approach):
- Keep session streaming + smarter filtering — still wakes on unrelated conversation traffic and does not solve cross-session settlement without duplicating filer logic in every consumer.
- Reuse generic
resourcenotices only — the filer session + board id is exactly whatboardencodes; overloading resource routing would push the same semantics through a less precise channel. - Third-party package — nothing off-the-shelf fits your change bus + narrowed session topics; a thin seam here is appropriate.
Where complexity landed (mostly app layer, good follow-ups):
- Shift Manager:
TasksPanelandTaskBoardMeta/LiveBoardnow share the sameuseSubscription+conversationBoardTopics+latestguard + conditionalpollIntervalMspattern. When both mount for one conversation, you get two subscribe handles and twolistTasks_tasksreads per notice (same class of duplication as the old dual poll loops, but worth collapsing into one hook/provider before more surfaces copy it). - Topic spelling:
"tasks"/"plan"appear in shift-manager, both labs, and docs; workforce already has ledger ids — one browser-safe export +listTasks-subscribe helper would prevent drift. - Labs:
onBoardChangein claude-code-style and teammates is nearly the same coalesce + subscribe wiring; a shared client-side helper (labs lib or@flow-state-dev/client) would shrink the diff without changing behavior. - Smaller nits: mount
useEffect+ subscribe connect both trigger reads; togglingpollIntervalMsresubscribes when the last open task quiesces; Teammates may still stream-merge and full-list-read on same-session mutations (cross-session case is the win).LiveBoardswallows read errors silently while the panel surfaces failure — minor inconsistency.
Performance: net win vs whole-session follow/poll; the duplicate Shift Manager subscribers and optional Teammates double-refresh are the main things to watch, not blockers for this issue.
Tests / goal: the graded goal harness is heavy but matches how you anti-game cross-process settlement; I would not shrink it in this PR.
Approving on architecture and direction. Inline notes are optional cleanups — none are required to merge FIX-2429.
Sent by Cursor Automation: Review For Best Approach
| }, [readTasks, readAt]); | ||
|
|
||
| const topics = useMemo(() => (sessionId === null || worker.kind === null ? [] : conversationBoardTopics(sessionId)), [sessionId, worker.kind]); | ||
| useSubscription(topics, readTasks, { client, ...(timed ? { pollIntervalMs: TASKS_POLL_MS } : {}) }); |
There was a problem hiding this comment.
Duplicate live-board wiring: this useSubscription block mirrors LiveBoard in TaskBoardMeta.tsx (same topics, latest guard, standing/refresh-on-move, gated pollIntervalMs). When the tasks panel and feed scope mount together, each board notice triggers two listTasks_tasks reads and two poll timers on the same client.
Simpler follow-up (not blocking): extract something like useLiveConversationTasks({ client, flow, sessionId, readAt, pollWhen }) under shift-manager/src/lib/ and mount the subscription once (context or parent), feeding both UI surfaces.
There was a problem hiding this comment.
Thanks. No change in this PR: this is tracked as follow-up work (one shared live board subscription per conversation, and shared ledger topic names). Leaving the thread open.
🤖 Generated with Claude Code
Generated by Claude Code
| import { CONVERSATION_BOARD_COLLECTION, describeFailure } from "./reads"; | ||
|
|
||
| /** The plan ledger's id (Workforce's `PLAN_LEDGER_ID`, pinned): a planning worker's own steps. */ | ||
| const PLAN_COLLECTION = "plan"; |
There was a problem hiding this comment.
PLAN_COLLECTION = "plan" duplicates workforce’s PLAN_LEDGER_ID, and the two-topic list is copy-pasted in both labs as BOARD_LEDGERS.
Optional: export ledger ids (and a single conversationListTasksBoardTopics(sessionId) helper) from @flow-state-dev/workforce/browser or next to topic on client so shift-manager, labs, and docs share one spelling.
There was a problem hiding this comment.
Thanks. No change in this PR: this is tracked as follow-up work (one shared live board subscription per conversation, and shared ledger topic names). Leaving the thread open.
🤖 Generated with Claude Code
Generated by Claude Code
| const now = tasks.map((task) => `${task.id}:${task.status}`).join(","); | ||
| if (standing.current !== undefined && standing.current !== now) void refresh(); | ||
| standing.current = now; | ||
| setMoving(tasks.some(isOpen)); |
There was a problem hiding this comment.
Bare catch { } here hides read failures (the panel uses describeFailure). Minor UX/ops inconsistency if you extract a shared hook anyway.
There was a problem hiding this comment.
Thanks. No change in this PR: this is tracked as follow-up work (one shared live board subscription per conversation, and shared ledger topic names). Leaving the thread open.
🤖 Generated with Claude Code
Generated by Claude Code
| * notices. Wherever push can miss a change, `client.subscribe` reads every | ||
| * `everyMs` instead. | ||
| */ | ||
| function onBoardChange<T>(client: Client, sessionId: string, read: () => Promise<T>, onChange: (value: T) => void, everyMs = TASKS_EVERY_MS): Unsubscribe { |
There was a problem hiding this comment.
Near-duplicate of teammates’ onBoardChange (manual run/queued coalesce + BOARD_LEDGERS + client.subscribe). Fine for FIX-2429; a shared non-React helper would be the next simplification if a third lab copies this again.
There was a problem hiding this comment.
Thanks. No change in this PR: this is tracked as follow-up work (one shared live board subscription per conversation, and shared ledger topic names). Leaving the thread open.
🤖 Generated with Claude Code
Generated by Claude Code
| // stream; the notice reaches every open view of the filer's board, from | ||
| // whichever session and process settles the row. Server-written (BP-031). | ||
| const filer = event.task.filer?.sessionId ?? legacyFiler?.(event.task) ?? runningSession; | ||
| if (filer !== undefined) publishBoardChange(options.ctx, { sessionId: filer, board: event.collectionId }); |
There was a problem hiding this comment.
Publishing a board notice on every onChange is correct for freshness; under heavy row churn this can fan out many notices (microtask fold helps within a turn, not across turns). If you ever see bus/socket pressure on busy boards, coalesce at this boundary (e.g. once per request turn) before adding client-side complexity.
There was a problem hiding this comment.
Thanks. No change in this PR: this is tracked as follow-up work (one shared live board subscription per conversation, and shared ledger topic names). Leaving the thread open.
🤖 Generated with Claude Code
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: 02d4072fc0
ℹ️ 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".
| // that reads again. The conversation's copy keeps what the read leaves out (a result's output). | ||
| const merged = (): Record<string, any>[] => { | ||
| const all = new Map(rows); | ||
| for (const [id, row] of listed) all.set(id, { ...all.get(id), ...row }); |
There was a problem hiding this comment.
Normalize projected spend before merging board rows
When a task has reported its harness and model, a board read now overwrites its raw spend.requests data with the already-folded TaskSpendView returned by listTasks. However, toBoardTask still passes that value through spendOf, which calls taskSpendView again: the missing requests defaults to an empty array, so it returns null. Consequently, the next board notice removes the task's model and reported harness from its card (or substitutes the worker's configured harness). Terminal tasks never follow a run feed to restore these fields. Normalize the projected spend or teach the renderer to accept both shapes before overlaying the read.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed (head 1cdac67). The claimless listTasks read returns spend as a folded TaskSpendView (task-tools-capability.ts, spend: taskSpendView(t)). Once the board read's fields won the merge, spendOf folded that view again, and taskSpendSchema read it as no requests, so the card lost its harness and model. Fixed at the renderer, the one place a row's spend becomes a card: spendOf takes a value that parses as taskSpendViewSchema as it is, and folds only the stored ledger shape. Test first: run-link.test.ts → "keeps the harness and model the read reports" failed on the previous adapter (no harness, no model), passes now. Sweep: the claude-code-style adapter and Shift Manager read only listTasks and already treat spend as the view; neither merges a board read over raw rows.
🤖 Generated with Claude Code
Generated by Claude Code
There was a problem hiding this comment.
Code Snob — already tight. No POC.
I read packages/core/src/types/board-notice.ts, packages/engine/src/bus/board-notice.ts, packages/orchestration/src/tasks/collection/get-or-create.ts, packages/react/src/hooks/useSubscription.ts, packages/react/src/components/panels/reads.ts, packages/shift-manager/src/components/TasksPanel.tsx, TaskBoardMeta.tsx, packages/shift-manager/src/lib/conversation-tasks.ts, labs/claude-code-style/src/adapter.ts, labs/teammates/src/adapter.ts, and goals/task-board/a-settled-task-reaches-the-board/run.mts.
A rewrite would not shrink the contract.
- The seam is the decided shape.
publishBoardChangeis five lines.createBoardNoticeSeamfills the tenant and the origin. The context attaches it whenstores.busis set. Inlining that intocreateExecutionContextdeletes a file and leaves the same publish in a larger one.legacyFilerOfis the narrowing for a resource ledger; inlined it is the same length. liveBoardDriveris subscribe,coalescedReads, and the mount read: fifteen lines.liveScopeDriveradds the manifest prefix. A shared driver is that skeleton plus two wrappers.- The two Shift Manager readers share latest-started-wins, an abort on cleanup, and
useSubscription. The panel keeps its timer for 30s after a move and a failed read is a failure line. The feed's timer runs only while a task is open and a failed read keeps the last cards. One stores an array; the other stores a map stamped with the session. That shell is about thirty lines in each file. A hook that takes the apply and the error is about that long, and the apply stays at the call site. The mount read stays beside the subscription:subscribe's timer first fires afterpollIntervalMs, andonChange(null)waits until push covers the topic. - Each lab's
onBoardChangeis the recorded local copy (the fallow ignore, and the note that each adapter keeps its own read helpers). The queue is one read in flight and one waiting.coalescedReadsis internal to react. A shared module is a new dependency between the two apps, the leftover already noted on #4647 for whichever lands second. The claude copy also keepsevery's JSON compare; Teammates publishes fromwatchTasksand has no compare. One function needs that flag. - The goal's three legs grade different hosts (a crossing bus, Postgres, no push) with different bounds. Each latency loop is about fifteen lines and the failure text is the assertion. A grader takes those strings as parameters.
The file comments restate the watches. Deleting them does not shrink the contract. Left the recorded calls: filer, then legacy filer, then the running session; both tasks and plan; pollIntervalMs only while a task is open or just moved; client on useSubscription; BoardList at 3s.
Sent by Cursor Automation: Code Snob
listTasks returns each row's spend as a folded TaskSpendView; after the board read's fields won the merge, spendOf folded it again and read nothing spent, wiping the card's harness and model (Codex r4462663901). spendOf now takes either shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
#4621 updated packages/ui/registry/components/{tool.tsx,tool-grouping.ts, tool-naming.ts} without Shift Manager's copies, so static.test.ts fails on main. Copied byte-for-byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cdac67bc6
ℹ️ 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".
| const filer = event.task.filer?.sessionId ?? legacyFiler?.(event.task) ?? runningSession; | ||
| if (filer !== undefined) publishBoardChange(options.ctx, { sessionId: filer, board: event.collectionId }); |
There was a problem hiding this comment.
Publish board notices for spend-only task updates
On a push-enabled host with a crossing bus, a long-running task's displayed spend now stays absent or frozen until another task change occurs. The live-spend ticker in task-board/task-request.ts writes updated spend every two seconds, but recordSpend in collection/resource-backed.ts calls patchRef(id, null, ...), which deliberately skips this onChange callback. Meanwhile, claude-code-style's watchTasks replaces its two-second poll with board notices, so its cards no longer receive updated model, token, or cost information during otherwise quiet runs. Publish a board notice for successful spend mutations independently of whether they emit a task-change component.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed (head 36f6e39). recordSpend writes through patchRef(id, null, …), and a null kind skipped onChange, so the spend tick published no board notice.
Fixed at the seam: the backings' one emitter (createTaskChangeEmitter) is now called after every committed row write, with its kind or null. A kind goes to onChange (the task-change item, as before). A null goes to a new onWrite. getOrCreateTaskCollection publishes the board notice from onWrite, and onChange calls it too, so every committed write publishes exactly one notice. No new task-change items.
Test first: packages/orchestration/test/tasks/board-notice.test.ts → "for a write that emits no task-change item: a run's spend" failed (expected [] to deeply equal [{ … kind: "board" … }]), then passed.
Sweep, every row write in both backings:
patchRefwithnull(spend,settleof a cascade,takeSteers, notice and marker clears): now publishes.transitionwithkind: null: now publishes.patchRefandtransitionwith a kind,claim/settle-abandoned,createTask/createTasks, reclaim: already published throughonChange.- State backing: its two kind-null sites (transition, patch) now publish; every other site already emitted.
- No other row writer: the id index and chain records are other resources, and nothing writes a ledger row outside the two backings.
The spend tick now sends one notice every 2 s per running task, and each view reads once per tick. That matches the 2 s poll the claude-code-style list had, but only while a run is spending. If it turns out too chatty, coalescing belongs in the ticker, not the seam.
🤖 Generated with Claude Code
Generated by Claude Code
…ange or not A write with no lifecycle kind (a run's spend tick, a cleared marker, steers taken) skipped onChange, so it published no board notice and a view of the board's read (its model, tokens and cost) stayed frozen (Codex r4462717502). The backings' one emitter now hands a kind-null write to onWrite, and getOrCreateTaskCollection publishes the board notice from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Brings in FIX-2466 (#4647). Both lab adapters' board watches now go through #4647's onNotice (the narrowed board topics, every notice heard): this PR's onBoardChange helpers are gone, and claude-code-style's last caller of every went with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
…does The ported FIX-2393 copy carries an export nothing in Shift Manager calls; the same ignore line #4654 adds, so whichever merges second merges cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
…tices # Conflicts: # labs/claude-code-style/src/adapter.ts # labs/teammates/src/adapter.ts
…otices A concurrent merge of main landed on the branch, resolving the lab adapters by keeping both onBoardChange and onNotice. Kept this side's resolution (the board watches folded into onNotice); the tree is otherwise unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
The retired-terms check counts "the person reading" in Shift Manager's copy. The same one-word change #4654 makes, in the registry and both byte copies, so whichever merges second merges cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36f6e39a7b
ℹ️ 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".
| const publish = () => { | ||
| const current = [...rows.values()].map((row) => newer(row.run == null && runs.has(row.id) ? { ...row, run: runs.get(row.id) } : row)); | ||
| if (stopped) return; | ||
| const current = merged().map(newer); |
There was a problem hiding this comment.
Prevent stale run rows from overriding fresh board reads
Once a running task's feed has supplied a row, newer can discard every subsequent board read: listTasks in task-tools-capability.ts returns no updatedAt, so the merged row retains the conversation's older timestamp (or defaults to zero), and the cached run row wins even when the board read is newer. This makes spend-only notices ineffective because those writes emit no task-change to update runRows; newly reported harness/model information remains absent or stale. It can also hide a completion received through the board while the run stream is behind. I reproduced both outcomes through watchTasks. Use comparable versions across both sources, or otherwise ensure an older cached run row cannot replace authoritative fields from a fresh board read.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed (head 4453c0a). listTasks answered no updatedAt, so once a run's feed supplied a row, the run's copy always looked newer and every later board read was thrown away.
Fix: one precedence rule, comparing real versions.
- The board's
listTasksaction, a client's read, now answers each row'supdatedAtas the row records it. This is additive, and the model's tool output is unchanged. watchTaskssettles each row with one rule (rowOf): the newest of its three copies (board read, run's, conversation's) byupdatedAt, a tie going to the board read. What the newest copy leaves out comes from the conversation's copy.- This replaces the separate
mergedandnewerrules.
Tests that failed first:
list-tasks-spend.test.ts→ "answers each row's updatedAt on the action" (expected undefined).run-link.test.ts→ "a row the run's feed and the board read both carry": both cases (a spend-only update shows; a board completion isn't hidden by a lagging run copy) fail with the board read shaped as before, and pass now.
The same merge elsewhere:
- claude-code-style reads rows from
listTasksonly, so there's one source. - Shift Manager's task card takes the board read's row over the feed's record, which only stands in before the first read. One source per card.
🤖 Generated with Claude Code
Generated by Claude Code
…datedAt wins listTasks answered no updatedAt, so once a run's feed supplied a row, the run's copy always looked newer and every later board read was thrown away: a spend-only change never showed, and a completion through the board could stay hidden (Codex r4462900231). The board's listTasks action now answers updatedAt (additive, not on the model's tool), and watchTasks picks the newest of its three copies, ties to the board read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4453c0a9c1
ℹ️ 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".
| const rowOf = (id: string): Record<string, any> => { | ||
| const copies = [listed.get(id), runRows.get(id), rows.get(id)].filter((c): c is Record<string, any> => c !== undefined); | ||
| const newest = copies.reduce((best, copy) => ((copy.updatedAt ?? 0) > (best.updatedAt ?? 0) ? copy : best)); | ||
| return { ...rows.get(id), ...newest }; |
There was a problem hiding this comment.
Clear removed holds when merging a fresh board projection
If a conversation-side update captures a run's open review hold and the user subsequently answers that review in the run session, this merge retains the already-answered hold. The run removes its suspension mirror, and listTasks's waitingOf omits holds when none remain, so spreading the fresh projection over the conversation's older row preserves its stale holds. Even a run-feed row that explicitly clears them loses to the board projection on timestamp ties. I reproduced the task continuing to show an answerable review after fresh board reads. Clear absent authoritative waiting fields rather than inheriting them; preserve only fields intentionally excluded from the projection, such as output.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed (head a600d3a). listTasks leaves holds out once none is open. Because the board read was spread over the conversation's older copy, the answered review survived.
Fix: remove the field-by-field merge. Every committed row write now sends a board notice, so the board read is never more than one notice behind, and it is the row:
- A field the read leaves out is cleared.
- The conversation's copy, else the run's, stands in only until the first read lands.
- An ended row takes
outputanderror, whichlistTasksnever carries, from its other copies (an explicitUNPROJECTEDlist). - The
updatedAtcontest is gone. - A run's feed is let go once the run's own copy says it ended, so it can still deliver that output.
Test that failed first: run-link.test.ts → "a hold answered in the run's session … leaves the card once the board read stops listing it". The review was still showing; it passes now. The round-6 spend and completion tests stay green.
Fixtures updated: three older fixtures had the board read omit holds the run had written, which the real read never does. They now list them, and the run's ending reaches its own session's feed too.
updatedAt on the listTasks action: the merge no longer reads it. I kept it because claude-code-style's ThreadsBoard shows each task's age from task.updatedAt, which the read never carried before.
🤖 Generated with Claude Code
Generated by Claude Code
… output and error Merging three copies field by field let an answered hold survive from the conversation's older copy (Codex r4463036356). Every committed row write now sends a board notice, so the board read is the row: a field it leaves out is cleared. The conversation's (else the run's) copy stands in only before the first read; an ended row takes output and error, which listTasks never carries, from the other copies. A run is let go once its own copy ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn


A task often settles in its own task session, or on another process. The conversation's board views never heard of it, so they polled: Shift Manager every 3 s while a task was open, the Teammates lab every 1.5 s until a run linked itself, the claude-code-style lab every 2 s all day. A live
BoardListmissed it entirely.What this does. Every change a task board makes now also publishes a
boardnotice on the topic of the session that filed the row, narrowed to the board. It goes out from the one place every board change already passes (theonChangeadapter ingetOrCreateTaskCollection), through a new engine seam on the block context. The five board views subscribe that topic and read on a notice. Where push can miss a change, they keep today's timer as the fallback.The code follows the figure.
What is asked of you. One call, below: I added a
clientoption touseSubscription, which the spec didn't name. Everything else implements the approved direction (D1 and Decided, not asked).Parts worth reviewing closely (for the code reviewer):
packages/orchestration/src/tasks/collection/get-or-create.ts, who a notice is for.Task.filer.sessionId, else the ledger's declaredlegacyFilerat its partition, else the running session. The goal'srunning-sessioncontrol shows this line is what carries a run's link to the conversation. This is the spot I'm least sure of: I confirmed no ledger writer bypasses the backings by reading the resolution paths (every one goes throughgetOrCreateTaskCollection), not by a mechanical check.labs/teammates/src/adapter.ts, the merge. The view draws both the conversation's own stream copy of a row and the board read's copy. The goal check found a real defect:listTasksreturns noupdatedAt, so anupdatedAtcomparison kept the stream's older copy and hid the run's link (leg b, 2 s). The board read's fields now win. A later change sends a notice that reads again.packages/shift-manager/src/components/TasksPanel.tsxandTaskBoardMeta.tsx, the timer gate.pollIntervalMsis passed only while a task is open (and, for the panel, within 30 s of a move), as the old timers were gated. Reads are latest-started-wins, since thereadAtread and a notice read can overlap.Fixes FIX-2429 · spec:
specs/issues/FIX-2429/· epic FIX-2367 · bus FIX-2426 · Postgres bus FIX-2427 (#4598) · delivery FIX-2428 (#4597) · goal:pnpm tsx goals/task-board/a-settled-task-reaches-the-board/run.mts, PASS (below)Need your sign-off
A host's own client for
useSubscription.FlowProvider.useSubscriptiononly used the provider's client, so Shift Manager couldn't call it without a second client and a second socket. I addedclient?: Pick<Client, "subscribe">to its options, asBoardListalready takes aclient.FlowProviderthat takes a client, the option belongs there instead.How to review this
Engineering calls
BOARD_NOTICE_SEAMwithpublishBoardChange(ctx, { sessionId, board })in@flow-state-dev/core/types, beside the dispatch and request-end seams. It names a session and a board only; the engine fills the tenant from the running request, setsoriginto the request, and fixes the kind toboard, so app code can't invent a topic or kind (ER-2). A context with no seam (a mock) publishes nothing.queueNoticesinpublish-writes.ts), so a burst of one topic and kind in one turn goes out once and a failed publish never fails the write. The seam is attached increateExecutionContextwhereverstores.busis set, which every entry guarantees throughwithChangeBus.ChangeKindgains"board". The session stream's wake set (items,request,run,resync) already excludes it.BoardList's fallback pace is 3 s (LIVE_BOARD_POLL_MS). The spec says "its default"; it had none, since it followed the session stream. 3 s matches Shift Manager. If wrong: a no-push host's list is up to 3 s behind.client.subscribecallsonChange(null)on a connect only when push is up; on a no-push host nothing else would read before the first tick.onBoardChange), one read in flight and one waiting, replacing the timer helperwatchTasksused. The labs have no React hook to call, and each adapter already kept its own read helpers.Everything else: verification, deviations, files
Goal check
pnpm tsx goals/task-board/a-settled-task-reaches-the-board/run.mts(modeln/a):Controls (each a scratch patch applied at load, leg a):
Today's
maincan't load the script (no board notice, nosubscribein the labs); on it the claude-code-style list reads every 2 s regardless, whicha:0-readscatches. The controls stand in for its red state. Underrunning-sessionthe ending itself still reached the conversation in time, through the filer's own notice write in the conversation; the link did not.Tests, red then green
packages/engine/test/bus/board-notice-seam.test.ts(4): red onpublishBoardChange is not a function; green with the seam.packages/orchestration/test/tasks/board-notice.test.ts(2): red withexpected [] to deeply equal [{ … kind: "board" … }](no notice); green with the adapter's publish. Runs the real runtime: a row filed in one session and settled in another publishes on the filer's topic only.packages/react/test/board-list.test.ts: the live section rewritten onto a fakedsubscribe(11 red onCannot read properties of undefined (reading 'stream'), then 18 green).packages/react/test/useSubscription.test.ts: theclientoption, red (expected [] to deeply equal [[…]]), then green.packages/shift-manager/test/conversation-tasks-panel.test.tsx(4) andtask-card-in-feed.test.tsx(3): red onno open subscription, then green.labs/teammates/test/run-link.test.ts(3 new): red (no subscription; a timer read at 1.5 s;runningnotdone), then green. Plus the merge regression from the goal: red (expected undefined to be 'dsx_run'), then green.labs/claude-code-style/test/watch-tasks.test.ts(2): red (no subscription; a second read from the 2 s timer), then green.Suites
screen.test.tsxcases time out, different ones each run; they drive the fixture lab (test/fake-lab.ts), not the adapter changed here, and pass alone.pnpm packages:buildand the rootpnpm typecheck: exit 0. eslint on the changed files: clean.node specs/issues/FIX-2429/poc/board-views/check.mjs: PASS, 5 views.Deviations from the spec
task-changethe conversation's own stream carries, so a step worked in the conversation's request reaches it with no board notice, andtasks-onlycouldn't fail there.BoardListview in the goal drivesBoardList's call shape (narrowed topic, 3 s pace, coalescedlistCollectionItems) rather than rendering React in Node;board-list.test.tsproves the component makes that call. FIX-2428's goal did the same foruseSubscription.LISTENconnection). The task is released on registry 2, whose pass runs it; the check grades that the delegate ran there and nowhere else.useSubscriptiontakesclient(sign-off above).docs-writeranddocs-editoragents: this worker could not dispatch sub-agents.listTasks_tasksread can answer 409read_only("a read can't write to the org store"). The next read succeeds. Not this issue's; worth its own ticket.Files
types/change-notice.ts(boardkind)types/board-notice.ts(new seam),types/block.ts,types/index.tsbus/board-notice.ts(new),bus/publish-writes.ts(queueNotices),context/createExecutionContext.tstasks/collection/get-or-create.tscomponents/panels/reads.ts,BoardList.ts,hooks/useSubscription.tscomponents/TasksPanel.tsx,components/TaskBoardMeta.tsx,lib/conversation-tasks.tsteammates/src/adapter.ts,claude-code-style/src/adapter.tsgoals/task-board/a-settled-task-reaches-the-board/orchestration/task-substrate.md(Board notices),workforce/ui.md(A board as a list),api/react.md,api/client.md,client/react.md,guides/realtime.md(Task boards); react and orchestration READMEs.changeset/board-notices.md(minor: orchestration, engine, react; patch: core, contracts, shift-manager)Mechanism classifier:
publishBoardChangebelongs to thechange-busrow: it is a publisher on the bus, not a new job.Generated by Claude Code