MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / notify_text_complete

Function notify_text_complete

crates/opencode-session/src/llm.rs:1523–1532  ·  view source on GitHub ↗

Trigger the TextComplete plugin hook after stream collection. Call this after `collect_stream` when you have the final text.

(session_id: &str, text: &str)

Source from the content-addressed store, hash-verified

1521/// Trigger the TextComplete plugin hook after stream collection.
1522/// Call this after `collect_stream` when you have the final text.
1523pub async fn notify_text_complete(session_id: &str, text: &str) {
1524 if !text.is_empty() {
1525 let _ = opencode_plugin::trigger_collect(
1526 HookContext::new(HookEvent::TextComplete)
1527 .with_session(session_id)
1528 .with_data("text", serde_json::json!(text)),
1529 )
1530 .await;
1531 }
1532}
1533
1534pub fn to_model_messages(messages: &[MessageWithParts]) -> Vec<Message> {
1535 messages

Callers

nothing calls this directly

Calls 5

trigger_collectFunction · 0.85
newFunction · 0.85
is_emptyMethod · 0.80
with_dataMethod · 0.80
with_sessionMethod · 0.80

Tested by

no test coverage detected