Signal connected by in-editor @tool isn't retained in-game

Godot Version

4.2.1 (Linux)


Is there a way to make signals setup by a @tool script be retained when in-game? More context and minimal example below:

I have a @tool script/scene ( which checks for the existence of a child scene ( If it isn’t there, it creates it in-editor, and connects a signal between the two. My problem is that the signal connection isn’t retained when running in-game. If I connect the signal in _ready of it works fine because this runs again in-game. This is ok, but not really what I want, because the setting up of the child dependency scene can get quite complicated and it makes sense to set signal connections in the same place that the child node/s are created.

I’ve made a minimal example below:

@tool extends Control
signal thing_happened;

func _ready():

func _on_button_pressed():
	print(" Button press detected. thing_happened emitted");

@tool extends Control
var dependentScenePath: String = "res://dependency_script.tscn"

# Called when the node enters the scene tree for the first time.
func _ready():
	if !get_node_or_null("DependencyScene"):
	#Connect signals. This works when uncommended.
func setup_dependent_scene():
	var dependencyScene = load(dependentScenePath).instantiate() = "DependencyScene"
	if Engine.is_editor_hint():
		dependencyScene.owner = get_tree().edited_scene_root
	#Connect signals. This doesn't work because the connected signals aren't
	# retained in-game

func _on_thing_happened():
	print(" received thing_happened signal")