Skip to content

feat: a structured claude agent's conversation can be resumed, after its agent ends or its session is gone - #78

Merged
sean-brydon merged 1 commit into
mainfrom
resume-conversations
Oct 13, 2026
Merged

sean-brydon merged 1 commit into
mainfrom
resume-conversations

Conversation

@sean-brydon

Copy link
Copy Markdown
Collaborator

Phase 4b of design/structured-agents/plan.md (Labs, structured Claude agents only).

Backend (internal/box/conversations.go, capability conversations)

  • Index: each conversation folder gets a meta.json holding agent, location, dir, session, Claude's session id, mode, title (from the first prompt), and created/updated times.
    • Written when the session starts. The driver keeps it current: session id on init, updated on result, mode on SetMode.
    • Change from the plan: this replaces the planned SQLite index. A box has tens to hundreds of conversations, a directory scan is enough, there's nothing to migrate, and each folder describes itself. The plan doc says so.
  • GET /v1/conversations?path=&location=&limit= lists them newest first, with live and session when one runs now.
  • POST /v1/sessions/{name}/resume: an ended structured session starts again in its own pane, on its own log and socket, with --resume (resumeInPlace). One left in Claude Code's terminal goes back to its chat instead (toChat, which now ends in resumeInPlace too).
  • POST /v1/conversations/{id}/resume:
    • returns the running session
    • restarts an ended one in place
    • or, when its session is gone, starts a new structured session in the same folder, on the same log (so the chat shows its earlier turns), in the mode it had, named after its title
    • 404 for an unknown id, 410 when the folder it worked in is gone

App

  • Ended panes: where a structured agent's ended pane (and its chat's "start again") would have rerun the host command as a plain terminal command, it now offers Resume the conversation. That plain rerun was wrong: it would have lost the driver.
  • Worktree menu: Resume a conversation lists that worktree's conversations whose agent isn't running, with title and age. Picking one opens it in a tab.

Tests

  • TestAStructuredConversationIsResumedWhenItsAgentEndsAndWhenItsSessionIsGone:
    • the list shows a live conversation with its title, Claude session id and bypass mode
    • after the host is stopped, the ended session resumes in place and answers
    • after the session is deleted, the conversation shows as not live, and resuming it gives a new structured session that answers, shows the earlier turns, and comes back in bypass
    • an unknown id gives 404
  • All structured tests passed 4/4 under -race. The live test against real Claude passed again.
  • Full go test -race ./..., go vet ./..., app checks and build, tsc -p e2e and the docs build all pass.

Next: phase 5, the Codex driver (codex app-server).

🤖 Generated with Claude Code

…its agent ends or its session is gone

A structured conversation's folder now says what it is (meta.json: where
it works, its session, Claude's session id, its mode, its title, its
times), so it outlives its session:

- POST /v1/sessions/{name}/resume starts an ended structured session
  again in its own pane, on its own log, with --resume (a session left in
  Claude Code's terminal goes back to its chat)
- GET /v1/conversations?path= lists a worktree's conversations, newest
  first, saying which run now
- POST /v1/conversations/{id}/resume carries one on in its own session,
  or in a new one once that is gone, in the mode it had

The app offers "Resume the conversation" where an ended structured agent
offered a fresh start, and "Resume a conversation" in a worktree's menu
(boxes with "conversations").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
berth Ready Ready Preview Oct 13, 2026 12:55pm UTC
berth-docs Ready Ready Preview Oct 13, 2026 12:55pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

ENG-6006

This branch was successfully deployed

2 active deployments
Preview – berth-docs — ededada4 Deployed Oct 13, 2026 by vercel[bot]
Preview – berth — ededada4 Deployed Oct 13, 2026 by vercel[bot]
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