Skip to content

Allow another phone send after delivery is unconfirmed - #26392

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/nc-phone-in-doubt
Oct 8, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/nc-phone-in-doubt

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​341 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1854 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1513
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​149 $\color{#cf222e}{\Huge{\mathbf{−}}}$​869 $\color{#cf222e}{\Huge{\mathbf{−}}}$​720

ELI5

When the built-in chat on the phone lost confirmation that a Send reached the host, sending the same text again could keep showing “Delivery unconfirmed” forever. The phone treated matching text as the same old attempt, so the host correctly returned that attempt’s unresolved result instead of sending the new message.

A later tap on Send now creates a new message, including after reopening the app. The original message keeps the host’s recorded status.

What Changed

Each structured phone Send uses the existing mutation sender’s fresh operation ID. Removed the saved fingerprint-only send journal, its cleanup hook, alternate capability matching, attachment-path substitution, and automatic resends after withdrawal. New sends use their current uploaded images and the currently connected host’s advertised queue support.

The old page-storage key remains permitted so phone apps can still load an older host’s embedded page bundle. The request shape and host-side duplicate protection are unchanged.

The main conflict is resolved by keeping the image-content fingerprint removed. Its only consumer was the deleted send journal, so also removed the unused image hash dependency, native/browser fingerprint modules and tests, browser override entry, and the serialization wrapper introduced for browser hashing. Attaching an image no longer computes an unused hash; the host's shared payload fingerprint still hashes the identical canonical input.

Why

The removed journal stored IDs, fingerprints, and image paths; it stored no message text and provided no recovery outbox. Expiring or rotating its payload records would keep two competing accounts of a send and leave storage failures capable of blocking Send. The host already owns admitted messages and queued cards, while a person’s later Send is a separate action.

Differences from the common pattern:

  • Intended: Orca sends a client operation ID because supported hosts use it to prevent repeat delivery of one attempt; separate user actions receive separate IDs. If the first unknown attempt reached the agent, a deliberate later Send can produce another copy.
  • Intended: this PR adds no durable phone outbox; phone composer drafts remain in memory. Only per-action identity follows the common pattern, not persistence or transport retry. A phone killed between Send and host recording loses that text today and still does. Adding a recoverable outbox or persisted drafts is separate work.

Linked Issue

N/A — maintainer follow-up from a native chat audit.

Visual Proof

Native iOS simulator captures use the device framebuffer. Captured from the device framebuffer because opening another Simulator window would disturb the shared desktop. All input used Orca emulator on an isolated device, with an isolated host and a stand-in agent.

After host restart and app relaunch, the original bubble remains and Send is available. The host journal still records its delivery as unknown; the phone shows no uncertainty badge. This is the state before the next Send on the fixed build, not an original-code baseline:

Original bubble after recovery

A new Send of the same text completes. The journal and provider transcript confirm a distinct new message ID and accepted delivery:

Same-text Send completes

An ordinary Send also completes:

Ordinary Send completes

Current-host Send while busy also completes with a fresh ID. The stand-in deliberately refuses steer, so this verifies the host's supported direct-start fallback, not a real-provider steer:

Busy follow-up Send completes

The original-code native repro was blocked during rig setup. The original-code unit repro and byte-for-byte ablation are the before-fix proof.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

The original-code unit repro and byte-for-byte ablation fail the exact lost-answer/same-text sequence, including after remount. After this conflict-resolution sync, all 241 tests in 19 focused mobile files, 1,201 recording/replay tests in two files, and 48 host-ledger, storage and rendering checks in eight files passed. The image-upload recordings retain identical requests and wire payloads. Fresh queued mobile production, renderer, main-process and CLI typechecks and the mobile test typecheck ratchet passed. Repository checks passed 21/22; the only failure is five import-cycle warnings independently reproduced with identical file/line/messages on source archived from the merged main parent. Runtime English catalog verification passed.

Final head 4a83a2730c4f0339d4a65aac56ff8a104cc65192: all 37 checks completed, with 23 passed and 14 skipped; skipped jobs are not passes. PR Checks passed all ten unit shards, relay integration, static analysis/typecheck, the mobile web bundle, wire compatibility, and both packaging jobs. Mobile Checks passed the full mobile suite; Headless checks passed persistence on Ubuntu. No red or pending CI checks remain.

The existing native iOS simulator evidence is carried forward: equal-text resend after host/app recovery, ordinary Send, and busy Send through the current host's supported direct-start fallback passed. The stand-in refuses steer, so real-provider steer is unverified. Queue support remains deliberately dark on shipped hosts; capable-host cards have unit coverage. Original-code native setup was blocked; the unit repro and ablation provide the before-fix proof. Native QA was not repeated for this merge/dead-code cleanup; physical phones, live SSH and native Windows/Linux UI were not exercised.

Review

The earlier independent review found no P0–P3 defects and passed 258 targeted tests. The coordinator approved merged head 4a83a2730c4f0339d4a65aac56ff8a104cc65192 after checking that the resolution preserves the reviewed send design, removes only the unused image-fingerprint additions, leaves shared canonical payload hashes unchanged, and has no remaining references to removed symbols. Persistence and retry parity remain outside this change.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source is copied or translated.

Notes

Phone-only change; no host, remote-execution, path, or shortcut behavior changes. The same per-action identity applies to SSH hosts and folder workspaces. Mixed-version requests retain capability gating.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Native screenshots attached; original-code baseline limitation explained
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Required checks completed; local baseline warnings explained

@brennanb2025

brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

When the built-in chat on the phone lost its Send confirmation, sending identical text again could keep returning “Delivery unconfirmed” because the saved payload fingerprint reused the unresolved attempt. A later Send now gets a fresh message identity, including after reopening the app; the host retains the original attempt and prevents repeated delivery of that same attempt.

Removed the fingerprint-only journal and related matching/reconciliation paths. It stored no text and could not recover a message. The main conflict is resolved without restoring image fingerprints: the journal was their only consumer, so the unused native/browser hash code, tests, dependency and browser override are also removed. Image uploads no longer compute an unused hash; shared host payload hashes and the wire shape are unchanged.

A deliberate later Send can produce another copy if the unknown first attempt reached the agent. Intended difference: no durable phone outbox is added. A phone killed between Send and host recording loses that text today and still does.

The original-code unit repro and byte-for-byte ablation fail both equal-text cases. The merged fix passes 241 focused mobile tests, 1,201 recording/replay tests and 48 host/storage/render checks. Fresh queued mobile, renderer, main-process and CLI typechecks and the mobile test ratchet pass. Earlier independent review found no P0–P3 defects; the coordinator reviewed and approved this exact merged head and its unused image-hash removal.

Native iOS simulator screenshots in the PR body are carried forward: equal-text resend after host/app recovery, ordinary Send, and current-host busy Send completed. The busy fixture refuses steer, covering the supported direct-start fallback. Queue support remains deliberately dark; capable-host cards have unit coverage. Original-code native setup was blocked; native QA was not repeated for this merge cleanup. Physical phones, real-provider steer, live SSH and native Windows/Linux UI were not exercised.

Final head 4a83a2730c4f0339d4a65aac56ff8a104cc65192: all 37 checks completed, with 23 passed and 14 skipped; skipped jobs are not passes. PR Checks passed all ten unit shards, relay integration, static analysis/typecheck, the mobile web bundle, wire compatibility, and both packaging jobs. Mobile Checks passed the full mobile suite; Headless checks passed persistence on Ubuntu. No red or pending CI checks remain.

Local repository checks passed 21/22; the sole failure is five import-cycle warnings reproduced with identical file/line/messages on archived merged-main source. Runtime English catalog verification passed. The PR remains ready and unmerged.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 8, 2026 03:32
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af576c42-6474-4b4b-ab6e-b5138450eb36
📥 Commits

Reviewing files that changed from the base of the PR and between 8935403 and 4a83a27.

📒 Files selected for processing (8)
  • mobile/src/platform/native-chat-image-fingerprint.ts
  • mobile/src/platform/native-chat-image-fingerprint.web.test.ts
  • mobile/src/platform/native-chat-image-fingerprint.web.ts
  • mobile/src/session/mobile-native-chat-image-attachment.test.ts
  • mobile/src/session/mobile-native-chat-image-attachment.ts
  • mobile/src/session/use-mobile-native-chat-image-upload.ts
  • mobile/web-entry/web-overrides.json
  • src/shared/structured-agent-session-mutation.ts
💤 Files with no reviewable changes (5)
  • mobile/src/platform/native-chat-image-fingerprint.ts
  • mobile/src/platform/native-chat-image-fingerprint.web.test.ts
  • mobile/src/session/use-mobile-native-chat-image-upload.ts
  • mobile/src/platform/native-chat-image-fingerprint.web.ts
  • mobile/web-entry/web-overrides.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Mobile structured sends no longer persist or reuse operation IDs after ambiguous results. Each Send follows the new-action path, while existing unknown submissions remain in session state. The delivery mapper classifies results without retained-send state. Attachment contracts and upload results no longer include content fingerprints. Tests and reliability-gate records were updated to reflect these changes.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 4a83a

No actionable merge-blocking risk was identified in the reviewed change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: allowing a later phone Send after delivery confirmation is lost.
Description check ✅ Passed The description is complete and relevant. It explains the user impact, implementation changes, rationale, testing, visual evidence, compatibility considerations, and checklist status. The Linked Issue…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
mobile/src/session/use-mobile-structured-agent-session-send.test.tsx (1)

179-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the fixture-only assertion.

event.page.submissions[0]?.dispatchState reads the test fixture, not hook-owned state. It cannot detect a hook change.

The existing expect(hook!.session.messages).toEqual(messages) assertion does check the projected message list and can detect a visible row replacement. However, the hook does not expose submissions, and NativeChatMessage does not include dispatchState. Do not replace this with hook!.session.submissions. Remove the ineffective assertion, or test dispatch state through a lower-level state API if that state must be covered.

♻️ Suggested fix
-    expect(event.page.submissions[0]?.dispatchState).toBe('unknown')

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94a4477f-b18f-488a-9294-9d6ac2898a0d
📥 Commits

Reviewing files that changed from the base of the PR and between 7cd92a3 and 8935403.

📒 Files selected for processing (36)
  • config/reliability-gates.jsonc
  • config/scripts/mobile-mirrored-storage-write-path.test.mjs
  • config/scripts/mobile-web-app-session-render.test.mjs
  • mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json
  • mobile/rpc-foundation/goldens/native-chat-image-upload-single.json
  • mobile/rpc-foundation/goldens/native-chat-image-upload-two.json
  • mobile/src/mobile-web-shell/page-storage-keys.ts
  • mobile/src/session/mobile-native-chat-controller-contract.ts
  • mobile/src/session/mobile-native-chat-image-attachment.test.ts
  • mobile/src/session/mobile-native-chat-image-attachment.ts
  • mobile/src/session/mobile-structured-agent-session-rpc.ts
  • mobile/src/session/mobile-structured-agent-session-send-bypass.test.ts
  • mobile/src/session/mobile-structured-agent-session-send.ts
  • mobile/src/session/mobile-structured-send-delivery.test.ts
  • mobile/src/session/mobile-structured-send-delivery.ts
  • mobile/src/session/mobile-structured-send-new-action.test.ts
  • mobile/src/session/mobile-structured-send-operation-journal.test.ts
  • mobile/src/session/mobile-structured-send-operation-journal.ts
  • mobile/src/session/mobile-structured-send-page-storage-refusal.test.ts
  • mobile/src/session/use-mobile-native-chat-controller.ts
  • mobile/src/session/use-mobile-native-chat-image-attachments.test.ts
  • mobile/src/session/use-mobile-native-chat-session-lane.ts
  • mobile/src/session/use-mobile-session-image-attachments.ts
  • mobile/src/session/use-mobile-structured-agent-session-background-tasks.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session-newer-approval-send.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session-prompt-cancel.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session-queued.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session-read-failure.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session-send.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts
  • mobile/src/session/use-mobile-structured-send-operation-reconciliation.ts
  • mobile/src/session/use-mobile-structured-send-with-outcome.ts
  • mobile/src/storage/mirrored-storage-keys.ts
  • mobile/tests-typecheck-baseline.txt
💤 Files with no reviewable changes (15)
  • mobile/src/session/use-mobile-native-chat-controller.ts
  • mobile/src/session/mobile-structured-send-operation-journal.test.ts
  • mobile/src/session/mobile-native-chat-controller-contract.ts
  • mobile/tests-typecheck-baseline.txt
  • mobile/src/session/use-mobile-structured-agent-session-prompt-cancel.test.tsx
  • mobile/src/session/use-mobile-session-image-attachments.ts
  • mobile/src/session/use-mobile-structured-send-operation-reconciliation.ts
  • mobile/src/session/mobile-structured-send-page-storage-refusal.test.ts
  • config/scripts/mobile-mirrored-storage-write-path.test.mjs
  • mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-native-chat-session-lane.ts
  • mobile/src/session/mobile-structured-agent-session-send-bypass.test.ts
  • mobile/src/session/use-mobile-structured-send-with-outcome.ts
  • mobile/src/session/mobile-structured-send-operation-journal.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

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.

1 participant