diff --git a/scripts/deploy-ubuntu.sh b/scripts/deploy-ubuntu.sh index e592178..174b352 100755 --- a/scripts/deploy-ubuntu.sh +++ b/scripts/deploy-ubuntu.sh @@ -213,6 +213,7 @@ export OPENAI_API_KEY=$(printf "%q" "${api_key}") export OPENAI_BASE_URL=$(printf "%q" "${base_url}") export OPENAI_MODEL=$(printf "%q" "${model}") export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" +export CLAW_MODEL_IDLE_TIMEOUT_SECONDS="${CLAW_MODEL_IDLE_TIMEOUT_SECONDS:-60}" export CLAW_DEPLOY_INSTANCE=$(printf "%q" "${DEPLOY_INSTANCE}") export CLAW_BACKEND_HOST=$(printf "%q" "${backend_host}") @@ -264,6 +265,7 @@ ensure_env_file() { echo "OPENAI_BASE_URL=${OPENAI_BASE_URL:-}" echo "OPENAI_MODEL=${OPENAI_MODEL:-}" echo "OPENAI_TIMEOUT_SECONDS=${OPENAI_TIMEOUT_SECONDS:-3600}" + echo "CLAW_MODEL_IDLE_TIMEOUT_SECONDS=${CLAW_MODEL_IDLE_TIMEOUT_SECONDS:-60}" echo "CLAW_SERVICE_SCOPE=${SERVICE_SCOPE}" echo "CLAW_ENABLE_LINUX_ACCOUNTS=${CLAW_ENABLE_LINUX_ACCOUNTS:-0}" echo "OPENAI_API_KEY=已配置" diff --git a/scripts/start-backend.sh b/scripts/start-backend.sh index 28d9fd6..a573e19 100755 --- a/scripts/start-backend.sh +++ b/scripts/start-backend.sh @@ -20,7 +20,7 @@ export OPENAI_API_KEY export OPENAI_BASE_URL="${OPENAI_BASE_URL:-http://model.mify.ai.srv/v1}" export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}" export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" -export CLAW_MODEL_IDLE_TIMEOUT_SECONDS="${CLAW_MODEL_IDLE_TIMEOUT_SECONDS:-${OPENAI_TIMEOUT_SECONDS}}" +export CLAW_MODEL_IDLE_TIMEOUT_SECONDS="${CLAW_MODEL_IDLE_TIMEOUT_SECONDS:-60}" # 后端也会调用 Node 生态工具,例如 feishu-mcp-pro。systemd 不读取交互式 # shell 的 nvm 配置,所以需要把部署时记录的 Node 路径显式传给 Python 进程。 diff --git a/scripts/start-webui.sh b/scripts/start-webui.sh index cc9f9c2..4386894 100755 --- a/scripts/start-webui.sh +++ b/scripts/start-webui.sh @@ -142,6 +142,7 @@ export OPENAI_API_KEY="${OPENAI_API_KEY:-}" export OPENAI_BASE_URL="${OPENAI_BASE_URL:-http://model.mify.ai.srv/v1}" export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}" export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" +export CLAW_MODEL_IDLE_TIMEOUT_SECONDS="${CLAW_MODEL_IDLE_TIMEOUT_SECONDS:-60}" BACKEND_LOG="${RUN_DIR}/webui-backend.log" FRONTEND_LOG="${RUN_DIR}/webui-frontend.log" diff --git a/src/evaluation_runtime.py b/src/evaluation_runtime.py index 330edec..8f6897f 100644 --- a/src/evaluation_runtime.py +++ b/src/evaluation_runtime.py @@ -2936,6 +2936,9 @@ def transient_model_error_message(value: Any) -> str: 'connection reset by peer', 'connectionreseterror', 'broken pipe', + 'timed out', + 'timeouterror', + 'socket timeout', ) if any(marker in normalized for marker in transport_markers): return ( diff --git a/tests/test_evaluation_runtime.py b/tests/test_evaluation_runtime.py index 8f3e86d..4139c4a 100644 --- a/tests/test_evaluation_runtime.py +++ b/tests/test_evaluation_runtime.py @@ -392,6 +392,12 @@ class EvaluationRuntimeTests(unittest.TestCase): '响应流意外中断', transient_model_error_message('IncompleteRead(199 bytes read)'), ) + self.assertIn( + '响应流意外中断', + transient_model_error_message( + 'Unable to reach local model backend: timed out' + ), + ) def test_transient_model_failure_retries_before_validation(self) -> None: with tempfile.TemporaryDirectory() as directory: