Skip to content

Fill the window without scrollback, sandbox startup drill-down, --rebuild#66

Merged
hbrooks merged 1 commit into
mainfrom
connect-window-rebuild
Jul 22, 2026
Merged

Fill the window without scrollback, sandbox startup drill-down, --rebuild#66
hbrooks merged 1 commit into
mainfrom
connect-window-rebuild

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 22, 2026

Copy link
Copy Markdown
Member

What

Four connect-UI/CLI improvements from an interactive debugging session:

1. Bare agent owns the whole window, no more scrollback surprises

  • runConnect soft-clears before the first Ink paint: newlines push the existing screen into scrollback, the cursor homes to row 1, so the app never starts mid-screen and overflows the window.
  • The app reserves top padding (4 rows) above its first line. Two rows are visual breathing room; the rest is sacrificial slack that absorbs terminal row-accounting quirks and the one row the post-exit resume with: sign-off scrolls, so the sandbox startup notes always stay visible (during the run and after detach).
  • The using config "X" (repo default) line for start --connect moved into the app's opening notice instead of printing before the render (which would land in scrollback). Other modes still print it.
  • The post-exit resume with: agent session connect <id> line lost its leading newline and lands on a reserved row.

2. Sandbox startup: one line, rewritten in place, with drill-down

  • The ✻ Starting sandbox… header shows a single current-phase line under it (Building image… · <latest output>Ready!), replacing the stacked setup line + Sandbox ready · … transcript notice. Lifecycle records no longer render as transcript rows.
  • ctrl+s opens the full step list (one step per setup hook, ✻ running / ✓ done, log line counts); ↑/↓ selects a step, shows its logs (a live 5-line tail while the step runs, the stored log up to 100 lines once finished), ←/esc closes. Derivation is a pure deriveSandboxState with unit tests (accumulation across chunked records, reset on wake, --no-records cursor).

3. agent session start --rebuild

Sends force_rebuild: true so the initial provision skips the sandbox image cache (fresh full build whose snapshot refreshes the cache). Works from a bare agent --rebuild too, since bare invocations forward to session start --connect. Safe to ship ahead of the backend: unknown request fields are ignored, so the flag is a no-op until the server field lands (backend branch session-force-rebuild in the monorepo).

4. Version honesty

package.json bumped 1.0.0 → 1.1.0 to match the released v1.1.0 tag, which was cut without the bump commit. Dev builds (bun run compile) stop reporting v1.0.0; released binaries were unaffected (the workflow stamps the tag version at build time).

Testing

  • tsc --noEmit clean; 210 vitest tests pass (9 new).
  • Layout and interaction verified end-to-end by driving the real compiled binary in a scripted PTY (24x80 and 24x120) against a fake /v1 server that replays the sandbox lifecycle, then emulating the captured bytes with pyte: first paint never scrolls, the header survives exit, ctrl+s/arrows produce the step list, running tail, and finished log views.

…uild

- Bare `agent` (and `session connect`) no longer scrolls the sandbox notes
  out of view: the app soft-clears to the top of a fresh window (prior
  content scrolls into scrollback), pads the top so terminal row quirks and
  the post-exit sign-off eat padding instead of the first line, and the
  "using config" preamble moved into the app notice so nothing prints
  before the first paint.
- Sandbox startup renders as one header with a single current-phase line
  rewritten in place; ctrl+s opens the full step list, arrows drill into a
  step's logs (live 5-line tail while it runs, stored log once finished).
  Lifecycle records no longer render as transcript rows.
- `agent session start --rebuild` (so also bare `agent --rebuild`) sends
  force_rebuild to skip the sandbox image cache on the initial provision.
  No-op until the backend field ships (unknown fields are ignored).
- package.json version matches the released v1.1.0 tag, which was cut
  without the bump commit, so dev builds stop reporting v1.0.0.
@hbrooks
hbrooks merged commit 5960ffc into main Jul 22, 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