Skip to content

Keep self-hosted uninstall inside its installation - #736

Merged
SaladDay merged 2 commits into
mainfrom
keep-self-hosted-uninstall-inside-its-installation
Oct 15, 2026
Merged

SaladDay merged 2 commits into
mainfrom
keep-self-hosted-uninstall-inside-its-installation

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • install defaults to <Runtime home>/environments/<environment-id> for every mode (one definition, defaultDirectory), says so in the flag help, and refuses a non-empty --install-dir that holds no installation, naming it. A directory holding only installer entries (a failed earlier install) is accepted so reruns stay clean.
  • uninstall deletes only the installation's entries (one shared list, nativeInstallationEntries, used by install and uninstall), removes the directory only when it is then empty, and prints Kept: <path> for everything else, including a credential file or capability directory outside the installation. It deletes bin/ and daemon/installation.json last so a failed run can be rerun, names the path it could not delete, and no longer touches native-download. The running executable is matched with os.SameFile. The output says the Session's install command cannot be reused and what reconnects it.
  • bootstrap.sh treats 22:416 on a resumed download as complete and lets the checksum decide.
  • Both bootstraps (and the POSIX command's own fetch) keep the grant out of every child except the oac-daemon install call.
  • v1.NativeInstallGrantEnv in contracts/agents-api/v1 is the single definition of the grant variable name; the Core and daemon copies are gone.
  • self-hosted.md and the executor-credentials contract (EN+zh) are corrected: uninstall scope, PowerShell uninstall form, PowerShell history behaviour, grant handling, directory rule.

Why

Review findings P0-1, P1-1, P2-1 to P2-8 (review-self-hosted.md). P2-5 preflight: POST /installation cannot report a claimed credential without a new field, and the original installation's own rerun (same secret) must pass it, so it is left out.

Verification

  • go test ./apps/daemon/internal/cli -run 'Native|Uninstall|Install|RemoveTree|Interrupt|Onboard|Discovery|Start': pass
  • go test ./services/core/internal/nativeinstaller ./contracts/...: pass
  • go vet ./... and GOOS=windows go vet ./apps/daemon/internal/cli: pass
  • scripts/check-names.py: pass; website/tests/translations.test.mjs: tests 1-2 pass
  • New tests: foreign files survive uninstall and are reported; foreign directory refused; default directory; failed uninstall rerunnable; complete .part installs; grant reaches only the installer.

Skipped

  • Translations test 3 (needs vitepress, website deps not installed)
  • PowerShell paths (bootstrap.ps1, Windows deleteAfterExit): cannot run here; CI's Windows job covers them

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@blacksmith-sh

This comment has been minimized.

Install defaults to the environment directory and refuses a foreign non-empty
directory; uninstall deletes only the installation's own entries, removes its
record and executable last, and reports what it keeps. The bootstraps accept a
complete partial download and give the grant only to the installer, and the
grant variable name has one definition.
@SaladDay
SaladDay merged commit 1696e1a into main Oct 15, 2026
25 checks passed
@SaladDay
SaladDay deleted the keep-self-hosted-uninstall-inside-its-installation branch October 15, 2026 14:01
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.

1 participant