[backup] session-kickoff local snapshot (79cadc6) — pre-disk-wipe preservation - #147
Draft
defangdevs wants to merge 2 commits into
Draft
[backup] session-kickoff local snapshot (79cadc6) — pre-disk-wipe preservation#147defangdevs wants to merge 2 commits into
defangdevs wants to merge 2 commits into
Conversation
Auto-derived Remote Control names are "<user>-<session>@<host>". Two things made <host> unhelpful: - When remoteControlHost/fqdnOrHostName was empty the supervisor fell straight back to the live kernel hostname, which on a cloud box is the internal, non-routable fqdn (ip-10-x-x-x.<region>.compute.internal) — useless for identifying or reaching the box in the Claude apps. - The AWS image named the seeded "main" session after the CloudFormation stack, so it never reflected the box's public address either. Add services.agent-box.remoteControlHost and, when it is empty, fall back to the box's public web.domain (sslip.io on AWS, custom DNS on bare metal) before the kernel hostname. The AWS template now sets remoteControlHost to the public sslip.io host, so every session — the seeded "main" and any added at runtime — is named after the address the box is actually reached at. Also drop the "main" special case (review feedback): the derived name is now uniformly "<user>-<session>@<host>", so "main" becomes "<user>-main@<host>" rather than a bare "<user>@<host>". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GfaHqHJWLGiS78pvGzoyjP
Let a main/interactive session spin up work in sibling sessions and reach
everything the settings UI can do, without the web UI or a rebuild.
Sessions (agent-box-session / settings page / seed) gain:
- initialPrompt: a kickoff task handed to the harness on the FIRST spawn
only (its positional prompt arg). The supervisor consumes it (mark_started
sets hasRun, records boxSessionId, clears initialPrompt) so a respawn never
redoes the task.
- Resume-on-respawn: every later spawn (crash, reboot, Spot stop->restart —
all of which keep the on-disk transcript, since /home is the persistent
root EBS volume) resumes the prior transcript instead. boxSessionId is the
stable id we own across respawns:
* Claude consumes it directly as --session-id (first spawn) / --resume
(respawn, when a transcript exists; else a fresh --session-id) — exact,
so concurrent sessions never cross.
* Codex mints its own id, so we stamp "[agent-box session <id>]" into the
kickoff prompt and locate the exact rollout by that marker
(grep -> newest -> trailing-36-char UUID) -> codex resume <uuid>. No
match -> start fresh; never `resume --last`, which could grab a sibling
session's transcript in a shared cwd.
resumePrompt overrides the built-in steer (continue unfinished work, or
stop if already done).
CLI (agent-box-session) reaches UI parity:
- add --prompt / --resume-prompt
- env ls | set KEY VALUE | rm KEY (writes the same ~/.config/agent-box/env
the settings page manages and the env-exec wrapper reads; ls shows keys
only, never values)
- restart --all
Settings page: add-session forms gain an optional kickoff-prompt field.
Seeded AGENTS.md documents --prompt, resume semantics, env, restart --all so
every harness discovers them.
Adds sessions.nix regression coverage: kickoff deliver-once + resume state,
env set/ls/rm, restart --all, and the web-form prompt.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wx9PVLmDbzS35JCN5N85i6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR opened to preserve a local-only snapshot before the local disk was destroyed.
feat/session-kickoff-prompt-and-resume), from before the source-split refactor. PR feat(sessions): kickoff prompts, resume-on-respawn, and full CLI parity #144's pushed branch is newer and is the real one.🤖 Generated with Claude Code