You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write-to-temp + validate-before-swap; atomic swap with rollback on validation failure.
Refresh must be a two-step operation, not a single call:
Check — resolve the tracked source's ref, fetch into a staging location (never the active install path), run manifest + entrypoint validation against the staged content, return {requested_ref, resolved_ref, validated}. The active bundle is untouched and keeps serving.
Apply — a separate, explicit, reconfirmed call, atomically swaps staged → active, with the new bundle's own enabled state set to whatever was just confirmed.
Do not implement this by callingInstallationManager.update()orinstall(force=True) — confirmed against current source:
update() (manager.py:292-317) resolves ref=None ("latest available") and calls self.install(..., force=True) — by its own docstring, this "re-fetches... and force-reinstalls."
install(force=True) (manager.py:106-112) does shutil.rmtree(install_path) immediately followed by shutil.copytree(fetched_path, install_path) directly on the live install path — no temp/staging directory at all, and there's a real window mid-swap where the path is empty/partial if anything fails between the two calls.
This exact pattern is already the live implementation backing Plugins' refresh (update_plugin() → openhands/sdk/plugin/installed.py:136-141, a direct passthrough to .update()).
Suggested shape: stage into a sibling directory (e.g. <install_dir>/.staging/<name>-<resolved_ref>/), validate there, then swap with a single atomic rename (os.replace, atomic on the same filesystem) rather than rmtree-then-copytree.
Activity