Tool Installation Service
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
The Tool Installation Service installs, repairs, and reinstalls managed tools on an endpoint running the OpenFrame client. It is implemented by ToolInstallationService in the OpenFrame OSS Library's Rust client and is assembled into this repository through the openframe_agent_lib Cargo dependency. Its public entry point, install_reserved, receives a tool-installation message only after a caller has reserved the corresponding tool operation with a ToolOpGuard.
The implementation is available in the OpenFrame OSS Library: tool installation service source.
The service coordinates the endpoint-local portion of a tool deployment:
DownloadConfiguration and applies the message's effective version override before making destructive changes.The service does not acquire its own operation lock. install_reserved accepts a ToolOpGuard created by upstream orchestration, ensuring that the guard remains held for the duration of the asynchronous installation. This coordination prevents concurrent operations for the same tool and allows client update logic to defer while tool work is active.
ToolInstallationMessage is the deployment contract. It supplies tool identity, requested version, reinstall intent, download configurations, optional install and uninstall arguments, runtime arguments, optional service name, and optional assets. A selected DownloadConfiguration provides the operating-system match, download location, target file name, installation type, and optional bundle or service identifiers.
The supported installation types determine path handling and post-install behavior:
| Installation type | Primary artifact location | Required metadata | Validation and launch behavior |
|---|---|---|---|
| Standard | Tool-specific application-support directory | Executable path when available | Persisted as a standard installation, then started by the tool run manager. |
| Service | Tool-specific application-support directory | Service name | Existing service must be clear before replacement, and the installed service must be running before the record becomes installed. |
| GUI application | /Applications on macOS, otherwise tool-specific application-support directory |
Executable path; optional bundle ID | The resolved path is absolute. On Windows, GUI applications also receive autorun and configuration registry entries. |
The service records an InstalledTool with Installing or Installed state through InstalledToolsService. The Installing state is deliberately retained when a critical operation fails, allowing later delivery or repair processing to retry instead of reporting a healthy tool prematurely.
flowchart LR
CommandHandler["Tool installation command handler"] -->|"reserved install message"| InstallationService["Tool Installation Service"]
InstallationService -->|"select and download"| DownloadService["GitHub Download Service"]
InstallationService -->|"fetch Tool API asset"| ToolApiClient["Tool API Client"]
InstallationService -->|"paths and managed directories"| DirectoryManager["Directory Manager"]
InstallationService -->|"persist lifecycle record"| InstalledTools["Installed Tools Service"]
InstallationService -->|"stop processes and services"| ToolKill["Tool Kill Service"]
InstallationService -->|"expand command arguments"| CommandResolver["Tool Command Parameters Resolver"]
InstallationService -->|"expand asset URL"| UrlResolver["Tool URL Parameters Resolver"]
InstallationService -->|"start tool"| ToolRunManager["Tool Run Manager"]
InstallationService -->|"process connection"| ConnectionManager["Tool Connection Processing Manager"]
InstallationService -->|"publish installation"| InstalledPublisher["Installed Agent Message Publisher"]
sequenceDiagram
participant Handler as Command Handler
participant Installer as Tool Installation Service
participant Registry as Installed Tools Service
participant Source as Download Source
participant Runtime as Tool Run Manager
participant Connection as Connection Processing Manager
participant Events as Installed Agent Publisher
Handler->>Installer: install_reserved(message, operation guard)
Installer->>Registry: Get existing tool record
alt Healthy record and no reinstall
Installer->>Installer: Verify artifact is present
Installer-->>Handler: Complete without download
else Install, repair, or reinstall
Installer->>Installer: Resolve configuration for current OS
Installer->>Registry: Mark record Installing when present
Installer->>Installer: Stop holders and clear prior state
Installer->>Source: Download primary artifact and assets
Installer->>Installer: Run optional installation command
Installer->>Installer: Verify service when applicable
Installer->>Registry: Save InstalledTool in Installed state
Installer->>Runtime: Run new tool
Installer->>Connection: Start tool connection processing
Installer->>Events: Publish installed versions
Installer-->>Handler: Complete successfully
end
Installing and the corresponding executable or GUI application artifact exists. A missing artifact or interrupted state switches the request into repair behavior. The platform download configuration is resolved before any deletion.Installing, stops the installed tool, optionally invokes its uninstall command, kills processes using the tool directory, removes that directory with retries, and deletes persisted connection information. A Fleet-named tool also triggers cleanup of leftover Orbit state and osqueryd processes./Applications on macOS and to the managed tool directory elsewhere. The returned relative or absolute artifact location is normalized into a final executable path.ToolApiClient; GitHub assets are resolved and extracted by the download service. Reinstalls refresh Tool API assets, which supports server-generated configuration. Executable assets are stopped before write, marked executable on Unix, hardened through the file access-control helper, and may publish an installed-asset message.kill_on_drop and time out after 300 seconds. A nonzero exit status, execution error, or timeout aborts installation.InstalledTool record, registers Windows GUI autorun behavior when applicable, starts runtime and connection processing, then makes a best-effort installed-agent publication. Notification failure does not roll back a completed local installation.flowchart TD
Start["Receive installation request"] --> Existing{"Existing record?"}
Existing -->|"no"| Resolve["Resolve current OS configuration"]
Existing -->|"yes"| Reinstall{"Reinstall requested?"}
Reinstall -->|"no"| Artifact{"Artifact present and record installed?"}
Artifact -->|"yes"| Noop["Return successful no-op"]
Artifact -->|"no"| Resolve
Reinstall -->|"yes"| MarkInstalling["Mark existing record Installing"]
MarkInstalling --> StopOld["Stop tool, uninstall, clear directory and connection"]
StopOld --> Resolve
Resolve --> ClearService{"Service holder cleared?"}
ClearService -->|"no"| Retry["Fail and retain Installing state for retry"]
ClearService -->|"yes"| Download["Download, write assets, and run installer"]
Download --> Verify{"Service verification required?"}
Verify -->|"yes"| VerifyRun["Verify service is running"]
Verify -->|"no"| Persist["Persist Installed record"]
VerifyRun --> Persist
Persist --> Activate["Start tool and connection processing"]
Several choices preserve recoverability:
Installing record or a missing binary bypasses the no-op path.Installed; an installer that exits successfully but leaves a stopped service is retried rather than accepted.The service performs local filesystem, process, service-manager, and network operations; callers should expect errors from any of these boundaries. Errors that prevent safe replacement are propagated: absent platform configuration, failed directory operations, download failures, unresolvable command parameters, failed installer commands, service-clear failures, service verification failures, registry persistence failures, and runtime or connection startup failures.
Some cleanup and reporting work is intentionally best effort. For example, failure to stop a process is logged before the service continues to later checks; failure to remove stale connection data is logged; and inability to publish installed-agent messages does not fail a completed installation. This division keeps the authoritative local installation lifecycle strict while avoiding false installation failures caused by auxiliary telemetry.
The command timeout is particularly important for maintainers. A hung external installer cannot indefinitely retain the upstream operation guard, which would otherwise block tool work and defer client self-update. Timeout termination lets the operation fail cleanly and makes message redelivery available for recovery.
The Tool Installation Service is therefore the transactional coordinator for endpoint tool deployment: it reconciles desired tool state from a command message with existing on-disk and runtime state, commits the local registry only after the executable installation is credible, and then activates the tool's runtime and connectivity paths.