Skip to content

feat(tui): recreate a workspace container - #47

Merged
Mickael-Roger merged 3 commits into
Mickael-Roger:mainfrom
Banh-Canh:feat/recreate-container
Sep 27, 2026
Merged

Mickael-Roger merged 3 commits into
Mickael-Roger:mainfrom
Banh-Canh:feat/recreate-container

Conversation

@Banh-Canh

Copy link
Copy Markdown
Contributor

Summary

When a workspace container ends up broken (for example after an interrupted base-image update), the only way to recover was to podman rm/docker rm it by hand and then start the workspace again.

This adds an r (recreate) action to the TUI that removes the selected workspace's container and starts a fresh one from the current workspace image, keeping the workspace:

  • The host-mounted home (sessions, config, credentials) is preserved, and module reconciliation reinstalls modules into the new container.
  • No base-image pull; u remains the way to update the image.
  • Refused while an agent is working or waiting for approval, like u, and while an update or recreate of the same workspace is already running.
  • The STATUS column shows recreating while it runs.
  • New Lifecycle.RecreateContainer; listed in the key menu, ? help, and docs/tui.md.

Testing

  • go vet ./... and go test ./... pass; new tests cover the lifecycle (remove → create → start, manifest kept, no pull) and the TUI gating/status.

🤖 Generated with Claude Code

Banh-Canh and others added 2 commits September 27, 2026 17:30
Add an `r` action that removes the selected workspace's container and
starts a fresh one from the current workspace image, keeping the
workspace. The host-mounted home survives and module reconciliation
reinstalls modules, so a container left broken (e.g. by an interrupted
update) no longer needs a manual `podman rm` followed by a start. Like
an update, it is refused while an agent is working or waiting.

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

Copy link
Copy Markdown
Owner

Fixed the review findings: only Recreate completion clears its lock; start/stop/delete are blocked during recreation, and regression tests cover unrelated completions and conflicting actions. Recovery now reuses the cached workspace image without pulling or rebuilding the base. If the workspace image is missing, recovery fails before removing the existing container. Added regression coverage for a pruned base and a missing workspace image. Validation: go test ./... and go vet ./... passed; gofmt and git diff --check clean. Docker/Podman integration was not run locally because neither runtime is installed.

# Conflicts:
#	internal/workspace/lifecycle.go
@Mickael-Roger
Mickael-Roger merged commit b522ab3 into Mickael-Roger:main Sep 27, 2026
27 checks 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.

2 participants