feat: persist pending task prompts and recover it on failure#3053
Merged
jonathanlab merged 3 commits intoJul 1, 2026
Conversation
Generated-By: PostHog Code
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat: persist pending task prompts and e..." | Re-trigger Greptile |
Address PR review: - The success-path clear used `"provisioningError" in result`, but the field lives at `result.data.provisioningError`, so the guard was always false and cleared the durable prompt even when provisioning failed. Use the real path so a kept-but-unprovisioned task keeps its prompt for recovery. - Bound `pending-task-prompts` storage with a fixed cap (20), evicting the oldest beyond it and logging the drop, so orphaned prompts can't grow unbounded in electronStorage. Generated-By: PostHog Code Task-Id: bb024b86-4ac5-4ec6-87af-3d8809d28466
persist calls onRehydrateStorage with state=undefined on a hydration error, so setHasHydrated was never called and whenHydrated() (and the recovery flow that awaits it) would hang forever. Flip the hydrated flag via getState() on error too, so recovery proceeds even if the persisted prompts can't be read. Generated-By: PostHog Code Task-Id: bb024b86-4ac5-4ec6-87af-3d8809d28466
frankh
approved these changes
Jul 1, 2026
tatoalo
approved these changes
Jul 1, 2026
frankh
added a commit
that referenced
this pull request
Jul 1, 2026
#3054 added kill-timeouts to `git worktree add` and the post-checkout hook, and #3053 restructured the saga to clear the provisioning spinner and keep the task for retry when provisioning fails. Both landed on main and supersede the worktree-add/hook-timeout and spinner-clearing parts of this PR, so those are dropped here. The one hang path neither covered is the `git fetch` that precedes worktree creation — the trigger both fixes cited. It still runs unbounded inside the per-repo write lock, so a blocked fetch (network stall, unreachable remote) never settles, the lock is never released, and every later worktree creation for that repo queues behind it forever. Bound the two fetch call sites (resolveFreshBaseRef and createWorktreeForRemoteBranch) with a timeout. The fetch runs through simple-git rather than a raw spawn, so it can't use armProcessTimeout; instead it aborts via the AbortSignal executeWrite already forwards to its scoped git client, which kills the fetch subprocess and releases the write lock. On timeout the trunk path degrades to the local ref and the remote-branch path fails with a retryable error, rather than hanging.
Gilbert09
added a commit
that referenced
this pull request
Jul 2, 2026
#3053) Ports desktop #3053 to the mobile app so a user's typed new-task prompt is never silently lost when task creation fails or the app is killed mid-flight. - Add a separate AsyncStorage-backed `pendingPromptRecoveryStore` (distinct from the transient in-memory echo store, whose entries must vanish when the live SSE copy lands). Records a prompt when creation begins, clears it once the task exists or on failure, and caps to the newest 20 entries. - Add a mount-once `PendingPromptRecovery` component that, after the store hydrates, recovers the newest orphaned prompt exactly once per launch and routes to the new-task composer pre-filled with it. - Wire clear-on-success / clear-on-failure into the create flow. Generated-By: PostHog Code Task-Id: 398f655d-ec85-4295-99cd-585d3debfd17
Gilbert09
added a commit
that referenced
this pull request
Jul 2, 2026
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.
Persist our prompt during task creation, so a hang/app crash/task creation failure won't lose it
Created with PostHog Code