feat: implement workflow findings sharing for inter-agent communication in workflows

This commit is contained in:
asepharyana
2026-07-13 03:12:37 +07:00
parent dc0f1c7647
commit a080957c26
11 changed files with 154 additions and 65 deletions
+22 -4
View File
@@ -30,11 +30,13 @@ impl LlmClient {
/// Construct a client, falling back to built-in defaults for empty inputs.
///
/// Flow: empty api_key/model → substitute defaults → build reqwest client
/// with connect/request timeouts (falling back to an untimed client if
/// the builder fails) → normalize base_url.
/// with connect/request timeouts → if TLS config fails, retry with just
/// request timeout (no connect timeout) → normalize base_url.
///
/// Why: empty strings are treated as "unset" rather than errors so callers
/// can pass through unconfigured settings without special-casing them.
/// Timeouts are always enforced — the pure-default-client fallback is only
/// used as a last resort when even the no-connect-timeout build fails.
pub fn new(mut api_key: String, model: String, base_url: Option<String>) -> Self {
if api_key.is_empty() {
api_key = DEFAULT_API_KEY.to_string();
@@ -51,8 +53,24 @@ impl LlmClient {
{
Ok(c) => c,
Err(e) => {
tracing::warn!("warning: failed to build reqwest client with timeouts: {}. Using default client without timeouts.", e);
reqwest::blocking::Client::new()
tracing::warn!(
"failed to build reqwest client with connect timeout: {}. \
retrying without connect timeout",
e,
);
match reqwest::blocking::Client::builder()
.timeout(REQUEST_TIMEOUT)
.build()
{
Ok(c) => c,
Err(e2) => {
tracing::warn!(
"also failed: {}. using default client (no configured timeouts)",
e2,
);
reqwest::blocking::Client::new()
}
}
}
};
LlmClient {