Skip to content

mobile: persist thread plan mode across relaunch - #353

Merged
0xSero merged 3 commits into
mainfrom
fix/persist-thread-plan-mode
Sep 14, 2026
Merged

0xSero merged 3 commits into
mainfrom
fix/persist-thread-plan-mode

Conversation

@0xSero

@0xSero 0xSero commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Purpose

Fixes #100 — plan mode state is lost after the app crash/relaunch. Revival of the closed #220 approach, rebuilt on current main. Reported and analyzed by @julianpistorius — thank you for the detailed reproduction and the persistence-direction suggestion.

Key changes

  • Persist non-default per-thread collaboration mode in a bounded, Rust-owned thread_modes.json (shared Rust, one store file — no platform-side parsing).
  • Restore the persisted mode through the canonical reducer on list, lifecycle, and hydrated snapshots.
  • Reconstruct the "Implement Plan" affordance on cold hydration only when the latest proposed plan has no later user turn (restore_plan_implementation_prompt_from_history, wired into upsert_thread_snapshot with a properly scoped existing-thread lookup).
  • Explicit Default keeps clearing the stored mode; dismissed prompts are not resurrected.

Verification

  • cargo test -p codex-mobile-client -p codex-slingshot on the rebased branch (current main 0e843080): 806 lib tests + all slingshot suites, 0 failures — includes three new plan-persistence tests (restore-on-cold-hydration, dismissed-prompt stays dismissed, user-turn-after-plan suppresses restore) plus the item-completed / turn fixture repairs.
  • upstream::ItemCompletedNotification and upstream::Turn test fixtures updated for the upstream struct fields (completed_at_ms, items_view).

Notes

@0xSero
0xSero merged commit 0c26ee7 into main Sep 14, 2026
10 checks passed
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.

Mobile: plan mode state is lost after app crash/relaunch

2 participants