feat: surface llm retry and continuation state

This commit is contained in:
2026-05-26 07:13:59 +09:00
parent 41402c0951
commit be753099ae
20 changed files with 626 additions and 245 deletions
+23
View File
@@ -330,6 +330,29 @@ fn wire_event_bridges_on_worker<C, St>(
let _ = tx.send(Event::LlmCallEnd { llm_call });
});
let tx = event_tx.clone();
worker.on_llm_retry(move |llm_call, notice| {
let _ = tx.send(Event::LlmRetry {
llm_call,
failed_attempt: notice.failed_attempt,
max_attempts: notice.max_attempts,
wait_ms: notice.wait.as_millis() as u64,
elapsed_ms: notice.elapsed.as_millis() as u64,
status: notice.status,
error: notice.error.clone(),
});
});
let tx = event_tx.clone();
worker.on_llm_continuation(move |llm_call, attempt, max_attempts, reason| {
let _ = tx.send(Event::LlmContinuation {
llm_call,
attempt,
max_attempts,
reason: reason.to_owned(),
});
});
let tx = event_tx.clone();
let activity = ai_activity.clone();
worker.on_text_block(move |block| {
+1
View File
@@ -101,6 +101,7 @@ impl LlmClient for MockClient {
status: Some(500),
code: Some("mock".into()),
message: "No more responses".into(),
retry_after: None,
});
}
let response = self.responses[count].clone();