Repository navigation
fix: a failed tool call that a later call retried reads as an attempt, not an error (FIX-1957) - #3272
Conversation
…, not an error (FIX-1957)
When a run held a failed openWorkstream followed by a successful one, the
transcript kept the run red ("Used 3 tools, one failed") and the first row
read "openWorkstream failed". A failure that a later call of the same tool
in the run completed now reads "Tried openWorkstream" and doesn't make the
run read as failed. A failure with no successful retry is unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122p1f6h3nPzdyVvNN9z94p
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Bugbot couldn't run - usage limit reachedBugbot 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: bb05b27b-bd11-417a-bf0f-c0ebc9f2643a) |
Second look + architecture passVerdict: the approach is right and proportionate. No blocking findings. Placing the fix in the derivation ( Is there a better approach?Not a materially better one. Alternatives considered and rejected:
Findings (all non-blocking, for the implementing agent to weigh)
Architecture (improve-codebase-architecture lens)
No changes required to merge from my side. Generated by Claude Code |
… term (FIX-1957) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122p1f6h3nPzdyVvNN9z94p
Bugbot couldn't run - usage limit reachedBugbot 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: b6c5c05d-0b23-482b-a67f-bcbe5b0215f2) |
There was a problem hiding this comment.
Simplify review (FIX-1957)
Verdict: The change is appropriately small for the product ask. I do not think the approach over-shot into unnecessary abstraction—a derived retried presentation state plus statesInRun is clearer than threading ad-hoc flags through callLabel and runState separately.
What works
- Layering: Retry forgiveness stays in Shift Manager’s quiet-line presenter, not the engine or item model. That matches how grouping already works (
buildItemRenderStreamconsecutivetool_outputonly) and avoids schema work unless you later need retry lineage in model context. - Factoring:
stateOfstays “raw item”;statesInRunadds run context;runState(CallState[])stays a dumb aggregate. Good separation for tests. - Tests: The new case pins the happy path and two negatives (no success, double failure).
tool-line.test.tsxpasses in isolation.
Alternatives considered (not blockers)
| Approach | Why you might skip it here |
|---|---|
Engine metadata (supersedesItemId / workforce-style RETRY_OF) |
Authoritative but heavy; tool items do not carry retry lineage today. |
Shared helper in @flow-state-dev/ui / registry tool.tsx |
Worth it if kitchen-sink and registry consumers should show the same “Tried …” semantics; Shift Manager intentionally diverges on copy and layout. |
Skip retried enum; pass superseded booleans |
More parameters at call sites; the union keeps QuietLine + labels aligned. |
Limitations to keep in mind (product, not bugs)
- Grouping boundary: Only calls in the same consecutive tool group participate. A failed
openWorkstreamand a later successful one separated by a non–tool_outputitem will still read as failed at the group level. - Name-only match: Documented in
statesInRun; a later success with the same tool name but different intent/args still forgives the earlier failure. If that is too loose for some tools, metadata or args-aware matching would be the next step—not more UI heuristics.
Optional polish (if you touch this again)
- Precompute
const base = items.map(stateOf)once insidestatesInRunto avoid repeatedstateOfin the innersomeand dropsliceallocations (irrelevant at n≈2–5, matters only for very long consecutive runs). - Split the multi-scenario
itinto separate tests for easier failure diagnosis. - Trim redundant restatement of the retry rule in the file header if
statesInRun’s docblock is the canonical explanation.
No changes requested for merge from a simplify lens.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob — already tight. No POC.
Read packages/shift-manager/src/components/ToolLine.tsx and packages/shift-manager/test/tool-line.test.tsx at e5a1590, and flow-state/tool.tsx's runState (different item type; this PR leaves that copy alone, which is already recorded).
statesInRun is the one walk the group line and the rows share. Inlining it into ToolLineGroup moves those lines. A reverse Set of completed names is more code for the same labels. Mapping a retry to completed and special-casing the label needs a second argument, so the retried state is the smaller way to get "Tried {name}" and muted text. runState taking those states is what keeps the walk at one.
The header sentence is the words ("Tried openWorkstream", the run not failed), next to the waiting sentence. The statesInRun note is the name-only rule. The test's two "one failed" renders are the two misses (the same tool fails again, a different tool completes). Splitting them adds lines.
A rewrite would not shrink the contract.
Sent by Cursor Automation: Code Snob
…oordinator does now (FIX-1957) main went red when FIX-1920's new test (still calling handOff) merged after FIX-1872 replaced handOff with dispatchTask post. Same one-line change FIX-1872 made to askFor in this file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122p1f6h3nPzdyVvNN9z94p
|
The two merges conflict in meaning. #3232 (FIX-1872) replaced the coordinator's I pushed the same one-line change into this PR (89afaed): the test now uses Generated by Claude Code |
Bugbot couldn't run - usage limit reachedBugbot 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: 15177b5f-0f4d-4c5c-a762-cb9605575a79) |
…orkstream test The coordinator's post is now a dispatchTask row (FIX-1872), so the scripted script must post with dispatchTask, not handOff. Same one-line change as #3272; it no-ops once main carries it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AbWGaPRHHDktemkzFXph5b
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89afaed546
ℹ️ 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".
…pen reads as an attempt (FIX-1957) Conversation drew every tool call as its own line: it never passed groupToolCalls, so its group branch never ran and ToolLineGroup never saw the retry that followed a failed call. The new test drives the coordinator through a failed then retried openWorkstream and reads the project Stream: on the previous head it finds no 'Used 3 tools' line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122p1f6h3nPzdyVvNN9z94p
Bugbot couldn't run - usage limit reachedBugbot 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: 63ba2e46-5fce-4360-82a4-56ebaa71c2fd) |


Requested by Jake · project thread
The problem
When the coordinator's first
openWorkstreamfails and its retry succeeds, the Shift Manager conversation still shows "openWorkstream failed" in red, even though the workstream opened. This was the third expectation on FIX-1920, and it was still open after that fix merged.Separately, main is red: a test from FIX-1920 still uses
handOff, which FIX-1872 replaced withdispatchTaskjust before FIX-1920 merged. This PR carries the one-line test fix, so merging it turns main green.What this does
What's asked of you
Nothing here is yours to decide; this PR is the gate for a bug on the direct route. The visible change is the grouping: a conversation with several tool calls in a row shows one line instead of several.
Parts worth reviewing closely
statesInRuninToolLine.tsxdecides what counts as a retry. It compares only the tool name, not the arguments, because the real retry changes the lead. It also only looks within one run of consecutive calls.Conversation.tsxnow passesgroupToolCalls: true(the finding Codex raised).Fixes FIX-1957 · related FIX-1920 (#3263), FIX-1872 (#3232) · merges to main.
How to review this
Engineering calls
buildItemRenderStreamwithoutgroupToolCalls, so its group branch never ran. Every call reachedToolLineon its own and could not see a retry.runStatetook the worst state across the run, and each row used its own raw status.isSuspensionWait) is not a failure, so it is never marked retried; the waiting path from FIX-1901 is unchanged.tool.tsx(and its byte-equal copies) is left alone.shift-manageris private.Everything else
Verification:
project-workstreams.test.tsx› "its Stream draws an open the coordinator retried as an attempt, not a failure" drives the coordinator through a failedopenWorkstreamand its successful retry, then reads the project Stream tab. Without the grouping fix it finds no "Used 3 tools" line; with the fix it finds that line, a row reading "Tried openWorkstream", and no "openWorkstream failed".tool-line.test.tsxcovers the component: the retried case, plus the same tool failing again and no retry at all, both of which still read "one failed".project-workstreams.test.tsx› "refuses research under the EM…" times out on main every time (main CI). It passes withdispatchTask { post: true }.Files:
packages/shift-manager/src/components/ToolLine.tsx,packages/shift-manager/src/components/Conversation.tsx,packages/shift-manager/test/tool-line.test.tsx,packages/shift-manager/test/project-workstreams.test.tsx.🤖 Generated with Claude Code
https://claude.ai/code/session_0122p1f6h3nPzdyVvNN9z94p