story-kit: merge 266_story_matrix_bot_structured_conversation_history
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,6 +26,7 @@ frontend/node_modules
|
|||||||
frontend/dist
|
frontend/dist
|
||||||
frontend/dist-ssr
|
frontend/dist-ssr
|
||||||
frontend/test-results
|
frontend/test-results
|
||||||
|
frontend/serve
|
||||||
frontend/*.local
|
frontend/*.local
|
||||||
server/target
|
server/target
|
||||||
|
|
||||||
|
|||||||
@@ -818,6 +818,20 @@ async fn handle_message(
|
|||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
sent_ids.lock().await.insert(resp.event_id);
|
sent_ids.lock().await.insert(resp.event_id);
|
||||||
|
let result = provider
|
||||||
|
.chat_stream(
|
||||||
|
&prompt,
|
||||||
|
&ctx.project_root.to_string_lossy(),
|
||||||
|
resume_session_id.as_deref(),
|
||||||
|
&mut cancel_rx,
|
||||||
|
move |token| {
|
||||||
|
let mut buf = buffer_for_callback.lock().unwrap();
|
||||||
|
buf.push_str(token);
|
||||||
|
// Flush complete paragraphs as they arrive.
|
||||||
|
let paragraphs = drain_complete_paragraphs(&mut buf);
|
||||||
|
for chunk in paragraphs {
|
||||||
|
sent_any_chunk_for_callback.store(true, Ordering::Relaxed);
|
||||||
|
let _ = msg_tx_for_callback.send(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the MCP oneshot sender so the event handler can
|
// Store the MCP oneshot sender so the event handler can
|
||||||
|
|||||||
Reference in New Issue
Block a user