Repository navigation
Description
Summary
Creating a new task on a remote computer in Maple Work can briefly show the just-sent prompt inside the New Task composer after the UI has already switched to the chat view. The text then moves into the transcript once the first send actually goes out.
Expected: after Enter/Send, the UI should transition directly into the chat view with the prompt represented in the transcript area — or stay on the New Task screen until that can happen without showing the prompt in the wrong place.
Actual: the chat layout/bottom composer appears first, while the prompt still lives in the composer; a moment later the composer clears and the transcript bubble appears.
Local projects do not show this noticeably because the relevant calls complete within roughly a frame. Remote projects expose it because task creation and subscription are network round trips.
Reproduction
- Open Maple Work.
- Select a remote computer/project.
- Start a new task.
- Type a prompt in the New Task composer and press Enter/Send.
- Observe the transition: chat view appears first; the prompt briefly remains in/near the composer; then the transcript bubble appears.
Also worth checking:
- Whether the draft had a non-default permission mode (
Read only/Full access) or MCP changes — these addsettle_new_sessionwork and widen the window. - Enter vs click Send.
- Failure/retry paths and navigation away during creation.
- Whether the same build on a local project exhibits the same frame-level sequence (likely yes, just imperceptible).
Likely mechanism
The first send deliberately splits “leave the New Task hero” from “send the message”:
-
create_for_first_sendbuilds a status-onlyfirst_send_preview(SendPreview::new(...).status_only()) and stores the actual send inpending_first_send.- File:
apps/maple-agent/app/src/ui/chat/mod.rs(create_for_first_send,create_for_first_send/ first-send path; exact line numbers will drift). - The inline comment states the intended behavior: the text stays in the composer while the task is being created.
- File:
-
shows_empty_state()inapps/maple-agent/app/src/ui/chat/sending.rstreats any current send preview as leaving the empty state. So even a status-only preview switches rendering away from the centered New Task layout into the chat layout with the bottom composer. -
The composer is put into a disabled/“Creating task” state but still holds the draft text.
-
Only after:
create_sessionresolves,subscribe_new_sessionis acknowledged, andsettle_new_sessionapplies any permission/MCP changes the draft carries,
does
finish_new_sessionrun, which sets the active session and callsrun_first_send. -
run_first_sendtakes the composer text, calls the normal send path, clears the composer, and creates the real preview/transcript entry. -
Authoritative user-message/run events then replace/confirm that optimistic preview.
So the intermediate frame is: chat layout is visible, but the user message is still only composer text with a status-only preview elsewhere.
Why remote differs from local
The code path is the same, but remote execution changes timing:
- Local: create + subscribe usually complete inside the same/next frame, so the user never sees the intermediate state.
- Remote:
create_sessionis a network round trip to the selected computer; then subscription is awaited; then permission/MCP settle can add more round trips. For that entire window, the UI has already left the empty state but the message has not moved to the transcript.
The backend selection uses the selected computer’s connection (app/src/backend.rs), and remote task calls go over that connection rather than in-process IPC.
Regression context
This does not look like a fresh regression from the latest transcript/history commits. The mechanism traces mainly to:
0cb4218c—fix(agent): smooth composer sends and preserve remote drafts (#1199)— introduced the status-only first-send preview / preserve-draft behavior.5e3793ae—feat(agent): persist local state in host-owned SQLite (#1204)— part of the create/subscribe/settle flow and host-owned state around task creation; the first-send path was shaped in this era.aec3a588—Agent: rework the motion layer on springs, with timing in one place (#1575)— may have made the same state more noticeable; not proven to be the cause.
Recent commits specifically reviewed and not implicated as the origin:
76384831— preserve position across forward history pagesce9f0692— recover live transcripts without overflow bannerd113546e— auto-load older history on scroll (Agent: auto-load older chat history on scroll #1689)912f1922— active-run steering preference (Agent: add active-run steering preference #1688)52299de1— keep automatic remote retries visually quiet (Agent: keep automatic remote retries visually quiet #1687)
Important caveat: it may have been present since late October and only become noticeable on slower remote links, or more visible after the motion rework. We have not proven which prior release contains it.
Multi-agent investigation summary
Four agents independently reviewed this read-only. They strongly agreed on the mechanism and differed mainly on fix preference.
Codex
- The source shows a clear timing mismatch: layout switches as soon as a pending preview exists, but the preview hides the message body and leaves the prompt in the composer.
create_session, then subscription acknowledgment, then permission/integration changes happen beforefinish_new_session→run_first_sendclears the composer and inserts the visible transcript preview.- Local IPC hides this; remote round trips expose it.
- Suggested fix: atomically capture the submitted prompt, clear the composer, and show the optimistic transcript body during the transition; carry the retained send through creation/subscription; preserve failure recovery and navigation cancellation; keep the subscription acknowledgment gate.
- Confidence: high on mechanism, lower on exact release attribution.
Claude Code
- Traced the exact sequence:
create_for_first_sendsets a status-onlyfirst_send_preview;shows_empty_state()becomes false; render takes the transcript + bottom-composer branch; composer remains with text and a “Creating task” label. - Text remains because that is explicitly documented in code: composer shows “creating” until the send goes out.
- Only after
create_session,subscribe, and any permission-mode/MCP settle doesrun_first_sendread the composer, clear it, and insert the message. - Noted
New Taskmay addcreate_scratch_projectfor scratch projects, but the layout stays in the empty state during that step. - Regression read: none found in current master/0.0.25-era code for this first-send path; likely predates those changes or is latency exposure.
- Suggested fixes:
- Make the first send optimistic: clear composer and show full bubble immediately; carry the preview into the send; keep failure restore.
- Smaller alternative: keep empty-state layout until task exists;
shows_empty_state()ignores the status-only first-send preview. - Later: fold subscribe and permission mode into create to reduce round trips; needs protocol/version compatibility review.
- Verification: compare previous release against stage; time
create_session/subscribe/ settle on a remote first send; check non-default permission mode widens the window.
Grok Build
- Described the same sequence and emphasized that
create_sessioncreates an empty timeline; the user message row is created later by the send path. - Remote adds network round trips; local usually completes before the next paint.
- Identified
0cb4218c(Fix Agent composer transitions and remote draft navigation #1199) and the subscription-before-send behavior around5e3793ae(feat(agent): add host-owned SQLCipher local storage #1204) as the origin, not the later transcript pager/retry/steering commits. - Suggested fix: make the frame that leaves the hero the same frame that shows the transcript bubble — optimistic transcript body + immediate composer clear — or keep the hero/empty state until
run_first_send. - Warned against clearing the composer without a restore path: failed creates must return the draft.
Antigravity
- High-confidence version of the same diagnosis, with a concrete implementation sketch:
- In
create_for_first_send, createfirst_send_previewwithout.status_only()soshow_bodyis true immediately. - Clear the composer immediately, matching
send_to_session. - Transfer/carry the preview into
sending_previewswhen handing off to the send path, preserving timestamps so the bubble does not replay its entrance animation. - Send
action.text()rather than the current composer contents fromrun_first_send, so text typed after the send was initiated does not accidentally become the sent message. - Hide the New Task project chip once
first_send_previewexists, so it does not briefly appear in the bottom composer area. - Update
pending_first_send_renders_at_the_conversation_positionto the new contract.
- In
- Alternative: keep
shows_empty_state()true whileselected_session.is_none()even whenfirst_send_preview.is_some(), so the New Task screen waits and then transitions atomically. - Also suggested reducing remote latency by letting
AgentCreateSessionRequestcarry initial permission mode and/or combining create + subscribe on the host — but that is a wire/version-compat change. - Confidence: high on mechanism; moderate on why Anthony saw it now specifically. Non-default permission mode/MCP toggles add measurable extra RTTs and should be checked when reproducing.
Consensus
- Mechanism: high confidence.
- Remote vs local: high confidence; same code path, different latency.
- Not caused by the November transcript/history commits: high confidence.
- Exact release that introduced it: uncertain; likely Fix Agent composer transitions and remote draft navigation #1199/feat(agent): add host-owned SQLCipher local storage #1204 era.
- Why it appeared now: unproven; likely slower remote round trips, fuller remote state, permission/MCP settle, or the motion rework making the intermediate frame more visible.
Suggested fix options
Option A — Optimistic first send (preferred UX)
On Enter/Send:
- Create the first-send preview with body visible.
- Clear the composer immediately.
- Show the user bubble in the transcript immediately, even before the remote task exists.
- Carry that preview into the eventual send path instead of recreating/replaying it.
- If creation fails or the user navigates away, use the existing restore paths (
give_back_first_send/pending_first_send) to return the text. - Decide and encode behavior for text typed during task creation:
- Current behavior sends whatever is in the composer at send time.
- Optimistic behavior should send the captured action text and not absorb later typing into the already-sent message.
Pros: matches user expectation; no misplaced prompt. Cons: changes intentional “edit while creating” semantics; needs careful failure handling.
Option B — Hold the New Task/empty state until the task exists
Make shows_empty_state() return true while the first send is still only pending/status-only and no session exists. The UI remains on the New Task screen until finish_new_session, then switches to chat with the bubble already present.
Pros: smallest conceptual change; avoids moving text into transcript early. Cons: remote creation may feel like the send “does nothing” for a moment unless the composer/status clearly communicates progress.
Option C — Reduce remote round trips
Fold subscribe and/or initial permission-mode application into session creation, or skip the settle call when nothing differs.
Pros: improves the fundamental latency. Cons: protocol/host compatibility and versioning concerns; should be its own change, not bundled casually with the UI fix.
Tests and checks to update
apps/maple-agent/app/src/ui/chat/tests.rspending_first_send_renders_at_the_conversation_position— currently asserts the first-send pending state renders at the conversation position with nopending-send-bodyand keeps the composer editable. This likely needs to change for the chosen fix.first_send_immediately_leaves_the_hero_without_inventing_history— may also change depending on Option A vs B.
sending.rsshows_empty_state()behavior if Option B is chosen.- Failure-path tests: create failure, navigation away during create, non-default permission mode, MCP changes pending.
- Manual remote QA: Enter and Send button; default vs Read only vs Full access; with/without MCP changes; slow remote link or artificial delay.
Working notes / pitfalls
- Do not simply clear the composer on Enter without a restore path; failed creates must give the draft back.
- Be careful with
run_first_sendcurrently readingcomposer_text(cx)— anything typed during creation currently rides along with the send. - If the preview is shown optimistically, preserve its timestamp/identity when handing off to the real send so it does not re-animate.
- Hiding the New Task project chip once first send starts would remove another transient inconsistency.
- Do not treat this as a transcript-paging bug; the transcript history work is probably innocent.
- Do not change shared remote protocol casually; if Option C is pursued, it needs compatibility review.
Acceptance criteria
- On a remote computer, pressing Enter/Send on a new task never shows the sent prompt stranded in the composer after the chat view appears.
- The user message appears either immediately (Option A) or exactly when the chat view appears (Option B), not one async round trip later.
- Failed task creation restores or preserves the draft exactly as before.
- Local behavior does not regress.
- Tests covering first-send layout, failure restore, and navigation-away-during-create are updated and pass.
- Manual remote verification notes are attached to the PR.
Status
Investigation only so far; no code has been changed for this issue.
Activity
Alhibb commentedon Dec 1, 2026
Hi! Are external contributions welcome on this issue?
I traced the transition in
apps/maple-agent/app/src/ui/chat/(create_for_first_sendusing.status_only()while keeping text in the composer untilrun_first_send) and would be happy to put together a PR. Do you prefer Option A (showing the optimisticSendPreviewbubble immediately, clearing the composer, and carrying the preview's entrance timestamp/attachments intosending_previewson handoff) or Option B (keeping the hero until task setup finishes)?