From 1c104abde2231fbff054d1868e23eb772f0dcc41 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 10 Jun 2026 22:56:05 -0400 Subject: [PATCH] docs(app_controller): fix 3 hot_reload refs (filename + fictional method) --- docs/guide_app_controller.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/guide_app_controller.md b/docs/guide_app_controller.md index 7904bdee..b9de175e 100644 --- a/docs/guide_app_controller.md +++ b/docs/guide_app_controller.md @@ -45,7 +45,7 @@ When `--enable-test-hooks` is passed, the controller also spins up the HookServe │ - HistoryManager (src/history.py) │ │ - WorkspaceManager (src/workspace_manager.py) │ │ - HookServer (src/api_hooks.py) │ -│ - HotReloader (src/hot_reload.py) │ +│ - HotReloader (src/hot_reloader.py) │ │ - PathManager (src/paths.py) │ └─────────────────────────────────────────────────┘ ``` @@ -255,17 +255,13 @@ The `event_queue` is consumed by the GUI on the main thread to update display. ## Hot Reload -The controller can hot-reload Python modules while preserving state. This is critical for GUI iteration: +Hot reload is wired in `src/gui_2.py` rather than on the controller. The actual mechanism: -```python -def hot_reload(self, module_name: str) -> None: - """Reload a module and re-apply its render functions to the app.""" - from src.hot_reload import HotReloader - reloader = HotReloader(self.app) - reloader.reload(module_name) -``` +- **Registration** (`src/gui_2.py:282-287`): `App.__init__` registers `src.gui_2` with `HotReloader`, listing the App attributes (`state_keys`) to snapshot before reload and the App wrapper methods (`delegation_targets`) that the delegation pattern swaps atomically. +- **Trigger** (`src/gui_2.py:540-544`): `App._trigger_hot_reload()` calls `HotReloader.reload_all(self)` and stores `HotReloader.last_error` on `self._hot_reload_error` for visual error feedback. +- **Keyboard binding** (`src/gui_2.py:5340-5346`): the `Ctrl+Alt+R` shortcut is hard-coded in the source — there is no `config.toml` key for it. -`gui_2.py` registers all its render functions with the reloader at startup. On reload, the reloader swaps the function references without losing app state. +`HotReloader` is a stateless class (classmethods only); it has no constructor and no `self.app` field. See **[docs/guide_hot_reload.md](guide_hot_reload.md)** for the full mechanism. See **[docs/guide_hot_reload.md](guide_hot_reload.md)** for the full mechanism. @@ -409,7 +405,7 @@ def test_apply_persona(live_gui): - **`src/history.py`** — `HistoryManager` - **`src/rag_engine.py`** — `RAGEngine` - **`src/multi_agent_conductor.py`** — `MultiAgentConductor` -- **`src/hot_reload.py`** — `HotReloader` +- **`src/hot_reloader.py`** — `HotReloader` - **`src/api_hooks.py`** — `HookServer` (uses the controller's registries) - **`src/paths.py`** — `PathManager` - **[conductor/tracks/nagent_review_20260608/report.md](../conductor/tracks/nagent_review_20260608/report.md)** — Deep-dive analysis of the controller's per-provider history globals and other state patterns