perf(entropy): Fix nested imports in hot paths

Hoisted imports from inside frequently-called functions to module level:

app_controller.py:
- Added traceback and inspect at module level
- Removed 3 nested traceback imports from exception handlers

gui_2.py:
- Added traceback at module level
- Removed nested traceback import from _gui_func exception handler
- Kept uvicorn lazy-loaded (only for --headless mode)

multi_agent_conductor.py:
- Removed unused 'import sys' from run()
- Removed redundant nested imports (already at module level)

Also adds audit scripts and entropy findings documentation.
This commit is contained in:
2026-05-06 20:18:30 -04:00
parent 54afbb9365
commit 2b5185a78f
8 changed files with 598 additions and 57 deletions
+1 -1
View File
@@ -35,6 +35,7 @@ from src import thinking_parser
import re
import difflib
import subprocess
import traceback
if sys.platform == "win32":
import win32gui
import win32con
@@ -1319,7 +1320,6 @@ class App:
imgui.end_popup()
except Exception as e:
print(f"ERROR in _gui_func: {e}")
import traceback
traceback.print_exc()
if pushed_prior_tint: