fix(mobile): use the archive eligibility guard when dispatching - #9930
Merged
shivamhwp merged 3 commits intoSep 5, 2026
Merged
Conversation
Contributor
|
Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies. |
saphid
force-pushed
the
fix/v2-mobile-archive-guard-20260905
branch
from
September 5, 2026 05:07
dae82c8 to
9f7b983
Compare
saphid
marked this pull request as ready for review
September 5, 2026 07:19
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused one-file bug fix that aligns archive dispatch with the existing eligibility policy, allowing eligible waiting threads while continuing to block actively executing turns. No schema, configuration, security-sensitive, or static-analysis changes are involved. You can add or adjust custom eligibility rules. Learn more. |
shivamhwp
merged commit Sep 5, 2026
315f53f
into
pingdotgg:t3code/codex-turn-mapping
24 checks passed
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.
React Native could offer Archive and then reject it because the action handler used a broader “active” predicate than the menu. Reuse
threadCanArchiveat dispatch so queued/waiting states follow the existing archive policy while executing turns remain protected.Verified the mounted native archive callback on an isolated iPhone 16 Pro simulator (iOS 26.5), using the Legacy Thread List and a disposable thread. Before:
useThreadListActions.tsfromb9fa1399c. After: #9930 head9f7b9838b, patch-identical in integrationfa6a1ab04. Native Debug build: exit 0.The callback received the same injected
runtime.status = "waiting"fixture with a retained active-run ID on both bundles. Before, it showed the incorrect “working” alert. After, it sent the real archive command, the server persistedarchivedAt, and the active-list count fell from 3 to 2. Restore through the mounted unarchive callback clearedarchivedAt; a repeat archive succeeded.Annotated screenshots
Automation limits: iOS did not expose thread rows as actionable accessibility targets, so the registered React callbacks were invoked through the development runtime. The physical row gesture was not exercised. A real Codex user-question turn still reports
running, so thewaitingstate was explicitly injected at the callback boundary; this is a guard regression fixture, not a claim that that live provider state naturally becomeswaiting. The initial direct deep-link entry to Archived Threads mounted a row without displaying it; that existing native presentation gap remains. A supplemental pass through the normal Settings → Archived Threads route displayed the row and exercised restoration as described below.Supplemental normal Settings route and restoration proof
Normal Settings → Archived Threads shows the archived row (integration
fa6a1ab04). On integrated candidate860f3a6f5, the publicSwipeable.openRight()API exposed the row actions, then the actual semantic Unarchive button was tapped. The screen showed “No archived threads”; the server clearedarchivedAtand the active-list count returned to 3. Both revisions contain the same #9930 archive hook. This supplements the waiting-state guard fixture above; it does not exercise the physical row swipe or establish that the initial direct deep-link presentation gap is fixed.Validation: all 3 archive-eligibility tests, React Native typecheck, and targeted lint passed in frozen verification. This changes only the React Native archive hook; Android was not separately exercised. Targets Julius’s Orchestrator V2 branch in #2829.
A direct Claude Opus 5 high review attempt exited 1 because OAuth expired before model execution; no Claude review occurred. Implemented and verified with GPT-6 Astra in Codex/T3.
Note
Low Risk
Single guard swap in the React Native archive path; behavior is narrowed to match existing archive policy and tests, with no auth or server contract changes.
Overview
Fixes a mismatch where the thread list could show Archive but the action handler blocked it with a stricter “active runtime” check than the menu uses.
Archive dispatch in
useThreadListActionsnow usesthreadCanArchive(same as eligibility elsewhere) instead ofthreadRuntimeIsActive. Threads inwaiting(and other non-executing states) can archive when policy allows; turns still inpreparing,starting, orrunningkeep the existing “working—interrupt first” alert.Reviewed by Cursor Bugbot for commit 9f7b983. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Use
threadCanArchiveguard instead ofthreadRuntimeIsActiveinuseThreadActionExecutorReplaces the direct
threadRuntimeIsActivecheck with the existingthreadCanArchivepredicate when deciding whether to dispatch an archive action. The rejected case still shows the same alert and returnsfalse. Risk:threadCanArchive(thread.runtime)may reject archive in states wherethreadRuntimeIsActivewould have allowed it — verify the predicate's conditions in useThreadListActions.ts cover the intended runtime states.Macroscope summarized 1447ae0.