a digital entity named phi that roams bsky phi.zzstoatzz.io
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

add /api/control/explore endpoint to trigger exploration on demand

Same pattern as /api/control/post — bearer-token auth, grabs the
poller's handler, dispatches explore() as a background task. Lets
the operator trigger an exploration run without waiting for the next
scheduled window or running code locally.

zzstoatzz e3e9ced4 1dad5d62

+14 -1
+1 -1
loq.toml
··· 21 21 22 22 [[rules]] 23 23 path = "src/bot/main.py" 24 - max_lines = 811 24 + max_lines = 813
+13
src/bot/main.py
··· 389 389 return {"triggered": True} 390 390 391 391 392 + @app.post("/api/control/explore") 393 + async def trigger_explore(request: Request, background_tasks: BackgroundTasks): 394 + """Trigger one exploration from the curiosity queue immediately.""" 395 + if err := _check_control_token(request): 396 + return err 397 + poller: NotificationPoller | None = getattr(app.state, "poller", None) 398 + if not poller: 399 + return JSONResponse({"error": "poller not available"}, status_code=503) 400 + background_tasks.add_task(poller.handler.explore) 401 + logger.info("exploration triggered via API") 402 + return {"triggered": True} 403 + 404 + 392 405 @app.get("/status", response_class=HTMLResponse) 393 406 async def status_page(): 394 407 """Status page."""