Repository navigation
spec(issue): labs show a failed turn inline with its reason and Retry (FIX-2550) - #4725
Conversation
… (FIX-2550) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiDAAfKeTwqH2bFcZLD
|
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. |
|
@codex review |
Second look + architecture pass (spec FIX-2550)Verdict: direction is sound and right-sized. Reusing 1. Doc contradiction on "who can be retried" (worth fixing in this change set)
So newest-only is a UI rule, not a server rule. That is still a good rule (retrying an older failed turn after a newer one succeeded appends a reply out of order), but the spec should say that is why, and the component docstring (and 2. "Byte-identical to the registry" has no enforcementThe spec says each lab installs
Recommend the first. BP-003: a claim the change rests on needs an evidence path, and two labs plus Kitchen Sink is exactly the spread where copies drift. Note also that labs already hold 3.
|
|
Codex Review: Didn't find any major issues. Keep them coming! 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.
/simplify review (spec-only PR)
Verdict: The overall approach is the right one — this is FIX-2370’s lab adoption, not a new product direction. Keeping RequestRecovery, routing Retry through the adapter (lab package boundary), and mapping engine error items in entriesOf / toEntries matches how both labs are built today. I would not introduce a shared @flow-state-dev/lab-* package or have screens call the client directly; D1’s chosen option is the thin, conventional wrapper.
Where this spec adds complexity beyond FIX-2370 (and where a cleaner shape is available):
1. Two owners for “newest Retry” (spec inconsistency)
FIX-2370 already models latest-only Retry as caller responsibility: pass onRetry or omit it (isLatest ? … : undefined in the KS example). This spec also has the adapter set “whether it is the newest turn” / “retryable” (SPEC verification + “What changes”) while the debt table says “newest-only Retry is the screen’s rule” and D2 has both adapter latest and screen gating.
That duplicates FIX-2370’s rule in two layers and can drift (adapter marks retryable, screen still hides while running — fine — but two flags for “newest” is easy to get wrong in tests).
Simpler alternative (recommended): Adapter maps error → an error/failed entry with reason + requestId + incomplete message flags only. Entry/screen derives newest retryable turn from ordered entries + “nothing running” (same as FIX-2370). Drop a persisted latest / retryable field on the entry unless you document one canonical owner.
2. D2 (thread items vs session requests) — defensible but heavy
The Teammates “invisible board pass” case is a real reason to prefer thread order over sessions.requests. The tradeoff (Retry visible when thread says newest but session’s newest request differs) is subtle; worth one explicit sentence in verification expectations so implementers don’t assume server “latest” === button visibility.
If that edge case is rare in practice, aligning with session latest failed request would match server retry rules more directly — optional simplification, not a blocker if product wants “what you see in the thread.”
3. Spec surface area vs delta spec
Large mirror of FIX-2370 (tables, mermaid, per-lab verification bullets) is readable but repeats closed direction. A shorter delta spec (gap → lab-only changes → pointer to FIX-2370 verification) would be easier to implement and review. Naming “failed entry” / kind: "failed" vs FIX-2370’s “error entry” adds a second taxonomy next to Teammates result.failed (task board).
4. E4 (Claude Code-style task run thread)
watchTaskWork already uses entriesOf on a run session that also omits "error" today (THREAD_ITEMS + suspension). Surfacing failures there is consistent once mapping exists, but it is extra scope beyond the main conversation rows in the title — Entry must not pass onRetry in task context. Fine as E4 if intentional; otherwise defer to keep the implementation PR smaller.
5. Verification / reuse (implementation hygiene, not direction)
- FIX-2406 contract row (
it.fails→ FIX-2550): prefer one failed-turn spine (adapter pure-function tests + contract scenario) over four near-duplicate “per lab” integration narratives. - Kitchen Sink already has
compareRegistryCopiesforrequest-recovery; labs only say “byte-identical” in prose — consider calling out drift tests when implementing (same pattern as KS). - Reuse the
ErrorItemfixture shape frompackages/ui/test/render/request-recovery.test.tsxin lab adapter tests instead of re-specifying only in prose.
Performance
No spec-level concern. Implement failure + newest + incomplete in one pass over items already loaded in entriesOf / toEntries (avoid triple scans on an already hot mapper).
Summary: I’m not asking to reopen FIX-2370 or skip adapter.retry. I am asking to pick one place for newest-only Retry (prefer FIX-2370’s screen/Entry pattern), resolve the SPEC/debt-table contradiction, and optionally trim mirror prose + E4 scope. Happy to approve after that tightening; as written the direction is mergeable but the dual latest story is the main implementer hazard.
Sent by Cursor Automation: Review For Best Approach
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiDAAfKeTwqH2bFcZLD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiDAAfKeTwqH2bFcZLD
…ly shows once stored Folds review of the impl PR into D2 and SPEC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiDAAfKeTwqH2bFcZLD


Requested by Jake · project thread
Spec for FIX-2550, a child of FIX-2369. Merging this PR is approval. Read SPEC.md, then DECISIONS.md.
Who feels it
The goal
In both labs, a failed turn reads as a failure, with its reason and a working Retry, drawn by the registry's
request-recovery. The direction is FIX-2370's (approved 2026-11-01); its two lab slices never landed. Control that must fail: dropping the"error"branch from each adapter fails its adapter case; Retry on every failed entry fails the newest-only case.Need your sign-off
retry(sessionId, requestId), over the client's existingrequest(id).retry(). It keeps each lab's rule that only the adapter touches a package.Debt: none new. No package changes. Docs: each lab README gains a row; no
apps/docschange.The implementation is being built now on a branch stacked on this one, and opens as soon as this merges.
Generated by Claude Code