Skip to content

feat: auto-update on startup and doctor fix for post-upgrade config errors#111

Open
ImBada wants to merge 3 commits intotechartdev:mainfrom
ImBada:feature/auto-update
Open

feat: auto-update on startup and doctor fix for post-upgrade config errors#111
ImBada wants to merge 3 commits intotechartdev:mainfrom
ImBada:feature/auto-update

Conversation

@ImBada
Copy link
Copy Markdown

@ImBada ImBada commented Apr 8, 2026

Summary

  • Add automatic OpenClaw version check and update on add-on startup. Restarting the add-on will automatically update OpenClaw to the latest version if a newer one is available.
  • Add openclaw doctor --fix step before runtime launch to auto-fix legacy config keys that may break after version upgrades.

Background

Previously, updating OpenClaw required manually updating the add-on image. With this change, simply restarting the add-on triggers an automatic update via npm — no rebuild needed.

After a version upgrade, certain config keys may become invalid or renamed. The openclaw doctor --fix step detects and corrects these legacy config issues before the runtime starts, preventing startup failures.

Testing

Verified stability across two consecutive automatic upgrades:

  • 2026.4.2 → 2026.4.5
  • 2026.4.5 → 2026.4.8

Both upgrades completed successfully on restart with no manual intervention. The doctor fix step correctly handled config key migrations in each case.

@Nosdave
Copy link
Copy Markdown

Nosdave commented Apr 8, 2026

Good initiative! Though, I would suggest that this becomes an optional setting in the config, not a default.
Update to latest OC version: triggered automatically by restart or manually only or only with next single restart and then manually.
Reason: You may need just a restart without any changes or there may be a version you would like to skip (future OC releases may be more problematic or hardware dependent or coming with any other unanticipated flaw or trade-off later on).

Add auto_update boolean option to config.yaml, run.sh, and all 6
translation files so users can toggle OpenClaw auto-update from the
Home Assistant add-on settings UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ImBada
Copy link
Copy Markdown
Author

ImBada commented Apr 8, 2026

Hi @Nosdave

I fully agree with your suggestion. I have added the corresponding option feature. It is disabled by default.

On a separate note, the --doctor flag at startup was required when moving from 4.2 to 4.5, and it might be needed in the future, so it seems best to keep it unconditionally (this is rather a safety check).

@NewFolk
Copy link
Copy Markdown

NewFolk commented Apr 12, 2026

Hi @techartdev, thank you again for this add-on, and I totally understand that you are not able and should not spend all free time in maintenance of it.

We are already 5 version behind main.
But community would like to have updated OpenClaw and we all need to find some solution for it.

Maybe switching to DEV. And having auto approved pull request with version bump.
Or implementing this PR.

And I believe it's up to you to decide what approach better suites you.

@ImBada
Copy link
Copy Markdown
Author

ImBada commented Apr 12, 2026

By the way, I was unable to access the gateway web UI after updating to the latest version this time. However, since the discord bot was still functional, I instructed openclaw to fix the issue, and it resolved it automatically. Even with automatic updates enabled, most problems are handled by --docter, and if an issue persists there, openclaw should be able to fix it independently. (when --docter can help it wake up!)

Nonetheless, please be aware that enabling automatic updates can still be risky.

@ImBada
Copy link
Copy Markdown
Author

ImBada commented Apr 12, 2026

@NewFolk ,
Due to these potential structural breakages, the add-on may require fine-tuning. This is the reason @techartdev continues to update the versions manually. Sadly.

@NewFolk
Copy link
Copy Markdown

NewFolk commented Apr 12, 2026

Hi @ImBada,

Thanks for sharing, I didn't update yet, to be honest a little bit tired to jump back and forth to personal fork. But noted, thx :)

Regarding the reason I totally understand why, and I'm not saying that it's not necessary, or wasting a time. It definitely makes sense, but looks like Author doesn't have enough time to check every release and keep it updated. Which is totally fine, but we need to find some golden mean.

…OTEMPTY

npm install fails with ENOTEMPTY when a previous update attempt left behind
a .openclaw-* temp directory under node_modules. Remove stale temp dirs
before attempting the install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants