Skip to content

feat(home-registry): Home Registry + dashboard Home picker#131

Merged
ThomasK33 merged 3 commits into
mainfrom
feat/home-registry
Jun 8, 2026
Merged

feat(home-registry): Home Registry + dashboard Home picker#131
ThomasK33 merged 3 commits into
mainfrom
feat/home-registry

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Adds a Home Registry + dashboard Home picker so agent-tty can see across the many Homes (state roots) you run it in — the default ~/.agent-tty, throwaway mktemp -d dirs, and per-project AGENT_TTY_HOME overrides — instead of only the single Home resolved for one invocation.

Closes #130. Design captured in CONTEXT.md (Home / Active Home / Home Registry terms) and docs/adr/0008-home-registry-advisory-per-machine.md.

What's new

  • Home Registry — a persisted, advisory, per-machine index at ${XDG_STATE_HOME:-~/.local/state}/agent-tty/homes.json ({path, lastSeenAt} entries; counts derived live, never cached). Auto-registered the first time a Home hosts a Session (create); the write is advisory and never fails creation. Atomic temp+rename tolerates concurrent creates.
  • home list [--all] [--json] — registered Homes (Active Homes by default; --all adds terminal-only), each row showing path, live active/total Session counts, and last-seen, newest-first. home forget <path> deregisters a Home without touching disk.
  • Dashboard Home picker — press H for a full-screen picker; select a Home to observe its Sessions and open a Live View. Browsing Homes is a read-only scan that never reconciles; entering a Home reconciles exactly as the single-Home dashboard does today. Opens on the launched/resolved Home (additive — nothing about today's behavior changes).
  • gc is now cross-Home by default — sweeps every registered Home and deregisters emptied/deleted ones; --home/AGENT_TTY_HOME scopes to a single Home and touches no registry. gc never deletes a Home directory (only Session directories + registry entries).

⚠️ Backward-incompatible

Plain agent-tty gc changes from "collect the default Home" to "sweep all registered Homes", and its --json result changes shape to { dryRun, homes[], removedSessionCount, totalBytesFreed, deregisteredHomes } (per-Home outcomes live under homes[]). Automation relying on the old behavior or the old flat shape must pass --home and read homes[]. Called out in CHANGELOG.md.

Boundaries (ADR 0008)

Per-machine and local-only: reconcile/kill judge liveness with local PIDs and manifests carry no machine identity, so a Home shared across machines (e.g. NFS) is unsupported; a machine-id guard is deferred. This matches the Coder model (separate workspaces are separate machines, each with its own registry).

Testing

  • New unit tests: registry store (dedupe, prune-on-read, atomic write, XDG resolution, independence from AGENT_TTY_HOME), the read-only scope scan (including a guard that a dead-host running manifest is not reconciled by listing), home list/home forget envelopes, cross-Home runGcCommand (scoped vs sweep, deregister-on-empty), create auto-registration + advisory-failure tolerance, and golden-envelope contracts for the new/changed result shapes.
  • New host-free integration test for the cross-Home gc sweep + deregistration (never deletes the Home dir).
  • typecheck, oxlint, oxfmt --check, the full unit suite, and build pass locally. (Host-dependent integration/e2e run in CI.)

Notes for reviewers

  • ADR numbering: 0008 currently collides with the unpushed feat/workflow-hero-demo branch's 0008-carry-two-parallel-hero-demos — whichever merges second must renumber.

🤖 Generated with Claude Code

ThomasK33 and others added 3 commits June 8, 2026 14:56
Captures the grilled design for the Home Registry + dashboard home picker (#130): new CONTEXT.md glossary terms (Home, Home Registry, Active Home), a Home-aware Session Dashboard, and docs/adr/0008 recording the advisory, per-machine, gc-reconciled registry decision.

Change-Id: I0dc1149392295870c53a17bd5bdfd5d1b98ee7c9
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
…me picker

Persist every agent-tty Home (state root) that has hosted a Session in a
per-machine advisory registry, so the dashboard can switch Homes and `home
list` can enumerate them — comparable to `list` for Sessions.

- HomeRegistry store at ${XDG_STATE_HOME:-~/.local/state}/agent-tty/homes.json:
  {path, lastSeenAt} entries, atomic temp+rename writes, independent of
  AGENT_TTY_HOME. Auto-registered on `create` (advisory; never fails create).
- `home list [--all] [--json]` and `home forget <path>`: a read-only manifest
  scan that never reconciles, prune-on-read, newest-first; counts derived live.
- Dashboard gains a full-screen Home picker (press H); browsing Homes never
  reconciles, entering a Home reconciles exactly as the single-Home dashboard.
- gc becomes cross-Home by default — sweeps every registered Home and
  deregisters emptied/gone ones; `--home`/`AGENT_TTY_HOME` scopes to one and
  touches no registry. Never deletes a Home directory. New cross-Home result
  shape (homes[] + aggregates). BACKWARD-INCOMPATIBLE: automation relying on
  plain `gc` collecting only the default Home must now pass `--home`.
- CommandContext.explicitHome distinguishes a selected vs defaulted Home.

Per-machine / local-only boundary (reconcile uses local PIDs); cross-machine
shared Homes are unsupported and the machine-id guard is deferred (ADR 0008).

Implements #130.

Change-Id: I05a58990ffaeadcb9deebee37042a6f968c0000e
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I1c5fac5f81d322c5277537f05b273e0b05c12609
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 merged commit 10fe51d into main Jun 8, 2026
12 checks passed
@ThomasK33 ThomasK33 deleted the feat/home-registry branch June 8, 2026 15:50
@ThomasK33 ThomasK33 mentioned this pull request Jun 8, 2026
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.

Home Registry + dashboard home picker

1 participant