huskies: merge 1143 story Decouple LLM environmental awareness from chat transport — persona-keyed sessions and a real-time event subscription

This commit is contained in:
dave
2026-05-18 16:47:31 +00:00
parent e58ff4465a
commit fb4e52dd09
15 changed files with 281 additions and 77 deletions
+10
View File
@@ -86,6 +86,14 @@ pub async fn ws_handler(ws: WebSocket, ctx: Data<&Arc<AppContext>>) -> impl poem
ws::subscribe_status(tx.clone(), ctx.services.status.subscribe());
}
// Subscribe to real-time pipeline-transition events for this persona.
// Events that arrived while no client was connected are caught up by
// assemble_prompt_context at turn time.
ws::subscribe_persona_pipeline_events(
tx.clone(),
ctx.services.bot_name.to_lowercase(),
);
// Map of pending permission request_id -> oneshot responder.
let mut pending_perms: HashMap<String, oneshot::Sender<PermissionDecision>> =
HashMap::new();
@@ -109,9 +117,11 @@ pub async fn ws_handler(ws: WebSocket, ctx: Data<&Arc<AppContext>>) -> impl poem
let tx_activity = tx.clone();
let ctx_clone = ctx.clone();
let persona = ctx_clone.services.bot_name.to_lowercase();
let chat_fut = chat::chat(
messages,
config,
&persona,
&ctx_clone.state,
ctx_clone.store.as_ref(),
move |history| {