Skip to content

feat(session connect): Claude Code-style boxed composer + spend/status footer#43

Merged
hbrooks merged 1 commit into
mainfrom
feat/connect-cc-ui
Jul 13, 2026
Merged

feat(session connect): Claude Code-style boxed composer + spend/status footer#43
hbrooks merged 1 commit into
mainfrom
feat/connect-cc-ui

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 13, 2026

Copy link
Copy Markdown
Member

Reshapes the `agent session connect` / `session start --connect` UI to look and behave like Claude Code, and unifies the startup flow so everything renders in one place.

What you see now

Boxed composer — the `›` prompt is framed by a full-width rule above and below (top/bottom borders only, spanning the terminal).

Persistent footer status line (dim, Claude-Code-style):
```
session_1Bacr9… · running · $0.44 total (Last step: $0.03)
```

  • Session id is a clickable OSC 8 hyperlink to `app.ellipsis.dev/{login}/sessions/{id}` (degrades to plain text off a TTY / when piped).
  • Total = cumulative `total_cost_usd` from the latest Claude Code result.
  • Last step = delta between the two most recent results — the cost of the last turn. (This is the `$0.44` running-total vs `$0.03` marginal-turn distinction.)
  • Current status shown live.

Lifecycle system lines — on each status transition a dim `●` line lands in the transcript: `creating sandbox` → `sandbox ready · spawning agent process` → `retrying…` / `session complete`.

Flow unification

`start --connect` no longer runs a separate pre-connect braille spinner and then hands off — it drops straight into the connect UI, which now renders the whole sandbox-creation lifecycle itself. A backstop status poll keeps the phase fresh even before the socket attaches, and a terminal status reached before the sandbox ran (a preflight/budget gate) is reported and exits cleanly.

New pure, tested helpers

  • `events.ts`: `resultCostUsd`, `foldCosts` (total + last-step), `statusSystemLine`
  • `urls.ts`: `hyperlink` (TTY-gated OSC 8)

Note

Footer spend is Claude Code's `total_cost_usd` (Anthropic list price — the number shown in the turn footers today), not the billed session cost (`cost_tokens + sandbox + fee`). It's already in the stream, so no extra polling. Easy to switch to billed cost if preferred.

Testing

  • `tsc --noEmit` clean; `vitest run` — 224 passed (10 new).
  • Manual: `bun run dev session connect ` (boxed footer + spend) and `bun run dev session start '…' --connect` (lifecycle lines).

…s footer

- Frame the composer with a full-width rule above and below (top/bottom
  borders only), with the › prompt between them.
- Persistent footer status line: clickable session id (OSC 8 link to the
  app), current status, and running spend — cumulative total plus the
  cost of the last turn (Last step: $x.yz), folded from result events.
- Render sandbox lifecycle inline like Claude Code (creating sandbox →
  spawning agent process → …) on each status transition, with a status
  poll backstop so phases show even before the socket attaches.
- Unify start --connect: drop the separate pre-connect wait spinner and
  drop straight into the connect UI, which now owns the lifecycle and
  reports a terminal-before-running gate.
- New pure helpers (resultCostUsd/foldCosts/statusSystemLine/hyperlink)
  with unit tests.
@hbrooks hbrooks merged commit 92e6eaf into main Jul 13, 2026
1 check passed
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