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
* Show "Restarting…" feedback while dev-mode restart is in flight
Live smoke uncovered a 5s editor freeze (from _wait_for_port_free) with
no acknowledgement of the click — the user wonders if the button did
anything. Mirror the existing _crash_restart_btn / _version_restart_btn
pattern: set _server_restart_in_progress on click, dispatch via
call_deferred + a 0.15s paint window, then clear the flag after the
spawn lands. _update_dev_section_buttons checks the flag and renders
"Restarting…" + disabled while in flight.
Test path is non-tree, so _on_dev_restart_pressed runs synchronously
when is_inside_tree() is false — keeps the existing dispatch test
green without needing await scaffolding.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Consolidate dev-section to one Restart Dev Server + small ✕ stop
Per PR review feedback: two restart-flavored buttons in the same
section felt redundant, and the new Restart Server stayed disabled
when only an adopted external dev server was running because brand
detection misses orphaned multiprocessing.spawn workers.
Replaces both _dev_server_btn (3-state Switch/Exit/Start toggle) and
_dev_restart_btn (kill+respawn preserving mode) with a single primary
button + a small stop affordance:
- _dev_primary_btn — full-width "Restart Dev Server" / "Start Dev
Server" (label adapts to whether something's running). Always enabled.
Click → force_restart_or_start_dev_server which kills any godot-ai
server (managed or dev), waits for the port to free, and lands in
--reload mode. Same "Restarting…" feedback during the blocking wait.
- _dev_stop_btn — compact "✕" beside the primary. Enabled only when a
dev server is actually running. Click → stop_dev_server (existing).
Intentionally never targets the managed server (lifecycle owns that).
Plugin's force_restart_server_preserving_mode is renamed/retargeted as
force_restart_or_start_dev_server. The previous "preserve managed mode"
semantics drop — clicking Restart now always lands in dev mode, since
that's the only mode contributors editing Python source actually want.
The lifecycle's force_restart_server stays for the version-drift /
crash recovery paths that legitimately preserve managed mode.
One verb, one mental model. Adapted tests cover the truth table.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Make force_restart_or_start_dev_server cover orphan workers
Previous version branched on has_managed_server / is_dev_server_running,
both of which miss orphaned multiprocessing.spawn uvicorn workers — when
the parent reloader dies (or the editor is restarted while the worker
keeps holding the port), the worker's cmdline is just "spawn_main"
without godot_ai branding, so neither detection path fires. Result:
clicking Restart skipped the kill and went straight to start_dev_server,
which then failed to bind :8000.
Switch the kill arm's condition to _is_port_in_use(port). The user
clicking Restart is explicit consent to take over the port, so killing
whoever's there (regardless of brand) is the right semantics. Lifecycle
state still resets when has_managed_server() so the next adoption pass
sees a clean slate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Three follow-ups from live PR #406 review
1. Fix Restart/Start label bug. After clicking the primary button, the
newly-spawned --reload server's LISTEN holder is uvicorn's
`multiprocessing.spawn` worker — that PID's cmdline doesn't contain
the godot_ai brand, so `is_dev_server_running()` returned false and
the label stayed "Start Dev Server" instead of flipping to "Restart
Dev Server" once the server was up. Walk up the parent chain
(bounded depth 5) inside `_pid_cmdline_is_godot_ai` so a worker
whose parent reloader IS branded gets recognised. Adds `_pid_parent`
helper covering POSIX (`ps -o ppid=`) and Windows (PowerShell CIM).
2. Drop the dock's "Mode override" dropdown. The dropdown advertised
toggling between the github-repo local plugin and the installed ZIP
version, but it didn't actually do that — it just nudged
`is_dev_checkout()` for the update banner, which is more usefully
driven by the GODOT_AI_MODE env var (still supported, still tested
in test_clients.gd). Removes ~50 lines of dead UI plumbing and the
stale "fresh check paints over a clean slate" comment.
3. Delete the orphan live_demo test file from a debugging session that
never landed cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mode_label.tooltip_text="Force dev or user mode for testing the update flow. Normally leave on Auto. GODOT_AI_MODE env var is the fallback when this is Auto."
"tooltip": "Stops the plugin's managed server and replaces it with a --reload dev server on port %d. The dev server auto-restarts when you edit Python sources."%port,
1370
-
}
1371
-
ifdev_running:
1372
-
return {
1373
-
"text": "Exit dev mode",
1374
-
"tooltip": "Stops the external dev server on port %d so the plugin's managed server can take over on next reload."%port,
1375
-
}
1376
-
return {
1377
-
"text": "Start dev server",
1378
-
"tooltip": "Spawns a --reload dev server on port %d. Auto-restarts when you edit Python sources."%port,
1379
-
}
1380
-
1381
-
1382
-
func_update_dev_server_btn() ->void:
1383
-
if_dev_server_btn==null:
1384
-
return
1385
-
if_plugin==null:
1386
-
return
1387
-
## Defensive guard against the self-update mixed-state window — see the
1388
-
## comment in `_update_status` for the full story. Same #168.
0 commit comments