docs: Add session debrief about test fixes and MCP tool lesson

This commit is contained in:
2026-03-06 00:24:04 -05:00
parent 0b6db4b56c
commit 3376da7761
30 changed files with 874 additions and 1 deletions

26
debug_api_hooks.py Normal file
View File

@@ -0,0 +1,26 @@
with open("src/api_hooks.py", "r", encoding="utf-8", newline="") as f:
content = f.read()
# Add debug when receiving /api/gui
old = """elif self.path == "/api/gui":
lock = _get_app_attr(app, "_pending_gui_tasks_lock")
tasks = _get_app_attr(app, "_pending_gui_tasks")
if lock and tasks is not None:
with lock: tasks.append(data)"""
new = """elif self.path == "/api/gui":
sys.stderr.write(f"[DEBUG api_hooks] /api/gui received: {data}\\n")
sys.stderr.flush()
lock = _get_app_attr(app, "_pending_gui_tasks_lock")
tasks = _get_app_attr(app, "_pending_gui_tasks")
if lock and tasks is not None:
with lock: tasks.append(data)
sys.stderr.write(f"[DEBUG api_hooks] Added task, total: {len(tasks)}\\n")
sys.stderr.flush()"""
content = content.replace(old, new)
with open("src/api_hooks.py", "w", encoding="utf-8", newline="") as f:
f.write(content)
print("Added debug to api_hooks")