Skip to content

fix(mobile): return finished threads from the Working shelf - #25400

Open
juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-24901
Open

juliusmarminge wants to merge 3 commits into
mainfrom
fix/issue-24901

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Problem

A completed thread can remain in the mobile Working shelf after its two-second grace period. Reproduce by starting a run, keeping Home visible while it finishes, and leaving the list untouched: the row reads Done but stays under Working until a later list rebuild.

Change

Pass the inbox tracker version into the memoized observation so React Compiler includes it in the cache key. The timer notification now refreshes shelf placement. The tracker accepts an optional version argument; existing callers and grace/attention rules retain their behavior.

Scope and approval

Fixes #24901

Triaged bug via the automated issue flow. GitCafe: #24901. This restores the existing completion behavior without adding settings, persisted state, or protocol changes.

Verification

  • Red first: the new Metro compiler regression test failed on main because the observation cache guard omitted inboxVersion; it passes with the fix.
  • vp run check:changed: passed formatting, lint, both knip checks, all seven affected-package typechecks, and 980 tests across compiler coverage and inbox tracking. The final rerun confirmed the cached passing result with exit 0.
  • Independent GPT-6.1-Sol and Claude Opus 5.5 code reviews returned MERGE with no findings.
  • Real Android development clients, React Compiler enabled, remote connection to an isolated server using explicit --home-dir. Native fingerprint 0328f4ec326e7e4bf1bf87625118f3ff2f7a18d7; no release-build claim.

Evidence

Proof audit and independent rebuild addendum found the Android proof sufficient. The independent head phone run repeated the automatic return; its settled frame differs by 2,746 pixels (0.105%) in clock, cellular indicator, and the older control's later status label. Independent recording, rebuild script, and transcript are public. Cold-start blank UI and local persistence warnings were observed during setup; the verified transition used a loaded, live connection.

Fixture matrix, full evidence index and capture recipe, server completion transcript, diff generator, and compiler reproduction helper.

For each recording, send Run sleep 30 in shell then reply Done. Do not edit files., observe the thread working, then leave the list visible across completion and grace without tapping or navigating. Exact UTC milestones, raw recordings, narrated derivatives, scripts, and device details are in the index.

Android phone Home, Pixel 9 portrait, light, 1080×2424 captured pixels Before After Diff0 DiffT
Completed target returns above the idle control; empty Working header disappears Before recording
bfc7177f
After recording
d3de380d
Zero-threshold absolute difference amplified 8 times Pixels whose per-channel difference exceeds 16 of 255

Before: Done target stuck in Working. After: target returned above control. Right: absolute difference including clock.

Android tablet sidebar, Pixel Tablet landscape, light, 2560×1600 captured pixels: head recording. The collapsed shelf retains the selected target during work, then returns it automatically and removes the zero-count header. The final reselection recording ends with the conversation still loading; loaded content and identity after that action are supported by the linked accessibility transcript, not by a settled final video frame.

What else changed in the captures: wall clock/status-bar indicators differ, the target has one additional real turn at head, and the client/Metro restarted between revisions. Intended visible differences are shelf removal and fresh return ordering. No style change or pixel-identical claim is made. Android stops encoding a static tail: the base recording covers the running-to-Done transition, while the linked later unmodified still and persisted completion show it remained stuck 31 seconds after completion.

Unverified: native iOS tablet sidebar (A3). Its cached client installed, but pool orientation/launch/snapshot operations repeatedly timed out. No iOS runtime pass is claimed. Unchanged attention, placement, and continuation rules remain covered by existing tracker tests; no broader provider or transport sweep was performed.

Models and harnesses: Claude Opus 5.5 through Claude Code; GPT-6.1-Sol through Codex in T3 Code.

juliusmarminge and others added 3 commits October 26, 2026 07:10
The React Compiler keys useThreadListV2's inbox observe cache on threads
and workingShelfEnabled only, dropping the tracker version, so an expired
working grace never re-observes and the thread stays in the Working shelf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The React Compiler keys useThreadListV2's inbox memo only on values its
callback reads, so it dropped the tracker version and an expired working
grace never re-observed. Pass the version to observe so it stays a key.

Fixes #24901

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 26, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d3de380

Macroscope's review found this PR approvable — This is a narrowly scoped mobile bug fix that reconnects the existing inbox timer notification to the memoized thread-list calculation, so finished threads leave the Working shelf after the established grace period. The accompanying compiler regression test verifies the dependency, with no product-default, schema, or deployment changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d171a88 and d3de380.

Files selected for processing: 3
  • apps/mobile/src/features/threads/useThreadListV2.ts
  • apps/mobile/src/reactCompilerCoverage.test.ts
  • packages/client-runtime/src/state/threadInbox.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

The mobile thread list now passes inboxVersion to the inbox return tracker. The tracker accepts an optional version argument, and a React Compiler coverage test checks that the compiled observe call guard includes inboxVersion.

Changes: Mobile inbox observation

Layer / File(s) Summary
Version-aware tracker observation
packages/client-runtime/src/state/threadInbox.ts, apps/mobile/src/features/threads/useThreadListV2.ts, apps/mobile/src/reactCompilerCoverage.test.ts
The tracker’s observe method accepts an optional version. useThreadListV2 passes inboxVersion, and a compiler coverage test checks that the call guard includes it.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix, size:S

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to d3de3

No actionable merge-blocking issue is established for this change; it is ready for normal merge checks.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning Issue #24901 requires a finished thread to leave the Working shelf after the two-second grace period while Home remains visible. The change invalidates the memo when inboxVersion changes, but `obser… Update the tracker or observation flow so a timer expiry remains authoritative when the next observation receives the unchanged stale thread snapshot. Add a runtime regression test that keeps the thread list unchanged, advances past `WORKIN…
Passed Passed checks: 3 passed
Check name Status Explanation
Description check Passed The description includes all required sections. It clearly explains the bug, the fix, scope and approval, focused verification, limitations, and supporting evidence.
Title check Passed The title clearly and concisely describes the primary change: completed mobile threads return from the Working shelf.
Out of Scope Changes check Passed The PR changes only the mobile thread-list observation, the client-runtime tracker API needed to expose the version read, and a focused React Compiler regression test. These changes directly support i…
Full details: Out of Scope Changes check

Explanation

The PR changes only the mobile thread-list observation, the client-runtime tracker API needed to expose the version read, and a focused React Compiler regression test. These changes directly support issue #24901. No unrelated settings, persistence, protocol, or provider changes are present.

Full details: Linked Issues check

Explanation

Issue #24901 requires a finished thread to leave the Working shelf after the two-second grace period while Home remains visible. The change invalidates the memo when inboxVersion changes, but observe then recomputes actual from the supplied threads. The timer first sets the tracker state to working: false, then the rerun can receive the same stale thread with an active runtime and set working back to true. The added test checks only the compiled cache guard. It does not verify the finished-thread behavior with an unchanged stale thread list. The input and attention rules remain supported by the existing tracker logic, but the finished-thread requirement is not established and the shown state flow can reintroduce the reported bug.

Resolution

Update the tracker or observation flow so a timer expiry remains authoritative when the next observation receives the unchanged stale thread snapshot. Add a runtime regression test that keeps the thread list unchanged, advances past WORKING_EXIT_GRACE_MS, and verifies that the thread is no longer working and is returned to the normal section.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Finished or input-waiting threads stay stuck in the mobile Working shelf

1 participant