Skip to content

Show a steer waiting between steps as pending - #1100

Merged
ivanfenenko merged 2 commits into
mainfrom
fix/steer-pending-between-steps
Nov 23, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
fix/steer-pending-between-steps

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • A steer waiting between two steps of a run now shows the pending style from Session Chat: show steering messages in the timeline #902: dashed outline, "Steering" label, and "Pending · sends at the next step".
  • Before this change, the timeline decided a run was active from the newest assistant message alone. That message is finished between steps, so the waiting steer looked like a normal sent message while Up next still listed it.
  • The timeline now also uses the session status. A waiting steer is pending when the session is busy and the current run has produced assistant output.
  • An idle prompt stays unlabelled. v2 enqueues it as a steer too, but delivers it before the run produces any output.

Checks

Run on this branch merged with main at 3d9a903. main has since gained only Server Health changes, which do not touch these files.

  • Android: :app:testDebugUnitTest for dev.opencode.mobile.ui.sessionchat.*, 978 tests passed.
  • iOS: 44 Session Chat suites, 912 tests, 1 failure in sendPrompt_attachmentInFlight_showsSendingPercent. That test is timing-sensitive and also fails on main.
  • iOS flake comparison, SessionChatViewModelTests run 25 times each, alternating: main had 6 failing runs and this branch 3. Every test that failed on this branch also failed on main. sendPrompt_postSendReloadMatchingUser_dropsOptimistic did not fail again.
  • Real apps on a v2 harness server: pending between steps, delivered in place with no duplicate, and an idle send with no label, on iOS and Android.
  • Real apps on a v1 harness server (1.19.6): the steer is delivered once and an idle send has no label, on iOS and Android. v1 has no waiting state, so the pending style does not appear there.
  • The late-status and pending-prompt fixes are covered by unit tests. The race itself was not reproduced live.

Evidence

Screenshots in the evidence comment.

Issue

Follow-up to #902.

Risks / Follow-ups

  • If a run finishes while the app misses its busy status, and the next run's busy status arrives before its prompt, that idle prompt can briefly show as a steer.
  • A steer that was marked pending keeps that mark if the run ends without delivering it. This comes from Session Chat: show steering messages in the timeline #902 and was read from code, not run.
  • Existing on main, not changed here: on v1, iOS draws a steer before the step it was sent during, while the server and Android place it after.
  • Existing on main, not changed here: other iOS timeline re-applies use an unbound task that can outlive a session switch.
  • The Android first-open report (only the steer shown until reopen) did not reproduce in 4 tries each on main and this branch, on v2.

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

iOS and Android against a v2 scenario harness server, using harness data. The session title comes from a temporary scenario that holds the run between two steps.

Step iOS Android
Steer waiting between steps iOS pending steer Android pending steer
Steer delivered in place iOS delivered steer Android delivered steer
Later idle send has no label iOS idle send Android idle send

@ivanfenenko
ivanfenenko marked this pull request as ready for review November 22, 2026 22:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review: 1 finding(s) that 2+ of 3 passes agreed on.

4 finding(s) from a single pass, not posted
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/SessionChatSteer.swift:24 high: Late busy status swallows first output, steer never pending (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/region/SessionChatTimeline.kt:180 medium: "session-run" re-apply expires pending prompt patches, unlike iOS and sibling Android re-applies (glm-5.3-flash)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Region/SessionChatTimeline.swift:114 low: Unbound re-projection Task can repaint a previous session's messages (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/region/SessionChatTimeline.kt:167 low: Pending steer mark is never removed on the busy->idle edge (deepseek-v4.1-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.115

if (!isResolved) return
if (isBusy && !this.isBusy) {
// Opening a session mid-run: everything loaded may belong to this run.
baselineAssistantId = if (hasResolvedStatus) newestAssistantId(messages) else null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high: Late busy status swallows first output, steer never pending

Baseline is captured from whatever messages happen to be loaded when the busy status arrives. If the message refresh lands first, the new run's first assistant output is already in the list and becomes the baseline, so hasOutput() stays false for the rest of the run.

Failure scenario: Idle history [u1,a1-done] with resolved idle status; run starts and messages refresh to [u1,a1,u2-delivered,a2-done] while status is still stale-idle; status then flips to busy with those messages, so update() sets baselineAssistantId=a2. A later steer u3 waiting between steps has newest=a2 == baseline, hasOutput()=false, and runIsActive(frame)=false (a2 finished), so markSteers leaves steer null and the waiting steer renders as a normal sent message.

Found by 3 of 3 passes.

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Updated evidence after the late-status fix: iOS and Android against a v2 scenario harness server, using harness data. The session title comes from a temporary scenario that holds the run between two steps.

Step iOS Android
Steer waiting between steps iOS pending steer Android pending steer
Steer delivered in place iOS delivered steer Android delivered steer
Later idle send has no label iOS idle send Android idle send

@ivanfenenko
ivanfenenko added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 76f969f Nov 23, 2026
@ivanfenenko
ivanfenenko deleted the fix/steer-pending-between-steps branch November 23, 2026 13:33
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