Cancel a running session
(session_id: str)
| 130 | |
| 131 | @app.post("/api/cancel/{session_id}") |
| 132 | async def cancel_session(session_id: str): |
| 133 | """Cancel a running session""" |
| 134 | try: |
| 135 | cancelled = await session_manager.cancel_session(session_id) |
| 136 | if cancelled: |
| 137 | return {"message": f"Session {session_id[:8]} cancellation requested", "cancelled": True} |
| 138 | else: |
| 139 | return {"message": f"Session {session_id[:8]} is not running", "cancelled": False} |
| 140 | except Exception as e: |
| 141 | logger.error(f"Error cancelling session {session_id}: {e}") |
| 142 | raise HTTPException(status_code=500, detail=str(e)) |
| 143 | |
| 144 | |
| 145 | @app.post("/api/chat", response_model=ChatResponse) |
nothing calls this directly
no test coverage detected