Repository navigation
FIX-1660: keep a row action's refusal when its request wrote nothing - #2414
Conversation
…ing (FIX-1660) A transient row action refused without changing the task persists no items, so its polled log is empty and it never counts as settled. The fallback that read its raw log then ignored the retained per-request stream cache, and once a second request took the stream slot the refusal's root trace was gone: the row fell back to "this request left no trace" (FIX-1629 BR-15). The fallback now merges the retained stream cache into the polled log, as the settled path does. Also rewrites the task-tool-actions changeset summary as one sentence. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014LohgYyHsXCYQd6kABH11N
|
@codex review Generated by Claude Code |
|
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 review (read-only, for the follow-up agent)Verdict: the fix is right and minimal. No blocking findings. Placing it in the non- Is there a better approach?Not for the fix itself. The alternative (treat a finished request with an empty log as Refactor opportunity worth taking in this PR (optional, small)
The rule is now "polled log + whatever a stream saw", and only the choice of which stream source counts differs. Consider one small named helper, e.g. Second-path notes
ChangesetRewrite of Generated by Claude Code |
Process guards fails on main since #2359 put spec/_projects on it; #2392 removes it. Same deletion here, a no-op once #2392 merges. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014LohgYyHsXCYQd6kABH11N
|
Process guards is red on this PR, and the failure isn't this PR's. I briefly ported #2392's deletion of that folder here, then reverted it in 8ad6cf4. The folder is staying on main, and the spec-folder check is being retired instead (tracked under FIX-1635). This check will stay red here until that lands. Generated by Claude Code |
There was a problem hiding this comment.
Simplify review (FIX-1660)
Verdict: The functional fix is small, localized, and reuses the right primitive (mergeRawItems). I’m approving — nothing here looks like an over-built framework change. Below is where complexity comes from and what a cleaner shape might look like if you want a follow-up.
What went wrong (and why the panel is the right layer)
completed + empty polled items is intentional for a transient refusal (nothing persisted). snapshotSupersedesLive(..., [], false) correctly stays false, so the row stays on the unsettled rawItems arm. After the stream slot moves to another request, the old fallback was req.items ?? [], which dropped the only trace living in streamRawItems. Engine/store is not the place to fix this without a new “include transients on read” API — devtool reconciliation is appropriate.
Is this the simplest fix?
For the refusal case alone, extending the ?? chain would work:
liveRawItems ?? streamFor()?.rawItems ?? streamRawItems.get(id) ?? req.items ?? []
That mirrors the tail of the settled merge input and avoids mergeRawItems + the mid-expression comment.
Why mergeRawItems is still defensible (and maybe better): on the unsettled path, snapshotSupersedesLive is also false for non-terminal rows with a non-empty poll. If streamRawItems ever holds stream-only ids while req.items still has polled rows (handoff / partial poll), a plain ?? prefers the whole cache and can drop polled-only ids. merge matches what the settled branch already does. I’m not sure that scenario is common in practice — if you’ve ruled it out, the chain-only one-liner is simpler; if not, keep merge.
Where the approach feels “heavier” than the bug
The real awkwardness is structural, not this three-line tail:
-
Terminal + empty poll uses the “unsettled” branch for
rawItemswhile the “finished + streamed-only trace” story is already documented on the settled merge path (see the test at ~606). FIX-1660 is another special case of the same BR-15 rule, discovered becausesettledis false when the poll is empty. -
Duplicated waterfall —
liveRawItems.get(id) ?? streamFor(id)?.rawItems ?? streamRawItems.get(id)appears in the settled merge and split across the unsettled arm.
Cleaner follow-ups (optional, not blockers):
- Extract a local
streamedRaw = …(or a tinyresolveRowRawItems({ settled, polled, … })next tomergeRawItemsinrequest-status.ts) so settled vs unsettled is “take live wholesale vs merge(polled, streamedRaw)” in one place. That documents BR-15 once instead of a new inline comment. - Alternative root fix: without changing
items:behavior, treat “store terminal + empty poll” as settled forrawItemsonly (so you always hit the existing settledmergeRawItemspath). That removes the unsettled special case but needs a careful predicate so you don’t resurrect stale partial live caches for suspended/interrupted rows.
Scope / tests / nit
- The new test is valuable; it’s very close to “keeps a finished request’s streamed-only traces…” — sharing setup would shorten the file but isn’t required.
- The test asserts
rawItemsonly; canonicalitemsstays[]for this row (pre-existing split). Fine if Tasks reads outcomes from raw traces; worth a one-line comment in the test if that’s intentional. .changeset/task-tool-actions.mdwording change looks unrelated to FIX-1660 — consider dropping from this PR to keep the diff single-purpose.
Performance
No concerns at devtool scale. Background rows may re-run mergeRawItems on stream RAF ticks; same class as settled rows already. Only worth profiling if someone opens a session with many historical rows and long traces.
Summary: Good minimal fix for the refusal regression. If you want maximum simplicity in this PR, consider the ?? streamRawItems chain only if you’re confident about the unsettled + non-empty poll case; otherwise keep merge and maybe extract the waterfall in a tiny follow-up.
Sent by Cursor Automation: Review For Best Approach
…ired instead Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014LohgYyHsXCYQd6kABH11N
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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.
Code Snob — already tight. No POC.
I read packages/devtool/src/react/DevToolPanel.tsx (the rawItems branches), packages/devtool/src/react/lib/request-status.ts (mergeRawItems, snapshotSupersedesLive), the new test in packages/devtool/test/devtool-panel-session-reset.test.tsx, and .changeset/task-tool-actions.md.
The fix is one fallback. An unsettled request now runs its poll through the existing mergeRawItems instead of req.items ?? []. The settled branch already merged, with a different source order, and those orders are the contract: a live log replaces a stale poll until the snapshot supersedes, and a settled poll wins on id and only gains stream-only traces. Folding both into liveRaw !== undefined && !settled ? liveRaw : mergeRawItems(...) is the same decisions, with the empty-log case hidden in the condition. A rawItemsFor helper would add a function and a unit test for a two-branch expression.
The new test repeats its sibling's dispatch and displace setup because an empty poll takes the other branch of snapshotSupersedesLive. A shared harness would be more code than the assertion, and folding it into the sibling would drop the settled-path check.
Nothing to subtract that still meets this contract.
Sent by Cursor Automation: Code Snob


The problem
In the DevTool's Tasks tab, some row actions refuse without changing the task, for example when the task can't be claimed. Such a refusal writes nothing to the store. The row shows the refusal at first, but once you run a second action (or anything else takes the live stream), the first row changes to "this request left no trace". A refusal should never end up looking like silence (FIX-1629, BR-15).
What this does
The panel already keeps what each request's stream delivered after the stream moves on, and uses it for requests whose stored log has items. A request whose stored log is empty went down a different path that never looked at that saved stream data. Now that path merges the saved stream data into the stored log the same way, so the refusal stays on the row.
This PR also rewrites the summary in
.changeset/task-tool-actions.md(still unreleased, same packages and bump levels) as one sentence naming FIX-1629, as AGENTS.md requires. This fix belongs to that unreleased change, so it gets no changeset of its own.What's asked of you
Nothing here is yours to decide. This is a bug fix on the direct route, and this PR is the only gate.
Parts worth reviewing closely
The rest of this is for whoever reviews the code.
DevToolPanel.tsx, the non-settledrawItemsbranch. The saved stream data is now merged into the stored log, with the stored entry winning for any item both have, instead of being skipped. I changed this branch rather thansnapshotSupersedesLivebecause the empty-log rule there still holds for rendered items. Should a finished request with an empty stored log count as settled instead? If it should, the fix belongs in the helper. The trade-off is that its rendered items would then read[]rather than the live cache.Linear: FIX-1660 · reported on #2347 (review thread 4128539571) · merges when approved
How to review this — bug fix on the direct route
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.
Everything else — verification
New test in
packages/devtool/test/devtool-panel-session-reset.test.tsx, "keeps a refusal that persisted nothing, after the stream moved on". Request A's stream sees only a transient root trace with{ ok: false }. Request B then takes the stream slot. The store has A ascompletedwithitems: [].rawItemsis[], where the refusal trace was expected.pnpm --filter @flow-state-dev/devtool typecheckandnode scripts/validate-changeset-refs.mjs.🤖 Generated with Claude Code
https://claude.ai/code/session_014LohgYyHsXCYQd6kABH11N
Generated by Claude Code
Note
Low Risk
DevTool UI-only reconciliation of request logs; no runtime, auth, or persistence changes.
Overview
Fixes a DevTool Tasks tab bug where a row action that refuses without writing anything to the store (e.g. “task is not claimable”) showed the refusal while its stream was active, then looked like “this request left no trace” after another action took the single live stream slot (FIX-1660 / BR-15).
For requests that are not treated as
settled,DevToolPanelnow buildsrawItemswithmergeRawItems(polled log, cached stream log)—the same merge used for finished requests—so stream-only transient refusal traces fromstreamRawItemsare kept even whenitemsis[].Adds a regression test in
devtool-panel-session-reset.test.tsxand tightens the unreleased.changeset/task-tool-actions.mdblurb (no new bump).Reviewed by Cursor Bugbot for commit 1e3a268. Configure here.