Skip to content

#902 Show steering messages in the Session Chat timeline - #909

Merged
ivanfenenko merged 2 commits into
mainfrom
feature/902-steering-in-timeline
Oct 31, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
feature/902-steering-in-timeline

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #899. Fixes #902

What

Prompts sent with steer during a run stay visible in the Session Chat timeline, on iOS and Android.

  • Pending steer: a user bubble, dimmed with a dashed outline, captioned "Pending · sends at the next step". No message actions (the Up next sheet still owns it).
  • Label: consecutive steers share one "↱ Steering" label, right-aligned above the first bubble. A timeline notice line (for example "Agent changed") between two steers does not split the group.
  • Delivered: the server's user message replaces the pending bubble in place (same row id, no insert/remove, no duplicate) over SSE or a REST refresh, and keeps the label. Revert, fork and copy work on it.
  • Queued prompts: unchanged, still only in the queued strip.

How

  • SessionChatSteer (isPending, showsLabel) on TimelineRow and the row model on both platforms.
  • The timeline projector shows waiting steer rows (it used to hide every row with a pending delivery), still hides queued rows, and runs markSteers after the optimistic merge.
  • The server does not keep delivery on a delivered message, and v2 enqueues every prompt as a steer, idle sends included. So:
    • A waiting steer counts as steering only when the newest assistant message is unfinished, or it is this device's busy steer send.
    • A row that was a steer in the previous frame keeps its mark once delivered.
  • A waiting-steer echo of a still-shown idle send stays hidden, so it never shows twice.
  • The optimistic busy-steer insert is marked from its first frame.
  • OpenCodeOutgoingMessage gains a steering variant (.pending / .delivered, each with showsLabel). Component Gallery outgoing-message pages show both states.
  • v1 has no follow-up delivery, so nothing changes there. No protocol-specific UI.

Checks

  • iOS: new SessionChatTimelineSteerTests (pending, grouping, notice inside a group, pending→delivered handoff, keeps label after the turn, idle send not labelled, optimistic busy steer handoff, idle-send echo not duplicated, queue vs steer, optimistic insert marking). Updated three SessionChatTimelineProjectorTests cases for the new contract. Full OpenCode MobileTests: 2896/2898 passed. The two failures (MessageSyncTests.hiddenReasoningTransportGap_reconcilesOnce, PermissionLiveStoreTests.clearCache_isolatesSameDirectoryAfterProfileSwitch) are timing tests that passed when re-run alone.
  • Android: new TimelineSteerTest (same cases). TimelineProjectorTest updated. Ran TimelineSteerTest, TimelineProjectorTest, SessionChatTimeline*, PendingPromptsFromTest and assembleDebug; all passed.
  • Real apps against the scenario harness on v2: a held queued-prompt-while-busy / hang-then-abort-in-app run, steered mid-run from the app. Screenshots are in a comment below.

Risks / Follow-ups

  • The delivered "Steering" label lives in memory. After an app relaunch, delivered steers show as plain prompts.
  • If you open a session (cold) while steers are still waiting on v2, the app showed them as plain prompts with no Up next strip, though /inbox still listed them. The waiting state seems to get lost on cold load, separately from this change. Not fixed here.
  • Not checked on a v1 server in the real app (v1 has no steer delivery).
  • iOS: no screenshot of the optimistic first-frame fix. It is covered by a unit test, and Android was checked live.
  • The existing "Agent changed" notice before each prompt shows between steers. It comes from earlier work.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Changes optimistic merge, row visibility, and timeline diff/layout logic for user messages—high user-visible surface but heavily covered by new tests and parity work on both platforms.

Overview
Steer follow-ups during an active run now appear in the session chat timeline on iOS and Android, while queued prompts stay in the strip only.

Outgoing bubbles gain optional steering styling: a shared ↱ Steering label on the first bubble in a consecutive run (notices in between do not break the group), pending steers shown dimmed with a dashed outline and Pending · sends at the next step, and delivered steers as normal bubbles that keep the label. Pending steers no longer open message actions (the Up next sheet owns them).

Timeline projection stops hiding all pending-delivery user rows and instead shows steer rows, runs markSteers after the optimistic merge (including first-frame marking on busy steer sends), treats steering only when a turn is active or the row was already steered, and suppresses duplicate waiting-steer server echoes while an optimistic row is still shown. SessionChatSteer (isPending, showsLabel) threads through row models, layout keys, and the timeline views.

Component gallery and previews document both steering states; new steer-focused unit tests cover grouping, handoff, and queue vs steer behavior on both platforms.

Reviewed by Cursor Bugbot for commit dc4851c. Bugbot is set up for automated code reviews on this repo. Configure here.

A prompt steered into a running turn now stays in the timeline as a user
bubble: dimmed with a dashed outline and "Pending · sends at the next
step" while it waits, then replaced in place by the server's message,
keeping the "↱ Steering" label. Consecutive steers share one label.
Queued prompts still stay out of the timeline. Pending steers have no
message actions; delivered ones do.

The projector marks steer rows and carries the mark from the previous
frame, since the server does not keep the delivery on delivered
messages. A waiting steer counts only while the newest assistant
message is unfinished or the send was a busy steer, so v2's idle
enqueue is not labelled.

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

@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: no finding that 2+ of 2 passes agreed on.

4 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/timeline/TimelineProjector.kt:529 high: Waiting-steer echo hide matches every new steer (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/SessionChatTimelineProjector.swift:370 high: Waiting-steer echo hide matches every new steer (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/timeline/TimelineProjector.kt:475 medium: Waiting steer sticks after run ends (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/SessionChatTimelineProjector.swift:341 medium: Waiting steer sticks after run ends (muse-spark-1.3-contributor)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.125 · 1 pass(es) stopped early · 1 pass(es) failed

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dc4851c. Configure here.

@ivanfenenko ivanfenenko left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review of the steering timeline projection (both platforms), the steer heuristic, the component variant and the tests.

Tests run on the PR head: Android TimelineSteerTest + TimelineProjectorTest pass (14 + 49). iOS SessionChatTimelineSteerTests + SessionChatTimelineProjectorTests pass (62). I also wrote a scratch probe for the multi-step case below; it is not committed.

Findings (inline):

  1. should-fix: in a multi-step run, a busy steer's optimistic bubble is drawn above the streaming reply until its echo arrives, then moves to the bottom. Both platforms. Confirmed with a probe.
  2. should-fix (Android only): a busy v2 slash command sent as a steer swaps its row id at handoff (remove + insert), because Android records no echo alias for a waiting-steer echo. iOS records one.

Existing bot comments:

  • cursor[bot] Pending steer markdown stays undimmed (Android): confirmed. The renderedMarkdown != null branch of OpenCodeOutgoingMessage.kt (around line 162) gets no pending alpha. Only the plain Text branch does. Optimistic and server user rows usually carry markdown, so most pending steers on Android dim only the background. iOS applies .opacity to the whole pill. Fix: wrap the bubble's inner Column in Modifier.alpha(if (isPending) PENDING_STEER_ALPHA else 1f) and drop the separate text-colour alpha.
  • github-actions Waiting-steer echo hide matches every new steer: mostly refuted. With a ClientMessageId, isNewServerEchoOf matches by id, so only the send's own echo is hidden. The id-less match applies only while an idle v2 command's optimistic row is still kept, which is a short window. isSending blocks a second local send during it. At most, a steer from another client in that window stays hidden for a frame or two.
  • github-actions Waiting steer sticks after run ends: refuted. A steer that is still waiting after an abort is still pending on the server: it is delivered with the next prompt, as the PR's own iOS evidence shows. So "Pending · sends at the next step" is accurate, and the mark is only carried while the row stays in the frame.

Checked, no issue found: carried-forward marks live only in the previous frame's rows, so they are bounded and reset on session bind or cold error. They don't leak across sessions. v1 rows never carry pendingDelivery, so markSteers is a no-op there. There is no protocol branch in feature UI. A v2 idle send from this device is not mislabelled: the optimistic row stays until a non-steer echo arrives, and the waiting echo is hidden. Label and caption sit inside the time-reveal container on both platforms, so drag-to-reveal (#897) moves them with the bubble. Colours come from the text-weak / text-weaker tokens.

Evidence comment: the images in the evidence comment did not upload. Its body still references ./ios-01-pending-steer.png and the other files as relative paths, so every cell renders as a broken image. Please re-post it with a gh build that supports --attach (2.102+), per CLAUDE.md.

- Append pending steer rows after the streaming reply instead of
  splicing them above it, so a busy steer no longer jumps up and back
  down in a multi-step run (iOS and Android).
- Android: record the list-key alias for a shown waiting-steer echo, so
  a v2 command steer with a local id keeps its row at handoff.
- Android: dim the whole pending bubble, markdown included, like iOS.

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

Copy link
Copy Markdown
Collaborator Author

Evidence: steering in the timeline (scenario harness, v2)

A held run, steered mid-run from the app. Android was recaptured after the review fixes. The first Android steer has markdown (staging), which now dims like the rest of the bubble.

Step iOS Android
01 Pending steer ios pending android pending
02 Consecutive steers share one label ios grouped android grouped
03 Delivered in place, label kept ios delivered android delivered
04 Message actions on a delivered steer ios actions android actions

In iOS 03 and 04, the two steers higher up come from an earlier run that was stopped. The server delivered them with the next prompt, and they kept their shared label.

@ivanfenenko
ivanfenenko merged commit 2606c3e into main Oct 31, 2026
@ivanfenenko
ivanfenenko deleted the feature/902-steering-in-timeline branch October 31, 2026 20:52
ivanfenenko added a commit that referenced this pull request Oct 31, 2026
Keep image galleries alongside the steering/pending bubbles from #909 on both platforms: pending steers dim attachments and galleries, and pending steers keep no message actions.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.

Session Chat: show steering messages in the timeline

1 participant