Skip to content

fix(threads): retry failed turns with a short continue message - #568

Merged
nixuuu merged 1 commit into
devfrom
fix/retry-continue
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/retry-continue

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Retrying a failed turn now sends exactly Continue, without copying the original request into the user bubble. Once a later turn starts, the older failure becomes a compact title and Show details entry. Its explanation, hints, recovery actions and retry feedback disappear immediately, using the existing feed anchoring without a height animation. Queued messages do not hide actions before dispatch.

Mobile gets the same compact historical failure entry through JS-only changes. It already has no retry/settings buttons in thread failure cards. No native configuration or dependencies changed.

Session recovery

Existing provider sessions retain their own context. The worker saves the latest substantive request privately in its SQLite journal, surviving event ACKs and restarts. If Retry needs a fresh Codex session because its rollout is missing, or a fresh Claude session because its transcript is missing, the request is supplied as developer/system context with a reminder to inspect completed side effects. The user message stays Continue. Grok requires a successful session load and has no silent empty-session fallback.

This fallback restores the saved request, not a complete lost provider transcript. Requests predating this worker change have no private recovery copy.

Validation

  • Rebased onto dev at a73e5c1bf. Resolved the mobile TimelineTurn conflict by retaining fix(mobile): expand turn summaries smoothly without scroll jumps #554's TimelineDisclosure, UI-thread anchoring and local group state. Historical failure state now passes through ThreadTimeline's memoized cell, including its equality check, so an older card updates when a new turn starts. Web retains fix(mobile): expand turn summaries smoothly without scroll jumps #554's VirtualFeed.keep behavior for the latest summary. No disclosure or motion changes were reverted.
  • bun install and bun run gen:check pass on the final head. Focused worker tests pass: 5 tests, 28 assertions, covering native session resumption, missing-rollout recovery, journal ACKs/restarts, repeated retries, request replacement and thread isolation. The emitted user message is exactly Continue and excludes the prior request. No web UI tests added.
  • After conflict resolution, bun run format, bun run lint, mobile typecheck, bun install, generated-code checks and the 5 focused tests pass. GitHub CI runs the final head's static checks, build and full test shards. The full local check:tmp was not repeated, as requested.
  • Real-browser review used an isolated gateway/PostgreSQL fixture, scripted worker, and the real web BFF/SSE. Checked light and dark at 1440 × 900 and 390 × 844: initial failure recovery actions; Retry bubble exactly Continue; compact historical failure during streaming; latest failure retaining actions; and working Show details. Sending an ordinary new message also removes older actions. No horizontal overflow. Frame sampling around Retry kept the failure title at y = 212 px while its card changed directly from 148 px to 56 px, with no intermediate height animation. Navigation cancellation logged a thread-watch warning; subsequent streams and sends succeeded.
  • EAS production-profile fingerprints match final head and dev, generated with identical checkout paths and installed dependencies: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. No native-device visual review is claimed. The browser tab, web server, gateway and disposable database were stopped after review.
  • Repeated the real-browser failure-card check after conflict resolution at 1280 × 800 light and 390 × 844 dark: Continue only, compact older cards during a new turn/streaming, working details, latest failure recovery actions, and no horizontal overflow. Recomputed both EAS fingerprints against this new base; both hashes above remain identical. All disposable processes and the browser tab were stopped again.

Copy audit — docs/copy.md §8

  • Continue the previous request after the failed turn. Check what was already done before repeating anything with side effects. Previous request: → Continue. One imperative, one word, sentence case, no duplicated request or internal jargon in the user bubble.
  • Reused Could not finish this turn, Show details, Copy error details and existing action labels. Historical failures stop asking for action after work resumes; technical details remain available on demand. No new glossary terms, empty states, confirmations, duplicate facts or humor. Text supplies meaning independently of color or icons.
  • Visual copy audit: checked the short Continue bubble, a multiline original request, and wrapping failure explanation/action labels at desktop and phone widths, light and dark. Changed failure copy contains no interpolated user names. Existing long labels stay within the phone width; historical entries retain their title and disclosure.

History inspection (git log -S) identifies #94 as the source of the long Retry message. #530 changed failure grouping/presentation but did not introduce that text.

Fixes: #94
Related: #530

@nixuuu
nixuuu force-pushed the fix/retry-continue branch 2 times, most recently from 52cccd5 to e3a41cb Compare November 12, 2026 12:22
@nixuuu
nixuuu force-pushed the fix/retry-continue branch from e3a41cb to eefdd89 Compare November 12, 2026 12:29
@nixuuu
nixuuu merged commit d3c7e01 into dev Nov 12, 2026
10 checks passed
@nixuuu
nixuuu deleted the fix/retry-continue branch November 12, 2026 12:42
nixuuu added a commit that referenced this pull request Nov 12, 2026
Focusing the collapsed thread composer fed every intermediate footer
height into the timeline spacer and scroll anchoring. Expansion,
collapse and draft growth now stay in the bottom overlay, with a fixed
reserve for the collapsed input and safe gap.

- Observe the fixed footer rail instead of the animated composer.
Preserve row measurements, reader intent, streaming follow-end and turn
navigation.
- Animate one bottom-aligned, clipped composer height using existing
motion tokens. Its internal folds switch immediately; reduced motion
switches the outer height immediately too. Keep the opaque backing and
fade attached to the overlay.
- Anchor “Jump to latest” above the collapsed edge and fade it while
covered by the expanded composer.
- Native thread folding already preserved its reserve, but multiline
drafts and attachments still enlarged it. Give thread feeds a fixed
collapsed reserve and latest-button anchor, while keeping measured
keyboard geometry separate. Mobile changes are JS only.
- Update the related Polish layout and performance documentation.

Validation passed: `bun install --frozen-lockfile`, `bun run gen:check`,
`bun run typecheck`, `bun run lint`, `bun run format:check`, the web
build and `git diff --check`. Svelte reported zero errors and warnings.
CI's four test shards, generated-code checks, static checks and builds
passed on this head. No web UI test suite was added or run; browser
automation was disposable diagnostic tooling.

The real seeded thread was reviewed in Chromium 155.0.8059.84 on Linux
x86_64 with Bun 1.4.4. Coverage included light/dark, widths 1440/820/390
at height 900, normal/reduced motion, latest/scrolled-up,
expansion/collapse, multiline drafts and eight uploaded attachments with
long names. All 60 sampled scenarios reported **0 px scroll-position
drift, 0 px scroll-height change and 0 px visible-message anchor
drift**. The latest button retained its coordinates and became inert
while covered. Screenshot review found no horizontal overflow or
see-through seams. A focused reduced-motion pass recorded only endpoint
heights, with no interpolation. No browser JavaScript errors were
observed.

The focused Performance trace maps the timeline's 1,734 DOM nodes to CDP
backend node IDs and checks `Layout` roots and invalidations during
three real expansion/collapse cycles. Marks begin at the composer's
state change; collapse follows a real 100 px reader wheel gesture.

| Trace interval | Timeline layout events |
| --- | ---: |
| Expansion 1 / 2 / 3 | **0 / 0 / 0** |
| Collapse 1 / 2 / 3 | **0 / 0 / 1** |
| Positive control: change a timeline border by 1 px | **1** |

Each interval lasted 503–507 ms. Expansion had zero timeline layout
invalidations. Each collapse had two timeline invalidations during the
reader scroll/range update; the third included one timeline layout.
There was no repeated timeline layout during the animation.
Composer/global layout continued during its height transition: 18–22
events and 3.986–5.578 ms total per interval. These global events are
not counted as timeline layout. The positive control confirms that an
actual timeline layout is detected. This is a focused layout result, not
a broad CPU or frame-rate benchmark.

EAS CLI 27.4.1 fingerprints with the production build profile match the
pre-change baseline on both platforms:

| Platform | Before = after |
| --- | --- |
| iOS | `6ddec9ef559ee0095ac33e94ff9418a942053b17` |
| Android | `5f6eae3ab278f1cd543e9ed763f923a319b65ec9` |

Screenshots, raw trace and diagnostic summaries are retained outside the
repository. No native device runtime was exercised. The expanded overlay
deliberately leaves the timeline fixed and can cover its bottom rows.

UI copy is unchanged; the copy audit for changed strings does not apply.
History places the animated-reserve coupling before the recent PRs
below; these links provide context rather than identifying a new
regression introducer.

Related: #497, #551, #554, #568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant