Skip to content

Show v2 timeline notices in Session Chat - #707

Merged
ivanfenenko merged 5 commits into
mainfrom
feature/702-v2-timeline-notices
Oct 17, 2026
Merged

ivanfenenko merged 5 commits into
mainfrom
feature/702-v2-timeline-notices

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Session Chat now shows the v2 timeline notices that official opencode v2 shows, as quiet inline rows (variant A from the prototype): Moved to, Agent changed, Switched to / Switched variant to, Instructions updated, and Continuing after restart.
  • New Design System component on both platforms: OpenCodeTimelineNotice (Change / Move variants, collapsed / expanded state). Label in the weak text tone, value in the info tint, one line; tap expands the value. Component Gallery entries and light/dark previews included.
  • Domain: a product TimelineNotice carried by a new notice message role and part, projected from the v2 location-switched, agent-switched, model-switched, system and restart synthetic messages. Notices are their own rows: they do not join tool groups, count as user messages, or change context totals.
  • Live: the v2 move, agent, model, instructions and restart events emit the notice over SSE. The id is the event envelope id with evt_ swapped for msg_, the same id the server gives the REST message, so a reload replaces the live row instead of duplicating it.
  • A restart synthetic no longer projects as a user message. v1 is unchanged.

Screenshots

Against a local v2 dev server (scenario harness). Agent, model, move and instruction changes were made from another client while the session was open.

iOS, live iOS, tap to expand iOS, after reload
Android, after reload Android, live (Plan → Build, core/instructions)

Checks

  • Android: ./gradlew :app:testDebugUnitTest passed (2149 tests, 0 failures, 1 skipped). :app:assembleDebug passed. ktlint is clean on changed lines. All three ran locally with compileSdk forced to 36 by a local Gradle init script, because platform 37 is not installed on this machine. CI runs with 37.
  • iOS: full unit target passed (2020 Swift Testing tests, 76 XCTest cases). The 7 UI tests that failed need an environment the run did not have: STORE_SCREENSHOT_OUT, and a server seeded with a big session.
  • Real apps: iOS simulator and Android emulator against a v2 harness server. All rows showed live and again after a reload, with no duplicates.
  • The restart notice is covered by unit tests only.

Issue

Risks / Follow-ups

  • A live model switch usually arrives without previous, so a variant-only change first reads "Switched to ". It changes to "Switched variant to …" after the next REST load.
  • The model name comes from the composer catalog of the session's current location. If that location has no such provider, the row shows the raw model id.
  • Agent ids use the app's title-casing (my-agent → "My Agent"). Official opencode shows "My-agent".
  • Other system messages show their description, or "Instructions updated" when there is none, and never the model-facing text. The TUI does the same; the web client falls back to the text.
  • On Android, agent and model notices from REST now feed the running agent and model after a reload, so a switch that only REST knows about is no longer dropped.

🤖 Generated with Claude Code


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


Note

Medium Risk
Broad changes across live event projection, REST transcript mapping, message store, and timeline UI on both platforms; behavior is heavily tested but live/REST id sync and running-context edge cases could still mis-order or mis-label switches.

Overview
Session Chat on Android and iOS now renders v2 session changes as quiet inline timeline rows (directory moves, agent/model switches, instruction updates, restart), aligned with official opencode v2 behavior.

The change introduces a client-only notice message role and part carrying a TimelineNotice model. REST v2 session items (location-switched, agent-switched, model-switched, system, restart synthetic) project into their own transcript rows instead of silently updating context or showing as user text. Live SSE for the same events emits matching message.updated / message.part.updated rows whose ids swap evt_ → msg_ so reload replaces live rows without duplicates.

UI adds OpenCodeTimelineNotice (label/value, move glyph, tap-to-expand) plus gallery entries; timeline block building treats notices as standalone rows that do not merge with assistant tool groups or complete user turns. Session cache and running agent/model context are updated so switches recorded only as notices still stamp the next prompt after reload (notably on Android).

Restart synthetics become notice rows instead of hidden user messages; v1 is unchanged.

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

ivanfenenko and others added 4 commits October 16, 2026 23:20
A quiet single-line row for a session change: label in the weak text tone,
value in the info tint, end-ellipsized and expandable in place. The Move
variant leads with the return glyph. Registered in the Component Gallery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A v2 move, agent or model switch, instructions update, or restart resume is
now its own quiet row (a Notice message with one TimelineNotice part), from
REST history and live over SSE. Live notices take the server's id (evt_ to
msg_), so a reload keeps one row. Notices carry no agent, model, text or
context estimate; REST switch notices still feed the running agent and model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moved, agent and model switches, instruction updates and restart resumes
become notice rows from REST history and from live SSE; a live notice
takes the message id the server derives from its event, so the REST copy
replaces it in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 cda053f. Configure here.

A notice is never a reply, so Changes no longer targets a prompt still
waiting on one, and a notice at the top of a page no longer reads as a
split turn that needs an older page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko merged commit a7a34e3 into main Oct 17, 2026
@ivanfenenko
ivanfenenko deleted the feature/702-v2-timeline-notices branch October 17, 2026 08:09
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 v2 timeline notices (moved, agent, model, instructions, restart)

1 participant