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:
@@ -66,6 +66,15 @@ pub fn log_transition_event(fired: &crate::pipeline_state::TransitionFired) {
|
||||
to_stage,
|
||||
pipeline_event,
|
||||
);
|
||||
|
||||
// Real-time push to per-persona WebSocket subscribers.
|
||||
crate::pipeline_event_bus::broadcast(crate::pipeline_event_bus::BusEvent {
|
||||
sled_id,
|
||||
story_id: fired.story_id.0.clone(),
|
||||
from_stage: crate::pipeline_state::stage_label(&fired.before).to_string(),
|
||||
to_stage: crate::pipeline_state::stage_label(&fired.after).to_string(),
|
||||
pipeline_event: crate::pipeline_state::event_label(&fired.event).to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
/// Read all persisted events from the CRDT event log.
|
||||
@@ -121,6 +130,7 @@ pub fn spawn_event_log_subscriber() {
|
||||
loop {
|
||||
match rx.recv().await {
|
||||
Ok(fired) => {
|
||||
// log_transition_event also broadcasts to the pipeline_event_bus.
|
||||
log_transition_event(&fired);
|
||||
next_logical_seq += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user