Skip to content

Land fold exec on main (recover stranded stacked-PR commits) - #4

Merged
blakebauman merged 1 commit into
mainfrom
fix/land-fold-exec-on-main
Jun 18, 2026
Merged

Land fold exec on main (recover stranded stacked-PR commits)#4
blakebauman merged 1 commit into
mainfrom
fix/land-fold-exec-on-main

Conversation

@blakebauman

Copy link
Copy Markdown
Owner

Why

PR #3 (fold exec) was stacked on PR #2's branch (feat/central-machine-logs). When #2 merged to main and its branch was deleted, #3 was then merged into that stacked base branch rather than into main. GitHub marks #3 as "merged", but its commits never reached mainmain has no fold exec.

This re-lands the exec work by cherry-picking the original commit (d526457) onto main. No code changes versus what #3 already reviewed and approved; it applies cleanly on top of the merged logs work.

Verification

  • git cherry-pick applied with no conflicts
  • gofmt -l clean · go vet ./... clean · go test ./... all pass
  • fold exec route/command present again

Note for future stacked PRs

Merge the base PR first, then retarget the stacked PR to main before merging it — otherwise its merge lands on a soon-to-be-deleted base and is lost from main.

🤖 Generated with Claude Code

There was no way to get a shell into a deployed machine to inspect it —
a major DX gap for an agent runtime. This adds one-shot command exec.

- Runtime gains Exec; the docker runtime implements it via `docker exec`
  (stdin forwarded, exit code surfaced). wasm/microVM/firecracker return
  ErrExecUnsupported (no shell / vsock-or-ssh exec is roadmap).
- The host agent admin API serves POST /v1/machines/{id}/exec alongside
  the existing logs route, bounded by a per-command timeout.
- Control resolves the target machine (named, or the first running one),
  proxies to the host agent, and records an exec event + audit entry.
- API exposes POST /v1/apps/{app}/exec gated by the deploy scope.
- `fold exec [-a app] [--machine id] -- <cmd>` prints combined output,
  forwards piped stdin, and exits with the command's exit code.

Interactive TTY sessions and long-lived streams (tail -f) are out of
scope for this first version (one-shot, bounded by --timeout).

Tests: machine-target resolution (auto-pick running, reject unscheduled/
unknown), exec scope+validation (viewer 403, missing cmd 400, no running
machine 502), and the wasm-unsupported contract. Verified end-to-end with
a local deploy: output, env/hostname, stdin pipe, and exit-code 7.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blakebauman
blakebauman merged commit 77bb8d9 into main Jun 18, 2026
0 of 2 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.

1 participant