Skip to content

Render scheduled wakeups as an inline tool line - #237

Open
stippi wants to merge 2 commits into
mainfrom
feature/wakeup-rendering
Open

stippi wants to merge 2 commits into
mainfrom
feature/wakeup-rendering

Conversation

@stippi

@stippi stippi commented Oct 12, 2026

Copy link
Copy Markdown
Owner

What

schedule_wakeup gets its own unobtrusive inline rendering in the GPUI frontend, and the injected wakeup message no longer looks like a message from the user.

Tool line (alarm clock icon, Explore/Read style):

  • before execution: "Schedule wakeup in 20 min"
  • armed: "Wakeup at 14:31 · in 20 min" — live countdown, seconds in the last minute; "on Oct 13 at 09:00" for other days
  • fired: "Woke up at 14:31" with the alarm-clock-check icon
  • expanding it shows the prompt
  • due but never fired (restart, cancel): neutral "Wakeup at 14:31"
  • cancel_wakeup: "Cancel wakeup Add real UI based on Zed's gpui crate #3" with the alarm-clock-off icon

Wakeup message

  • follows its schedule_wakeup block within the same turn (matched by prompt) → not shown; the block says it fired
  • otherwise (the user spoke in between) → shown as a tool-like "Woke up" line with the prompt, no "You" card

How

  • Core: ScheduleWakeupOutput carries fires_at; render_for_ui returns JSON (like spawn_agent), the LLM still sees the text. Old records without fires_at still parse. session::wakeup::wakeup_prompt recognizes injected messages.
  • ACP: renders the JSON result as "Wakeup Add real UI based on Zed's gpui crate #3 armed, fires at …".
  • GPUI: WakeupToolRenderer; ToolBlockRenderer gains icon() and refresh_after() (defaults keep existing behavior). Wakeup recognition runs on every path that creates user messages (live input, session load, append, branch edit).

Tests

  • renderer descriptions and refresh timing
  • main_screen::tests::wakeups: loaded session with a linked and an unlinked wakeup
  • cargo test, clippy -D warnings, fmt --check green

Known gap: a wakeup that fires while the agent runs briefly shows as pending message with the [scheduled wakeup] prefix.

schedule_wakeup's result carries `fires_at` and renders it as JSON for
the UI, so frontends can show when the wakeup fires. `wakeup_prompt`
recognizes injected wakeup messages. ACP says the result in words.
schedule_wakeup shows an alarm clock with the fire time and a live
countdown; expanding it shows the prompt. A wakeup message that answers
the schedule_wakeup block of its turn is not shown — the block says it
fired. Otherwise the message reads like a tool line instead of a message
from the user. cancel_wakeup gets its own line too.

Renderers can choose a state-dependent icon (`icon`) and ask to render
again when a time-based description changes (`refresh_after`).
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