fix: Add debug logging to patch endpoints

This commit is contained in:
2026-03-07 00:45:07 -05:00
parent 14dab8e67f
commit d520d5d6c2
4 changed files with 52 additions and 26 deletions

View File

@@ -518,11 +518,21 @@ class AppController:
self._ask_request_id = None
self._ask_tool_data = None
elif action == "custom_callback":
sys.stderr.write(f"[DEBUG] Processing custom_callback task\n")
sys.stderr.flush()
cb = task.get("callback")
args = task.get("args", [])
if callable(cb):
try: cb(*args)
except Exception as e: print(f"Error in direct custom callback: {e}")
try:
sys.stderr.write(f"[DEBUG] Calling callable callback\n")
sys.stderr.flush()
cb(*args)
sys.stderr.write(f"[DEBUG] Callback completed\n")
sys.stderr.flush()
except Exception as e:
sys.stderr.write(f"[DEBUG] Error in direct custom callback: {e}\n")
sys.stderr.flush()
print(f"Error in direct custom callback: {e}")
elif cb in self._predefined_callbacks:
self._predefined_callbacks[cb](*args)
elif action == "mma_step_approval":