Skip to content

feat(chat): fold checkpoint resume into the input — Continue + abandon (#255) - #264

Merged
cboettig merged 1 commit into
mainfrom
feat/resume-in-chat-input-255
Jun 20, 2026
Merged

feat(chat): fold checkpoint resume into the input — Continue + abandon (#255)#264
cboettig merged 1 commit into
mainfrom
feat/resume-in-chat-input-255

Conversation

@cboettig

Copy link
Copy Markdown
Member

Fixes #255.

Problem

When the agent pauses at a checkpoint, the UI rendered a standalone ▶ Continue button inside the message stream — competing with the chat input even though sending any message already resumes the suspended turn (same code path). And once paused, there was no way to abandon the suspended work: any new message got folded into the old turn as a steer, with no escape short of reloading.

Change

The resume affordance now lives in the input row:

  • 3-state send button via a single _syncInputControls():
    • idle → Send
    • busy → ■ Stop (abort, unchanged)
    • suspended + idle → Continue (green)
  • Continue / Enter on an empty input resumes the paused turn ("continue"); typing a steer first resumes with that steer instead.
  • New ✕ abandon control, visible only while suspended — clears agent.suspendedTurn so the next message starts a fresh turn.
  • Placeholder hints the affordance while paused.
  • Removed the standalone renderContinueButton / .checkpoint-actions block and its now-dead CSS.

State that was scattered through handleSend (the busy on/off button mutations) is now centralized in _syncInputControls().

Tests

test/chat-ui-controls.test.js (jsdom) drives the prototype methods on a minimal instance (mirroring the map-manager unit tests):

  • _syncInputControls: idle→Send, busy→Stop (abandon hidden even if suspended), suspended→Continue+abandon+hint.
  • abandonSuspendedTurn: clears the turn / resets to Send / notes it; no-op while busy.
  • handleSend: empty input resumes with "continue"; empty + no suspended turn is a no-op; a typed steer wins over the canned resume.

Full suite green (334).

Manual verification (browser-bound, per AGENTS.md)

On a downstream app with a low max_tool_calls (e.g. 3) so a checkpoint triggers:

  1. Ask a multi-step question → agent pauses → send button reads Continue, appears, placeholder hints resume.
  2. Press Continue (empty input) → resumes.
  3. Repeat; this time type a steer first → resumes with the steer.
  4. At a pause, press → system note, button returns to Send, next message starts a fresh turn.
  5. While a turn is running, button is ■ Stop and ✕ is hidden.

#255)

The inline ▶ Continue button competed with the chat input even though
sending any message already resumes a suspended turn, and there was no way
to abandon a suspended turn without reloading.

- send button becomes 3-state: Send (idle) / ■ Stop (busy) / Continue
  (suspended+idle); Continue or Enter on empty input resumes, a typed steer
  resumes with that steer
- new ✕ abandon control, visible only while suspended, clears
  agent.suspendedTurn so the next message starts a fresh turn
- _syncInputControls() centralizes the three states (was scattered across
  handleSend); placeholder hints the resume affordance while paused
- remove the standalone renderContinueButton / .checkpoint-actions block

Tests: chat-ui-controls covers the state machine, abandon, and the
empty-input/typed-steer resume paths.
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 51.39% 3749 / 7295
🔵 Statements 51.37% 3749 / 7298
🔵 Functions 59% 131 / 222
🔵 Branches 82.67% 754 / 912
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
app/chat-ui.js 32.76% 65% 25% 32.82% 109-133, 140-224, 227-239, 256-328, 335-365, 372-417, 424-433, 436-442, 445-502, 508-530, 537-555, 562-590, 596-598, 613-615, 624, 635-636, 641-642, 648-657, 714-738, 746-772, 779-797, 800-802, 805-806, 809-810, 817-819, 826-845, 858-937, 952-958, 963-964, 1001-1002, 1010, 1027-1072, 1079-1106, 1109-1114, 1117-1122, 1131-1184, 1191-1196, 1199-1210, 1217-1220, 1228-1236, 1243-1278, 1288, 265-266
Generated in workflow #111 for commit db97ef7 by the Vitest Coverage Report Action

@cboettig
cboettig merged commit b8828fd into main Jun 20, 2026
1 check passed
@cboettig
cboettig deleted the feat/resume-in-chat-input-255 branch June 20, 2026 23:20
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.

Move checkpoint resume into the chat input: 'Continue' button + Stop, drop the inline button

1 participant