fix(channel): prevent false timeout during multi-turn tool loops (#1037)
This commit is contained in:
parent
178bb108da
commit
f274fd5757
3 changed files with 45 additions and 6 deletions
|
|
@ -7,9 +7,9 @@ use serde::{Deserialize, Serialize};
|
|||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{OnceLock, RwLock};
|
||||
use tokio::fs::{self, OpenOptions};
|
||||
#[cfg(unix)]
|
||||
use tokio::fs::File;
|
||||
use tokio::fs::{self, OpenOptions};
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
const SUPPORTED_PROXY_SERVICE_KEYS: &[&str] = &[
|
||||
|
|
@ -2197,7 +2197,10 @@ pub struct ChannelsConfig {
|
|||
pub dingtalk: Option<DingTalkConfig>,
|
||||
/// QQ Official Bot channel configuration.
|
||||
pub qq: Option<QQConfig>,
|
||||
/// Timeout in seconds for processing a single channel message (LLM + tools).
|
||||
/// Base timeout in seconds for processing a single channel message (LLM + tools).
|
||||
/// Runtime uses this as a per-turn budget that scales with tool-loop depth
|
||||
/// (up to 4x, capped) so one slow/retried model call does not consume the
|
||||
/// entire conversation budget.
|
||||
/// Default: 300s for on-device LLMs (Ollama) which are slower than cloud APIs.
|
||||
#[serde(default = "default_channel_message_timeout_secs")]
|
||||
pub message_timeout_secs: u64,
|
||||
|
|
@ -3544,9 +3547,9 @@ async fn sync_directory(_path: &Path) -> Result<()> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::PathBuf;
|
||||
#[cfg(unix)]
|
||||
use std::{fs::Permissions, os::unix::fs::PermissionsExt};
|
||||
use std::path::PathBuf;
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
use tokio::test;
|
||||
use tokio_stream::wrappers::ReadDirStream;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue