Skip to content

test(mobile): Edit task reopens a rejected saved-agent task with its text and agent - #880

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-edit-task-test
Nov 1, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-edit-task-test

Conversation

@Jacksondr5

Copy link
Copy Markdown
Owner

Problem

L-ios-2 was seen once on iOS in wave 1: after a saved-agent task failed to send offline, "Edit task" on the failed card opened an empty draft instead of the original text and persona. Jackson skipped the live re-check at Checkpoint 1, so the Captain asked for an automated test. If the test exposed a real bug, the fix was to come in the same PR.

What changed

A test in apps/mobile/src/state/threadOutboxDelivery.test.ts covers the whole recovery chain:

  1. A new task with a saved agent (luna-helper) is rejected on delivery ("Model turned off for this project").
  2. "Edit task" runs recoverFailedThreadDraft.
  3. The draft the button opens (restoredNewTaskDraftKey(messageId), the key ThreadRouteScreen navigates to) holds the original text, the project stamp that openDraft needs, and the saved agent.

It passes on trunk, so this PR has no fix. The existing tests covered the restore alone; this one adds Edit task's recovery step and checks the key the button actually opens.

Not covered: one remaining hypothesis. It's in upstream's NewTaskDraftScreen and isn't reachable from a state test. When the screen opens the draft, openDraft succeeds only once the stamped project has loaded. If some projects have loaded but not that one (for example, another server is still connecting), the screen gives up and opens the project picker, which would look like an empty draft. That's upstream behaviour, and nothing shows it's what happened on iOS, so I haven't changed it. If Checkpoint 2 reproduces L-ios-2, this is where to look first.

Live testing

None: this PR adds a test only. Re-checking "Edit task" on Jackson's iPhone is part of Checkpoint 2.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: this PR is the test
  • UI changes: none
  • Live testing: none needed for a test-only PR
  • Upstream-owned files: none edited. threadOutboxDelivery.test.ts is upstream's test file; adding a case there follows AGENTS.md ("in the module's existing test file").
  • Upstream product: no change
  • Surfaces: mobile only; the outbox is mobile's
  • Docs: none

Built by Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

…text and agent

L-ios-2 was seen once on iOS: "Edit task" after a failed offline send opened
an empty draft. This pins the whole recovery chain: a rejected new task with a
saved agent, then Edit task's recovery, leaves the draft the button opens with
the original text, project and agent. It passes on trunk, so no fix comes
with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 1, 2026 8:15pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 10 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 3 included reviews currently available. Your 43 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between edc4350 and d509a80.

Files selected for processing: 1
  • apps/mobile/src/state/threadOutboxDelivery.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined panel review (reviewer-opus + reviewer-sol) at 1856356

Verdict: no findings, and the panel approves this test-only PR.

  • The test drives the real recovery chain: a saved-agent new task is rejected on delivery (restoreRejectedQueuedMessage), then "Edit task" runs recoverFailedThreadDraft. It then checks the key the button actually opens: ThreadRouteScreen.tsx:832–844 awaits the recovery, then replaces the route with restoredNewTaskDraftKey(messageId). It asserts the text, the project stamp that openDraft needs, and the saved agent.
  • It passes on trunk, so no fix is claimed, and that's right. The case lives in the module's existing test file, as AGENTS.md asks.
  • The limit is stated correctly. It doesn't mount navigation or NewTaskDraftScreen, so it doesn't prove L-ios-2 gone on a device. The untested hypothesis (upstream's openDraft gives up when other projects have loaded but not the stamped one) is upstream behaviour with no evidence of impact yet, so it's right to leave it for Checkpoint 2.
  • Reviewer-run: the new case passes (1 of 1, with the 25 unrelated cases filtered out).

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Nov 1, 2026
@Jacksondr5
Jacksondr5 merged commit 63eff89 into j5/main Nov 1, 2026
32 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-edit-task-test branch November 1, 2026 20:45

This branch was successfully deployed

1 active deployment
Preview — d509a802 Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant