AI Agent Host Plugin Guide: Installation, Self-Checks, and Rollback

    This guide explains how to install, verify, and manage a host management plugin for an AI agent host. It covers pre-installation checks, the installation process, post-install self-checks, status and patch drift monitoring, interaction policies, centralized prompt management, snapshots, rollback procedures, and troubleshooting. Readers will learn how to confirm whether plugins and patches are working, reduce repetitive confirmation prompts, protect changes with snapshots, and recover safely when configuration or patches fail.

    Installing, Self-Checking, and Rolling Back an AI Agent Host Plugin

    Introduction

    As LLM applications become more engineering-focused, more developers use an AI assistant host (Agent Host) to run models, manage sessions, and orchestrate tool calls. Hosts commonly offer desktop, command-line, and web forms, and extend their capabilities through plugins.

    In practice, users often encounter three problems. First, there is no intuitive way to verify whether a plugin is installed correctly and whether patches have taken effect. Second, the agent repeatedly prompts for confirmation while executing tasks, interrupting the workflow. Third, after breaking configuration or patches, it is difficult to restore the previous working state.

    This article uses a common type of community host management plugin as an example. It follows the sequence of “what it is, how to install it, how to manage it, and what to do when problems occur,” walks through a complete onboarding flow, and summarizes reusable practices.

    1. What the Plugin Manages

    1.1 Division of Responsibilities Between Host and Plugin

    The host handles core work: loading models, maintaining conversation context, executing tool calls, and managing sessions. The plugin runs on top of the host and provides additional capabilities through patches, configuration injection, and panel extensions.

    A management plugin usually does one thing: centralize the parts of daily use that consume the most attention into a single control plane. It mainly provides four capabilities:

    • See status clearly: installation, patches, and injection readiness can be confirmed with one command.
    • Reduce interruptions: repeated confirmations are consolidated into a one-time policy so the agent can execute tasks continuously.
    • Keep records: every apply, rollback, and toggle change is logged, and snapshots are created automatically before operations.
    • Centralize prompts: rules and presets are stored in one place, and broken changes can be reverted.

    This type of plugin affects only the host’s interaction layer. It does not modify the model itself or change the user’s task goals. It reduces operational friction, while decisions remain with the user.

    1.2 Four Design Baselines

    Principle Meaning
    Local processing by default Plugin logic runs locally; prompts and configuration are not uploaded. If the host itself relies on cloud sync, this must be noted separately in the compatibility documentation
    Visible status Every action has a clear status and check result; users do not have to guess whether it took effect
    Reversible changes Automatic snapshots are created before applying, installing, and rolling back; original files and checksum manifests are retained
    User-controlled operations The plugin only reduces friction; what to change and what to enable require user confirmation

    Most of the features described below revolve around three tasks: status checks, snapshots, and toggles.

    2. Installation and Initialization

    2.1 Pre-Installation Checks

    Confirm three items before installation, each with a corresponding check method.

    1. Whether the host version is in the verified list in the compatibility table. The compatibility table is located at docs/compatibility.md in the plugin documentation. It records verified host versions, patch counts, and drift detection results. A candidate version can be installed only if it appears in the list.
    2. Runtime form. Confirm whether you are using the desktop, command-line, or web form. Configuration file paths differ by form.
    3. Write permission. The plugin needs to write to the host installation directory to apply patches and save snapshots. Test it with the following command:
    1. touch <host-install-path>/.write-test && rm <host-install-path>/.write-test && echo "Write permission OK"

    If permission is denied, adjust the directory permissions first. Do not run the installer directly with administrator privileges.

    2.2 Running the Installation

    Installation always starts from install.sh, which does three things: copies plugin files, applies patches one by one according to the patch list, and registers the dsh-plugin command. After installation, all subsequent operations use the dsh-plugin command.

    1. # 1. Get the plugin release package
    2. git clone <plugin-repo-url> && cd <plugin-dir>
    3. # 2. Run the installer and specify the host installation path
    4. ./install.sh --target <host-install-path>
    5. # 3. Confirm the command is registered
    6. dsh-plugin status

    If a patch fails, the installer exits immediately with a non-zero exit code and prints the failed patch number. It restores applied patches to the pre-installation snapshot, so the host is not left in a half-installed state. If dsh-plugin reports that the command cannot be found, add the plugin’s bin/ directory to PATH, or run ./install.sh --status from the plugin directory.

    After a successful installation, the installer creates a baseline snapshot and generates a checksum manifest. The baseline snapshot is the final basis for a full rollback; do not delete it.

    2.3 Self-Check Immediately After Installation

    A successful installation does not mean the plugin is usable. Run a self-check immediately:

    1. dsh-plugin check --verbose

    The self-check covers six types of checks:

    Check Item What It Checks Pass Criteria Action on Failure
    File integrity Compare hashes against the checksum manifest All file hashes match See 4.2; roll back the plugin file snapshot
    Patch application status Confirm each patch has been written to the target location Applied count equals total patch count See 4.3 step 1; reapply the patch
    Injection points Check the mount locations of panels and hooks All injection points exist Check the missing injection point names in the self-check output and reinstall the corresponding module
    Configuration syntax Parse configuration files All files are syntactically valid Fix the configuration according to the reported line number, or roll back the configuration
    Snapshot writability Test writes and free space in the snapshot directory Writable and free space is at least 1 GB Change the snapshot directory or clean old snapshots (see 4.1)
    Version compatibility Compare the host version with the compatibility table Version is in the verified list Do not continue using it; install a verified version

    Example output:

    1. [PASS] File integrity 12/12 file hashes match
    2. [PASS] Patch status 8/8 patches applied
    3. [FAIL] Injection points Missing injection point: panel-sidebar
    4. Action: See 4.3 step 1; reapply the corresponding patch
    5. [PASS] Config syntax 3/3 files passed
    6. [PASS] Snapshot writable Snapshot directory writable, 12.4 GB free
    7. [PASS] Version compat Host 1.8.2 is in the verified list

    An exit code of 0 means all six checks passed; an exit code of 1 means at least one check failed. Scripts and scheduled tasks can use the exit code directly.

    3. Daily Management

    3.1 Status Panel and Patch Drift

    The most frequently used command is the status query:

    1. dsh-plugin status

    The output includes the total number of patches, applied count, unapplied count, drift count, the current state of each feature toggle, and the time and count of the most recent snapshot.

    After a host upgrade, existing patches may no longer match the new files. This situation is called drift, meaning the content at the patch target location has changed. Run the following command to view drifted patches:

    1. dsh-plugin drift

    Handle drift according to the following rules.

    • Drift count is 0: the status is normal, and no action is needed.
    • Drift count is greater than 0: pause patch reapplication and record the patch numbers listed by the command. Forcing reapplication may damage the host’s new code.
    • Check the compatibility table: if the current host version is already in the verified list, the plugin author has updated the patches. You can upgrade the plugin and reinstall.
    • Version not verified: keep the current state and wait for a compatible plugin release. Before the plugin has completed regression testing on mainstream desktop platforms, forcing application is not recommended.

    3.2 Interaction Policy: Consolidating Confirmations and Interruptions

    By default, the host asks for confirmation when the agent performs sensitive operations, including writing files, running commands, and making network requests. The plugin can consolidate these confirmations into a one-time policy. The policy is stored in the configuration file policy.toml and can be viewed with dsh-plugin policy show.

    The policy is divided into three risk levels:

    • Read-only operations: automatically allowed without prompting.
    • Write operations: after the first confirmation, the user can choose “remember for this session”; it expires when the session ends.
    • High-risk operations: including deletion, overwriting critical configuration, and changing permissions. Confirmation is required every time. This level cannot be disabled through configuration; it is a fixed safety boundary of the plugin.

    Tasks can also use different modes. Long-task mode grants batch authorization, while interactive mode confirms item by item. This design reduces repeated clicks, while the safety gate remains under user control.

    3.3 Centralized Management of Prompts and Presets

    System prompts, behavior rules, and task presets are often scattered across multiple locations. When editing them, it is easy to miss one location, and such omissions are a common source of failures. The centralized management module works as follows:

    • All prompts and presets are stored together with version history.
    • Every change is recorded automatically. Use dsh-plugin prompt diff to compare before and after, and dsh-plugin prompt revert to undo.
    • Presets can be switched by scenario, such as code review, documentation writing, and data analysis. The switch action is also written to the audit log.

    4. What to Do When Problems Occur

    4.1 Snapshots: Insurance Before Changes

    Snapshots are the basis for rollback. A reliable snapshot mechanism needs to meet three requirements.

    • Automatic triggering: automatically create snapshots before applying patches, installing updates, or modifying critical configuration, without requiring manual backup.
    • Complete content: include original copies of modified files, current configuration, and the checksum manifest.
    • Searchable: name snapshots by timestamp and operation type, and support list queries and content previews.
    1. # View the snapshot list and the size of each snapshot
    2. dsh-plugin snapshot list --size
    3. # Preview the difference between a snapshot and the current state
    4. dsh-plugin snapshot diff <snapshot-id>

    Snapshots consume disk space. The plugin keeps the latest 20 snapshots by default. The baseline snapshot is retained permanently and does not count toward the limit. Each snapshot is roughly the size of the modified files plus the manifest file, usually at the MB level. If the snapshot directory is nearly full, clean old snapshots:

    1. # Keep only the latest 20 snapshots; confirmation is required before execution
    2. dsh-plugin snapshot prune --keep 20

    Before cleaning, confirm that the snapshot list does not contain any versions you need to keep.

    4.2 Rollback: Verify First, Then Restore

    There are three rollback granularities. Choose based on the impact scope of the problem:

    1. Single-patch rollback: when one patch causes an issue, undo only that patch.
    2. Configuration rollback: when prompts or toggles are broken, restore only the configuration portion.
    3. Full rollback: restore the complete state from a baseline snapshot, suitable for broad issues such as a failed host upgrade.

    Rollback overwrites all changes made after the snapshot, including manually modified prompts and configuration. Therefore, perform the following four steps before executing it:

    1. # Step 1: See what the rollback will overwrite
    2. dsh-plugin snapshot diff <snapshot-id>
    3. # Step 2: If there are changes not yet snapshotted, create a manual snapshot first
    4. dsh-plugin snapshot create --label manual-before-rollback
    5. # Step 3: Perform the rollback
    6. dsh-plugin rollback --to <snapshot-id>
    7. # Step 4: Run the self-check again after rollback
    8. dsh-plugin check --verbose

    Step 2 is important. Rollback cannot recover modifications that were not snapshotted. A manual snapshot lets you retrieve those changes after rollback. Step 4 cannot be omitted. Rollback only restores files; whether the system has truly returned to a healthy state must be judged by the self-check result, not by assumption.

    4.3 Troubleshooting Path

    When a problem occurs, troubleshoot in the following order. The earlier the step, the lower the cost.

    1. Check the self-check report. Missing files, patch drift, and configuration syntax errors are usually shown directly. Run dsh-plugin check --verbose and find the FAIL items.
    2. Check the operation log. Every apply, rollback, and toggle change is recorded. Run dsh-plugin log --tail 50 and find the operation where the problem began.
    3. Compare the checksum manifest. Run dsh-plugin verify to check current files against the hash manifest in the snapshot. If hashes do not match, an external program, such as a host auto-update, has changed patched files.
    4. Minimize reproduction. Run dsh-plugin toggle --all off to disable all optional features, then enable them one by one to find the feature causing the issue.
    5. Perform a full rollback to the baseline. This is the last resort, which is why the baseline snapshot must be retained.

    5. Summary

    The value of a host management plugin can be summarized in three points.

    • Status can be checked: installation, patches, injection, and toggles can all be confirmed through self-checks and logs, without guessing.
    • Changes can be undone: snapshots are created automatically before operations, verification is performed before rollback, and self-checks are run after rollback.
    • Decisions remain with the user: the plugin only reduces repeated confirmations; confirmation for high-risk operations is always completed by the user.

    This approach applies to the host plugin described in this article. For other development assistant tools, the same inspection mindset can be used: confirm status first, retain snapshots, and let people confirm critical operations.