Put in a recent project picker

This commit is contained in:
Dave
2026-02-16 18:57:39 +00:00
parent 539cbba409
commit ffab287d16
9 changed files with 1334 additions and 1116 deletions

View File

@@ -6,6 +6,7 @@ use poem::handler;
use poem::web::Data;
use poem::web::websocket::{Message as WsMessage, WebSocket};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::sync::mpsc;
#[derive(Deserialize)]
@@ -39,7 +40,7 @@ enum WsResponse {
/// WebSocket endpoint for streaming chat responses and cancellation.
///
/// Accepts JSON `WsRequest` messages and streams `WsResponse` messages.
pub async fn ws_handler(ws: WebSocket, ctx: Data<&AppContext>) -> impl poem::IntoResponse {
pub async fn ws_handler(ws: WebSocket, ctx: Data<&Arc<AppContext>>) -> impl poem::IntoResponse {
let ctx = ctx.0.clone();
ws.on_upgrade(move |socket| async move {
let (mut sink, mut stream) = socket.split();