Repository navigation
#1002 Send iOS prompts directly in the foreground and offer Retry when stuck - #1003
Merged
Merged
Conversation
…n stuck Prompts went only through the background URLSession, whose daemon can hold an upload with no signal to the app. A foreground prompt now goes over an in-process session first and hands off to the background session when the app is about to be suspended or the direct attempt fails. After 20 s without an answer the chat shows "Still sending…" with Retry, which resends on a new connection with the same message id. Leftover background uploads older than 2 minutes are cancelled at launch. The diagnostic log now records each attempt, a pending line every 10 s, task metrics, app state, Low Power Mode, the network path, leftover tasks, and the server's echo of user messages. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Automated review: no finding that 2+ of 3 passes agreed on.
4 finding(s) from a single pass, not posted
ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Region/SessionChatComposer.swift:1353high: Stall timer calls MainActor state off the MainActor (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Data/Remote/DurableJSONUploader.swift:377high: Cross-origin redirect forwards prompt body to third party (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Data/Remote/DurableJSONUploader.swift:149medium: TOCTOU on app-active check picks the wrong transport (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Data/Remote/DurableJSONUploader.swift:305medium: Kept young orphans complete untracked and out of order (muse-spark-1.3-contributor)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.112 · 1 pass(es) stopped early
ivanfenenko
added a commit
that referenced
this pull request
Nov 9, 2026
Keep both sides in Session Chat: the draft's Retry action (#1004) and the "Still sending…" stall Retry from #1003 share the snackbar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
Fixes #1002
On iOS, prompts went only through the background
URLSession. Its system daemon can hold an upload without telling the app. When that happened, Send stayed disabled with no error, and the prompt could land minutes later, out of order. The server is ruled out; the investigation is in the issue.Hardening
taskDescription.RedirectPolicy, like REST calls.Diagnostics (all in the existing diagnostic log)
send,retry,suspending,direct-failed).URLSessionTaskMetricsper transaction: timings, protocol, reused connection, proxy, constrained/expensive/cellular. Remote addresses are not logged, and errors are logged as domain and code only, because their descriptions contain the server URL.message.updatedfor user messages, which is the server's echo of a prompt. It was hidden before.Evidence
Real app on an iOS 27.2 simulator against the scenario harness (opencode v2.2.6, scripted model). A scratch TCP proxy held the next
/promptconnection./prompt, 20 s laterApp log for the same run (session id from the harness):
Backgrounding with
/promptheld:The server held one user message per send in both runs.
Checks
Risks / Follow-ups
SessionInbox.reconcile). Not checked for v1. Retry resends only after the user taps it, and a handoff resends only an attempt that is cancelled or failed. The old background path already let the daemon resend on its own.suspendinghandoff waits for iOS to call the background-task expiration handler, about 30 s on the simulator. Not checked on a physical device or with Low Power Mode.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.