Skip to content

[backup] session-kickoff local snapshot (79cadc6) — pre-disk-wipe preservation - #147

Draft
defangdevs wants to merge 2 commits into
masterfrom
backup/predisk-20260728/session-kickoff-79cadc6
Draft

[backup] session-kickoff local snapshot (79cadc6) — pre-disk-wipe preservation#147
defangdevs wants to merge 2 commits into
masterfrom
backup/predisk-20260728/session-kickoff-79cadc6

Conversation

@defangdevs

Copy link
Copy Markdown
Owner

Draft PR opened to preserve a local-only snapshot before the local disk was destroyed.

🤖 Generated with Claude Code

codex and others added 2 commits July 22, 2026 09:30
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
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