feat(api_hooks): expose warmup_status in /api/gui/diagnostics endpoint
Phase 7 of startup_speedup_20260606 track.
Added warmup status to the existing /api/gui/diagnostics endpoint
(Phase 7 minimal scope - dedicated /api/warmup_status endpoint and
GUI status indicator deferred to follow-up sub-track).
The diagnostics response now includes:
warmup: {
pending: [list of module names still being warmed],
completed: [list of module names successfully warmed],
failed: [list of module names that failed to warm]
}
External clients and tests can poll this endpoint to know when the
system is fully ready (all heavy modules loaded).
The endpoint gracefully handles missing controller (returns empty dict)
and exceptions (catches them, returns default empty state).
TESTS: 7 live_gui tests pass (test_hooks, test_live_workflow,
test_live_gui_integration_v2). No breakage from the new field.
NEXT: Phase 8 (runtime audit hook enforcement test) + Phase 9
(final verify + checkpoint).
This commit is contained in:
@@ -231,6 +231,15 @@ class HookHandler(BaseHTTPRequestHandler):
|
||||
perf = _get_app_attr(app, "perf_monitor")
|
||||
if perf:
|
||||
result.update(perf.get_metrics())
|
||||
# Warmup status (startup_speedup_20260606 Phase 7). Exposes the
|
||||
# AppController's warmup_status() result so external clients and
|
||||
# tests can poll until all heavy modules are loaded.
|
||||
controller = _get_app_attr(app, "controller", None)
|
||||
if controller and hasattr(controller, "warmup_status"):
|
||||
try:
|
||||
result["warmup"] = controller.warmup_status()
|
||||
except Exception:
|
||||
result["warmup"] = {"pending": [], "completed": [], "failed": []}
|
||||
finally: event.set()
|
||||
lock = _get_app_attr(app, "_pending_gui_tasks_lock")
|
||||
tasks = _get_app_attr(app, "_pending_gui_tasks")
|
||||
|
||||
Reference in New Issue
Block a user