Content-Length: 945 | pFad | http://github.com/hecrj/icebreaker/commit/49cf60efb9ec9fbf597828e2e2d51f550461a9b8.diff
71 diff --git a/core/src/plan.rs b/core/src/plan.rs index 0817afa..7ab25a4 100644 --- a/core/src/plan.rs +++ b/core/src/plan.rs @@ -86,7 +86,23 @@ impl Plan { return Ok(()); }; - let plan = design(assistant, history).run(&progress).await?; + let plan = { + let mut attempt = 0; + + loop { + log::info!("Designing plan ({attempt})..."); + + match design(assistant, history).run(&progress).await { + Err(error) if attempt < 3 => { + log::warn!("Plan design failed: {error}"); + } + result => break result?, + } + + attempt += 1; + } + }; + progress.send(Event::Designed(plan.clone())).await; execute(assistant, history, query, &plan)Fetched URL: http://github.com/hecrj/icebreaker/commit/49cf60efb9ec9fbf597828e2e2d51f550461a9b8.diff
Alternative Proxies: