mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 05:20:02 +00:00
fix(ai): retry and diagnose transient provider failures
This commit is contained in:
@@ -608,6 +608,19 @@ pub async fn run_agent_loop(
|
||||
final_text.push_str(&message);
|
||||
}
|
||||
LoopExit::Interrupted(error) => {
|
||||
// The retry layer records the HTTP-level cause; this records the
|
||||
// agent-level exit so a failure still leaves a trace even after the
|
||||
// user dismisses the on-screen message. Cancellation has its own arm
|
||||
// above and never reaches here. The error is re-scrubbed here so a
|
||||
// credential cannot reach the log file even if a provider echo slipped
|
||||
// past the source-side redaction.
|
||||
let error = ai::redact_secrets(&error, &ai::sensitive_values(config));
|
||||
log::warn!(
|
||||
"[agent] stream interrupted; provider={:?} model={} agent_mode={} error={error}",
|
||||
config.provider,
|
||||
config.model,
|
||||
is_agent_mode
|
||||
);
|
||||
let message = if final_text.trim().is_empty() {
|
||||
format!("Agent stream stopped before completion: {error}.")
|
||||
} else {
|
||||
|
||||
+1144
-134
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user