fix: add router prefix for ai_ui_control WebSocket and REST routes
- APIRouter had no prefix, so WebSocket was on /ws not /api/v1/ai-ui-control/ws - This caused 403 on every WebSocket connection attempt - Remove debug print statements
This commit is contained in:
@@ -46,14 +46,11 @@ class AIUIControlPlugin(BasePlugin):
|
||||
|
||||
async def on_activate(self, db, service_container, event_bus) -> None:
|
||||
"""Register the WebSocket manager in the service container on every activation."""
|
||||
print("[STARTUP] ai_ui_control on_activate called", flush=True)
|
||||
await super().on_activate(db, service_container, event_bus)
|
||||
print("[STARTUP] ai_ui_control super().on_activate done", flush=True)
|
||||
from app.plugins.builtins.ai_ui_control.websocket_manager import AIUIControlWSManager
|
||||
|
||||
ws_manager = AIUIControlWSManager()
|
||||
service_container.register("ai_ui_control_ws", ws_manager)
|
||||
print("[STARTUP] ai_ui_control WS manager registered in container", flush=True)
|
||||
logger.info("AI UI Control WebSocket manager registered")
|
||||
|
||||
async def on_deactivate(self, db, service_container, event_bus) -> None:
|
||||
|
||||
@@ -26,7 +26,7 @@ from app.plugins.builtins.ai_ui_control.schemas import (
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
router = APIRouter(tags=["ai-ui-control"])
|
||||
router = APIRouter(prefix="/api/v1/ai-ui-control", tags=["ai-ui-control"])
|
||||
|
||||
|
||||
# ─── REST endpoints (for AI agents) ───
|
||||
|
||||
Reference in New Issue
Block a user