Skip to content

Hold scene opens until the editor has opened its startup scenes - #1083

Merged
saworbit merged 2 commits into
mainfrom
fix/editor-startup-scene-hold
Sep 30, 2026
Merged

saworbit merged 2 commits into
mainfrom
fix/editor-startup-scene-hold

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Fixes #1069

An editor opens the scenes it restores, or the project's main scene, once its first scan of the project is applied, and makes one of them current. A scene_open sent before then answered opened: true, and a moment later the startup put the main scene in front. Every scene call after that acted on the main scene.

scene.open and scene.create now wait at the front of the bridge queue until the editor's file index has something in it. The index starts empty, and the editor swaps the scanned one in just before it opens its startup scenes. That holds on 4.5.1, 4.6.2 and 4.7.2 (EditorNode::_sources_changed while waiting_for_first_scan). Anything queued behind them waits too, so nothing overtakes them. Other commands are not held. A wait past the route deadline answers 504 route_deadline_exceeded with outcome: not_started, and nothing was opened or written.

Tests:

  • EditorHook.SceneOpenWaitsForTheStartupScenes holds both methods with a command queued behind each, and releases them once the editor has started. It fails with the hold removed.
  • tests/test_editor_startup_live.py launches an editor, opens a scene as soon as the session is listed, and reads the edited scene for ten seconds. CI runs it in a new step on all three lines. It failed on 4.5.1 and 4.7.2 with the hold removed.
  • tools/vibe/probes/startup_scene_open.py reproduces the switch by hand.

Also fixed a stale sentence in docs/ARCHITECTURE.md that still said the editor's own scan could run queued commands. #995 part one closed that.

Checked locally: native suite (954), Python suite (541), docs validator, test inventory, and the live harness on 4.5.1, 4.6.2 and 4.7.2. CHANGELOG updated under Unreleased, Fixed.

An editor opens the scenes it restores, or the project's main scene, once
its first scan is applied, and makes one of them current. A scene_open
answered before then was replaced a moment later, and every later scene
call acted on the main scene.

scene.open and scene.create now wait at the front of the queue until the
editor's file index is populated, which is the same moment on 4.5.1,
4.6.2 and 4.7.2. Commands behind them wait too, so nothing overtakes them.

Adds a native test for the hold, a live test CI runs on each line, and a
vibe probe that reproduces the switch.
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Workflows, automation, and the release gate tests Test suites and the contracts they assert addon The Godot addon and the in-engine GDExtension tooling Generators, harnesses, and developer tooling labels Sep 30, 2026
The 4.6.2 job on #1084 saw scene_open end in peer_closed after 5.7 s,
with the editor alive, and the test had sent the editor output nowhere.
It now keeps it with the extension at INFO, and a failure prints it with
the sessions the server lists.
@saworbit
saworbit merged commit 0dc18e6 into main Sep 30, 2026
28 checks passed
@saworbit
saworbit deleted the fix/editor-startup-scene-hold branch September 30, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon The Godot addon and the in-engine GDExtension ci Workflows, automation, and the release gate documentation Improvements or additions to documentation tests Test suites and the contracts they assert tooling Generators, harnesses, and developer tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Scene] Keep scene_open's scene current through the editor's startup

1 participant