Skip to content

feat(install): agent-driven one-shot install — unattended start.sh + agent runbook (ent#39) - #1708

Merged
vybe merged 3 commits into
devfrom
feature/ent39-agent-driven-install
Jul 22, 2026
Merged

vybe merged 3 commits into
devfrom
feature/ent39-agent-driven-install

Conversation

@dolho

@dolho dolho commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Implements the local install slice of Abilityai/trinity-enterprise#39 (one-line install + agent-guided onboarding). OSS-core — per the issue's own note, "the OSS installer must work standalone," so this lands in the public repo. First PR of the epic; the two follow-ups are noted at the bottom.

What

Make the install path agent-runnable and one-shot with no interactive hard-stops in the happy path, verified serving before it claims success, ending on a friendly next-steps card — plus a canonical agent-facing runbook so any capable agent can drive and narrate the whole thing.

scripts/deploy/start.sh (the engineering core)

  • Unattended mode (TRINITY_UNATTENDED=1 / --unattended): a blank ADMIN_PASSWORD is generated (strong, 24-char) and surfaced in the summary instead of the interactive exit 1. Interactive default keeps fail-fast (now pointing at --unattended), so a human is never handed a password they didn't note.
  • Pre-flight, one consolidated fail-fast: Docker daemon + Compose v2 (hard); ports 80/8000/8080/6379 reported as a warning (a re-run legitimately holds them). Portable probe via bash /dev/tcp.
  • Serving verification: replaced the fixed sleep 5 with a bounded poll of the backend /health (up only after migrations + lifespan). Timeout → warning, never a crash.
  • Next-steps card: Web UI URL, login (+ the generated admin password when unattended), the abilities marketplace + trinity:onboard commands, a UI create-agent pointer, and a model-API-key warning when none is set.

Docs

  • docs/AGENT_INSTALL_GUIDE.md — deterministic runbook written for the installing agent: pre-flight → unattended install → independent serving check → friendly landing, with a "how to communicate" section (confirm prerequisites, surface secrets once, never fabricate a model key, end on a card). At a stable raw-GitHub URL, declared the single source of truth kept in sync with the scripts.
  • README promotes the agent-driven one-shot path as the recommended entry point + documents --unattended.

AC coverage

AC This PR
Copy-pasteable "ask your agent to install" prompt ✅ (README + guide)
Non-interactive install, no hard-stops; secrets surfaced ✅
Pre-flight (Docker/Compose/ports) with remediation ✅
Verify actually serving before success ✅
Friendly next-steps card ✅ (terminal)
Idempotent/safe re-run ✅
README reflects the agent-driven path ✅
Agent-facing guide, in sync, at a stable URL ✅

Verified

Ran the full start.sh end-to-end on a live stack (idempotent re-run): pre-flight passes, the /health poll flips the banner to "Ready! ✅", and the card renders the plugin/onboarding commands. bash -n clean. The generated-password + model-key-warning branches are code-tested (my .env has both set, so they don't fire in the live run).

Follow-ups (rest of the epic, not this PR)

  • The install prompt as a shippable skill in the public abilityai/abilities marketplace repo (separate repo).
  • The next-steps card as a first-login panel in the UI (so it's not only in terminal scrollback).

Related to Abilityai/trinity-enterprise#39

🤖 Generated with Claude Code

dolho added 3 commits July 20, 2026 14:36
…next-steps card (ent#39)

Part 1 of the agent-driven one-shot install (ent#39): make `start.sh` reliable
and pleasant to run unattended (by an agent) with no interactive hard-stops in
the happy path, and end on a clear next-steps card.

- **Unattended mode** (`TRINITY_UNATTENDED=1` / `--unattended`): a blank
  `ADMIN_PASSWORD` is generated (strong, 24-char) and surfaced in the summary
  instead of the interactive `exit 1`. Interactive default keeps the fail-fast
  (now also pointing at `--unattended`), so a human is never handed a password
  they didn't note.
- **Pre-flight**, fail-fast with one consolidated message: Docker daemon
  reachable + Compose v2 present (hard); required ports 80/8000/8080/6379
  reported as a WARNING (a re-run legitimately holds them — no false hard-stop).
  Portable port probe via `bash /dev/tcp` (no lsof/ss dependency).
- **Serving verification**: replaced the fixed `sleep 5` with a bounded poll of
  the backend `/health` (authoritative — up only after migrations + lifespan),
  so success means "actually serving", not "containers started". A 180s timeout
  downgrades to a warning (containers may still be initializing), never a crash.
- **Next-steps card**: Web UI URL, login (+ the generated admin password when
  unattended, shown once), the `abilities` marketplace + `trinity:onboard`
  plugin commands, a UI create-agent pointer, and a model-API-key warning when
  none is set in `.env` (agents can't run without one — surfaced now, not on
  first failed agent).

quickstart.sh already generates ADMIN_PASSWORD under `--defaults`; the gap was
start.sh's own hard-stop, which every caller hit.

Verified end-to-end on a live stack (idempotent re-run): pre-flight passes,
the /health poll flips the banner to "Ready! ✅", and the card renders the
plugin/onboarding commands. `bash -n` clean.

Related to ent#39
…path (ent#39)

Part 2 of the agent-driven one-shot install (ent#39): the canonical guide an
external agent reads to drive the whole funnel (discover → install → confirm →
report next steps) AND to coach the user through it.

- `docs/AGENT_INSTALL_GUIDE.md`: a deterministic runbook (numbered steps,
  explicit success/failure checks, copy-pasteable commands) written FOR the
  installing agent. Covers pre-flight (Docker/Compose/ports), unattended install
  (`--unattended`), independent serving verification (/health + Web UI), a
  friendly next-steps card, idempotent re-runs, and a failure quick-reference.
  Leads with "how to communicate" — confirm prerequisites, surface generated
  secrets once, never fabricate a model API key, end on a card not a log dump.
  Reachable at a STABLE raw-GitHub URL so a web-capable agent can fetch it
  mid-install; explicitly declared the single source of truth kept in sync with
  start.sh/install.sh.
- README: promotes the agent-driven one-shot path as the recommended entry
  point (a copy-pasteable "install Trinity on my computer + follow the runbook"
  prompt), links the guide, and documents `start.sh --unattended`.

Pairs with the start.sh changes (779d314) that make the flow actually
unattended-safe. The doc describes real installer behavior, so the two can't
drift.

Related to ent#39
…cancels)

Same fix as on #1712: the pytest matrix job runs ~7-8 min on a normal GitHub
runner but the shared runners vary ~2-2.5x. A slow one hit the 15-min
`timeout-minutes` at ~78% of the suite (all tests passing) and was killed —
surfacing as a red "pytest (…) fail" + "regression diff" fail even though the
diff reports "No new failures". This PR is installer/docs only (zero Python), so
it can't be a real pytest failure. 25 min gives headroom for the slow tail;
pytest-timeout still bounds any single test. Belongs on dev too.

Related to ent#39
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr: required checks green, security scan clean, scope focused.

@vybe
vybe merged commit 4024e63 into dev Jul 22, 2026
21 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.

2 participants