Skip to content

fix(sessions): give derived Remote Control names a real, useful host suffix#128

Open
defangdevs wants to merge 2 commits into
masterfrom
fix/remote-control-name-empty-host
Open

fix(sessions): give derived Remote Control names a real, useful host suffix#128
defangdevs wants to merge 2 commits into
masterfrom
fix/remote-control-name-empty-host

Conversation

@defangdevs

Copy link
Copy Markdown
Owner

Problem

Auto-derived Remote Control session names are <user>[-<session>]@<host>. Two bugs made <host> useless:

  1. Dangling @<host> came from config.networking.fqdnOrHostName, evaluated at build time. On the AWS image networking.hostName is unset, so that string is empty and the name rendered as the literal agent@ (bare trailing @).
  2. Internal fqdn — the empty-host fallback used the live kernel hostname, which on a cloud box is the internal, non-routable name (e.g. agent-devs@ip-10-42-1-151.eu-central-1.compute.internal) — no use for identifying or reaching the box in the Claude apps.

Changes

  • Add services.agent-box.remoteControlHost (defaults to fqdnOrHostName). The AWS template sets it to the CloudFormation stack name, so boxes — and runtime-added sessions, which get remoteControlName: null — are identifiable as <user>[-<session>]@<stack>.
  • When no explicit host is configured, fall back to the box's public web.domain (sslip.io on AWS, custom DNS on bare metal) — the address you actually reach the box at — before the live kernel hostname. The kernel hostname remains only as a last-resort guard so a name is never a dangling @.

Net effect: a box with no explicit remoteControlHost is now named after its public address (agent-devs@18.196.53.37.sslip.io) instead of an internal EC2 fqdn.

Testing

  • tests/sessions.nix: with remoteControlHost unset, asserts the supervisor bakes the public web.domain into the derived name.
  • Verified the module evaluates with remoteControlHost="" + web enabled (the lazy web.enable && … guard avoids reading the defaultless web.domain when web is off), and that the generated supervisor script bakes host=box.test.

🤖 Generated with Claude Code

Comment thread modules/agent-box.nix Outdated
@defangdevs
defangdevs force-pushed the fix/remote-control-name-empty-host branch 2 times, most recently from 27c2680 to 4dbffab Compare July 22, 2026 09:31
codex and others added 2 commits July 22, 2026 14:29
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
The add-session form's name input was already optional (blank auto-derived
a name from the agent CLI). Remove the field entirely and always
auto-name: users rarely care what a session is called — they rename at
runtime via /rename — so an autogenerated "<agent>" / "<agent>-<hex>" is
one less thing to invent, and it is the only naming path now.

- Both add-session forms (the settings-page manager and the HOME tabbed
  workspace) lose the name <input>; only the agent + working-directory
  fields remain.
- The /sessions/add handler ignores any submitted "name" and always calls
  gen_session_name(). Autogen guarantees a unique key, so the invalid-name
  400 and the duplicate-name 409 (accidental-overwrite guard, issue 100)
  branches are now unreachable and are removed.
- tests/sessions.nix: drive add-session by agent alone and assert the
  auto-derived names ("claude" when free, then a random suffix), instead
  of client-supplied names.

modules/agent-box.nix is regenerated from the .in + src sources.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wx9PVLmDbzS35JCN5N85i6
@defangdevs
defangdevs force-pushed the fix/remote-control-name-empty-host branch from 4dbffab to 121a7fc Compare July 22, 2026 14:30
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.

3 participants