Repository navigation
fix(mobile): keep new threads available during creation - #37
Merged
Merged
Conversation
Composer metadata readers opened a thread subscription before its queued creation reached the server. The resulting not-found response stayed in the deleted resume state after the thread started running. Read composer metadata through the selected thread's creation gate so history loading begins once the server confirms the thread exists.
The composer subscribed to queue state using the optimistic thread shell, which could request a snapshot before the server created the thread and cache the missing response as deletion. Use the selected detail reference so queue state follows the existing creation gate.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
khoi
marked this pull request as ready for review
October 4, 2026 19:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a newly submitted mobile thread can show “Thread unavailable” while the server is running it. Composer readers can request its bounded snapshot before thread creation commits; the resulting 404 becomes a cached deleted state until the app restarts.
Change
Make reported model, queued count, subagent metadata, and composer queue workflow use
selectedThreadDetailRef. This existing selection gate opens detail subscriptions after the server shell arrives or creation delivery succeeds.Scope and approval
This is a focused fix for the obvious creation race reported by khoi. It applies to the shared iOS and Android thread screen across providers and connection modes. The matching upstream report documents the same ordering and includes a reproduction recording.
Verification
The mounted hook regressions verify zero snapshot requests while creation is pending or rejected, and one request after delivery or server shell arrival. The focused suite passed all 24 tests:
vp test run apps/mobile/src/state/use-thread-detail.test.tsx apps/mobile/src/state/pending-thread-creation.test.ts apps/mobile/src/features/threads/threadContentPresentation.test.tsChanged-file lint and
vp run --filter @supacode/mobile typecheckpassed. The simplify pass and both thermos audits found no actionable findings.Native iOS verification passed on final head
88ea790c3after integrating the native crash fix from main. An existing conversation opened, and a new task showed its message, entered the starting state, displayed its reply, and reopened without “Thread unavailable”. The earlier Fabric crash occurred on both versions and is resolved by the change in main. Android was not tested. The successful iOS recording and screenshot were captured locally; GitHub attachment upload is unavailable because the collaborative browser is signed out.Built with GPT-6.1 Sol in Supacode through the Codex harness.