记录 UI 编辑器重试中的请求错误
在结构化 LLM 请求的中间重试失败时写入尝试次数和错误日志。 保留原有重试次数、历史消息和最终错误语义。
This commit is contained in:
@@ -44,7 +44,15 @@ where
|
||||
for attempt in 0..=max_retries {
|
||||
let value = match requester(history.clone()).await {
|
||||
Ok(value) => value,
|
||||
Err(_error) if attempt < max_retries => continue,
|
||||
Err(error) if attempt < max_retries => {
|
||||
app_log!(
|
||||
"ui_editor.llm.retry request_error attempt={} max_retries={} error={}",
|
||||
attempt + 1,
|
||||
max_retries,
|
||||
error
|
||||
);
|
||||
continue;
|
||||
}
|
||||
Err(error) => return Err(error),
|
||||
};
|
||||
match validator(&value) {
|
||||
|
||||
Reference in New Issue
Block a user