Commit ea146b0
* Gate in-editor self-update off on Godot < 4.4 (#475)
On Godot < 4.4 the self-update takes the `_install_zip_inline`
extract-then-restart path, and that engine's stricter
`GDScript::reload()` (`!p_keep_state && has_instances` ->
`ERR_ALREADY_IN_USE`) turns the extract-over-live-scripts into a reload
error flood plus a SIGSEGV in `EditorDockManager::remove_dock` /
`SceneTree::finalize` on the restart/quit. Approaches that tried to make
the in-place flow safe on 4.3 were disproven (see #475).
This gates the in-editor update off on < 4.4 instead: `start_install()`
opens the GitHub releases page for a manual download and shows
"in-editor update needs Godot 4.4+ — replace addons/godot_ai/ manually",
never entering the extract pipeline that crashes those engines. The
update banner's button is relabeled "Open download page" up-front at
check time so the action is honest before the click. 4.4+ is unchanged
(real in-place update via update_reload_runner).
Version logic is split into a pure static `_version_can_self_update(
major, minor)` so it's unit-testable without faking the engine; guards
`major` so a future 5.x (minor 0) isn't misclassified.
Verified e2e on real engines (disposable fixtures at v2.5.6 vs the
v2.5.7 release):
- Godot 4.3: clicking the gated button opens the release page + manual
message; NO extract, NO ERR_ALREADY_IN_USE, NO crash; a subsequent
Cmd-Q exits cleanly with no new crash report. Only the two benign
`extends Logger` parse errors remain (cosmetic, < 4.5).
- Godot 4.6: gate does NOT fire; real in-place update runs end-to-end
(2.5.6 -> 2.5.7 via update_reload_runner), 0 errors, 0 crash.
- GDScript unit tests pin the predicate (4.3/4.0/3.x false; 4.4/4.6/5.0
true); full update_manager suite green (14/14).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Gated update banner: show guidance up-front + wrap the label
Two UX fixes on the < 4.4 self-update gate, from dogfooding the 4.3
banner:
- The manual-update explanation only appeared AFTER clicking. Move it
to check time: _on_update_check_completed now emits the full guidance
label (with the available version) alongside the "Open download page"
button, so the user understands what the button does before pressing
it. Extracted into a single _manual_update_label(version) helper so
the check-time and click-time text cannot drift.
- The long label was a single non-wrapping line that stretched the dock
super wide. _update_label now uses AUTOWRAP_WORD_SMART + SIZE_FILL so
it wraps to the dock width instead.
Adds GDScript tests for _manual_update_label (version present / absent).
update_manager suite 16/16 green on 4.6; compiles clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Align install-dispatch version check with the gate predicate (F2)
The _can_self_update() gate is major-aware (major>4 or (major==4 and
minor>=4)), but _install_zip / _install_zip_inline still keyed off
`minor >= 4` only. On a future Godot 5.0 (major=5, minor=0) the gate
would let the user in expecting the seamless runner reload, but the
minor-only check would route them to the pre-4.4 inline extract +
"Restart editor" path — the crash-prone flow the gate exists to avoid.
Route both install-dispatch checks through the same
_version_can_self_update(major, minor) predicate (already unit-tested
for 4.3/4.4/4.6/5.0) so the gate and the dispatch can't disagree.
No behavior change on 4.4-4.6; fixes the latent 5.x inconsistency.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address Copilot review on the gate (#482): shell_open guard + preserve label
Two Copilot findings on the < 4.4 gated start_install path:
- OS.shell_open()'s return was ignored: the button switched to the
disabled "Opened download page" state even if the browser never
opened (no handler / headless), stranding the user. Now only claim
success + lock the button when shell_open returns OK; on failure show
"Couldn't open browser — retry" and keep the button enabled.
- The click-path emit re-set label_text to _manual_update_label(""),
which contradicted its own "keep the up-front guidance label" comment
and dropped the version. Removed the label_text key so the
version-bearing guidance label from check time persists through the
click (matches the comment, keeps "Update vX.Y.Z available").
Verified: 4.6 import clean, update_manager suite 15/16 (1 dev-checkout
skip), ruff green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 81e0b36 commit ea146b0
3 files changed
Lines changed: 118 additions & 6 deletions
File tree
- plugin/addons/godot_ai
- utils
- test_project/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
490 | 496 | | |
491 | 497 | | |
492 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
110 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
111 | 165 | | |
112 | 166 | | |
113 | 167 | | |
| |||
233 | 287 | | |
234 | 288 | | |
235 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
236 | 298 | | |
237 | 299 | | |
238 | 300 | | |
| |||
284 | 346 | | |
285 | 347 | | |
286 | 348 | | |
287 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
288 | 354 | | |
289 | 355 | | |
290 | 356 | | |
| |||
337 | 403 | | |
338 | 404 | | |
339 | 405 | | |
340 | | - | |
| 406 | + | |
341 | 407 | | |
342 | 408 | | |
343 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
26 | 66 | | |
27 | 67 | | |
28 | 68 | | |
| |||
0 commit comments