Skip to content

feat: Optimistically render conversation items before subscription confirms#1209

Merged
charlesvien merged 3 commits intomainfrom
03-11-optimistically_render_conversation_items_before_subscription_confirms
Mar 12, 2026
Merged

feat: Optimistically render conversation items before subscription confirms#1209
charlesvien merged 3 commits intomainfrom
03-11-optimistically_render_conversation_items_before_subscription_confirms

Conversation

@charlesvien
Copy link
Member

@charlesvien charlesvien commented Mar 12, 2026

Adds a generic optimisticItems mechanism to the session store so any conversation item type can be displayed immediately before the real event arrives from the main process. Currently used for user messages, but the OptimisticItem union is designed to be extended for future use cases.

  1. Add OptimisticItem type and optimisticItems array to AgentSession store
  2. Append an optimistic user message when a prompt is sent, before the server round-trip
  3. Clear optimistic items when the real session/prompt event arrives or on error
  4. Merge optimistic items into the conversation view between confirmed items and queued messages
  5. Add useOptimisticItemsForTask hook and store setters (appendOptimisticItem, clearOptimisticItems, appendEventAndClearOptimisticItems)

@charlesvien charlesvien changed the title Optimistically render conversation items before subscription confirms feat: Optimistically render conversation items before subscription confirms Mar 12, 2026
@charlesvien charlesvien force-pushed the 03-11-reduce_agent_eagerness_to_re-enter_plan_mode_mid-task branch from 37db874 to 56cb033 Compare March 12, 2026 02:37
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 454610f to 400d3be Compare March 12, 2026 02:37
@charlesvien charlesvien force-pushed the 03-11-reduce_agent_eagerness_to_re-enter_plan_mode_mid-task branch from 56cb033 to 1f06978 Compare March 12, 2026 03:01
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 400d3be to 96726e1 Compare March 12, 2026 03:01
@charlesvien charlesvien marked this pull request as ready for review March 12, 2026 05:08
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 96726e1 to 7da2a2f Compare March 12, 2026 05:20
@charlesvien charlesvien force-pushed the 03-11-reduce_agent_eagerness_to_re-enter_plan_mode_mid-task branch from 1f06978 to 95ce1d6 Compare March 12, 2026 05:20
@charlesvien charlesvien force-pushed the 03-11-reduce_agent_eagerness_to_re-enter_plan_mode_mid-task branch from 95ce1d6 to 50cbe1b Compare March 12, 2026 13:46
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 7da2a2f to d609a72 Compare March 12, 2026 13:47
@charlesvien charlesvien changed the base branch from 03-11-reduce_agent_eagerness_to_re-enter_plan_mode_mid-task to graphite-base/1209 March 12, 2026 16:27
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from d609a72 to b70662f Compare March 12, 2026 16:27
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch 3 times, most recently from a53d651 to e94f8ea Compare March 12, 2026 17:12
@charlesvien charlesvien changed the base branch from graphite-base/1209 to 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes March 12, 2026 17:12
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from e94f8ea to 69f1a0d Compare March 12, 2026 17:27
@charlesvien charlesvien force-pushed the 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes branch from a86cb2b to f6ebf31 Compare March 12, 2026 17:38
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch 2 times, most recently from 6643282 to 8256e27 Compare March 12, 2026 17:51
@charlesvien charlesvien force-pushed the 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes branch 2 times, most recently from 34012b7 to a825685 Compare March 12, 2026 17:58
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 8256e27 to 8b45b78 Compare March 12, 2026 17:58
@charlesvien charlesvien force-pushed the 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes branch from a825685 to a265287 Compare March 12, 2026 18:51
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch 2 times, most recently from 37ba258 to 96644b5 Compare March 12, 2026 22:20
@charlesvien charlesvien force-pushed the 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes branch from a265287 to e19656c Compare March 12, 2026 22:20
Copy link
Member Author

charlesvien commented Mar 12, 2026

Merge activity

  • Mar 12, 10:49 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 12, 10:51 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 12, 10:56 PM UTC: @charlesvien merged this pull request with Graphite.

@charlesvien charlesvien changed the base branch from 03-11-add_idle_timeout_to_kill_inactive_sessions_after_15_minutes to graphite-base/1209 March 12, 2026 22:49
@charlesvien charlesvien changed the base branch from graphite-base/1209 to main March 12, 2026 22:49
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 96644b5 to da1b51b Compare March 12, 2026 22:50
@charlesvien charlesvien merged commit fb49197 into main Mar 12, 2026
15 checks passed
@charlesvien charlesvien deleted the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch March 12, 2026 22:56
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.

2 participants