@@ -28,6 +28,7 @@ func _init(log_buffer: McpLogBuffer, connection: McpConnection = null, debugger_
2828
2929func get_editor_state (_params : Dictionary ) -> Dictionary :
3030 var scene_root := EditorInterface .get_edited_scene_root ()
31+ var game_status := _current_game_status ()
3132 var data := {
3233 "godot_version" : Engine .get_version_info ().get ("string" , "unknown" ),
3334 "project_name" : ProjectSettings .get_setting ("application/config/name" , "" ),
@@ -38,6 +39,9 @@ func get_editor_state(_params: Dictionary) -> Dictionary:
3839 ## false between Play→Stop cycles. Lets capture-source=game callers
3940 ## poll for a real ready signal instead of guessing with sleep().
4041 "game_capture_ready" : _debugger_plugin != null and _debugger_plugin .is_game_capture_ready (),
42+ "game_status" : game_status ,
43+ "helper_live" : bool (game_status .get ("helper_live" , false )),
44+ "session_active" : bool (game_status .get ("session_active" , false )),
4145 }
4246 ## Half-installed addon tree from a failed self-update rollback. When
4347 ## non-empty, the agent / dock paint the operator-facing recovery copy
@@ -93,20 +97,15 @@ func get_logs(params: Dictionary) -> Dictionary:
9397
9498func _current_game_status () -> Dictionary :
9599 if _debugger_plugin == null :
96- return {
100+ return McpDebuggerPlugin . with_liveness_flags ( {
97101 "status" : "stopped" ,
98102 "active" : false ,
99103 "ready" : false ,
100104 "helper_expected" : true ,
101- }
105+ })
102106 return _debugger_plugin .get_game_status ()
103107
104108
105- func _is_game_log_running (game_status : Dictionary ) -> bool :
106- var status := str (game_status .get ("status" , "stopped" ))
107- return not status in ["not_live" , "stopped" ]
108-
109-
110109func _get_plugin_logs (count : int , offset : int ) -> Dictionary :
111110 var all_lines := _log_buffer .get_recent (_log_buffer .total_count ())
112111 var page : Array [Dictionary ] = []
@@ -126,6 +125,8 @@ func _get_plugin_logs(count: int, offset: int) -> Dictionary:
126125
127126func _get_game_logs (count : int , offset : int , include_details : bool , since_run_id : String = "" ) -> Dictionary :
128127 var game_status := _current_game_status ()
128+ var helper_live := bool (game_status .get ("helper_live" , false ))
129+ var session_active := bool (game_status .get ("session_active" , false ))
129130 if _game_log_buffer == null :
130131 return {
131132 "data" : {
@@ -136,7 +137,9 @@ func _get_game_logs(count: int, offset: int, include_details: bool, since_run_id
136137 "offset" : offset ,
137138 "run_id" : "" ,
138139 "current_run_id" : "" ,
139- "is_running" : false ,
140+ "is_running" : session_active ,
141+ "helper_live" : helper_live ,
142+ "session_active" : session_active ,
140143 "game_status" : game_status ,
141144 "dropped_count" : 0 ,
142145 "stale_run_id" : false ,
@@ -156,7 +159,9 @@ func _get_game_logs(count: int, offset: int, include_details: bool, since_run_id
156159 "offset" : offset ,
157160 "run_id" : target_run_id ,
158161 "current_run_id" : current_run_id ,
159- "is_running" : _is_game_log_running (game_status ),
162+ "is_running" : session_active ,
163+ "helper_live" : helper_live ,
164+ "session_active" : session_active ,
160165 "game_status" : game_status ,
161166 "dropped_count" : _game_log_buffer .dropped_count (),
162167 "stale_run_id" : stale_run_id ,
@@ -266,7 +271,9 @@ func _get_all_logs(count: int, offset: int, include_details: bool) -> Dictionary
266271 "offset" : offset ,
267272 "run_id" : run_id ,
268273 "current_run_id" : current_run_id ,
269- "is_running" : _is_game_log_running (game_status ),
274+ "is_running" : bool (game_status .get ("session_active" , false )),
275+ "helper_live" : bool (game_status .get ("helper_live" , false )),
276+ "session_active" : bool (game_status .get ("session_active" , false )),
270277 "game_status" : game_status ,
271278 "dropped_count" : dropped ,
272279 }
0 commit comments