fix: bound idle evaluation model streams

This commit is contained in:
wuyang6
2026-07-24 20:08:38 +08:00
parent 459bee47a7
commit 1e7570e72d
5 changed files with 13 additions and 1 deletions
+2
View File
@@ -213,6 +213,7 @@ export OPENAI_API_KEY=$(printf "%q" "${api_key}")
export OPENAI_BASE_URL=$(printf "%q" "${base_url}") export OPENAI_BASE_URL=$(printf "%q" "${base_url}")
export OPENAI_MODEL=$(printf "%q" "${model}") export OPENAI_MODEL=$(printf "%q" "${model}")
export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" 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_DEPLOY_INSTANCE=$(printf "%q" "${DEPLOY_INSTANCE}")
export CLAW_BACKEND_HOST=$(printf "%q" "${backend_host}") export CLAW_BACKEND_HOST=$(printf "%q" "${backend_host}")
@@ -264,6 +265,7 @@ ensure_env_file() {
echo "OPENAI_BASE_URL=${OPENAI_BASE_URL:-}" echo "OPENAI_BASE_URL=${OPENAI_BASE_URL:-}"
echo "OPENAI_MODEL=${OPENAI_MODEL:-}" echo "OPENAI_MODEL=${OPENAI_MODEL:-}"
echo "OPENAI_TIMEOUT_SECONDS=${OPENAI_TIMEOUT_SECONDS:-3600}" 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_SERVICE_SCOPE=${SERVICE_SCOPE}"
echo "CLAW_ENABLE_LINUX_ACCOUNTS=${CLAW_ENABLE_LINUX_ACCOUNTS:-0}" echo "CLAW_ENABLE_LINUX_ACCOUNTS=${CLAW_ENABLE_LINUX_ACCOUNTS:-0}"
echo "OPENAI_API_KEY=已配置" echo "OPENAI_API_KEY=已配置"
+1 -1
View File
@@ -20,7 +20,7 @@ export OPENAI_API_KEY
export OPENAI_BASE_URL="${OPENAI_BASE_URL:-http://model.mify.ai.srv/v1}" export OPENAI_BASE_URL="${OPENAI_BASE_URL:-http://model.mify.ai.srv/v1}"
export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}" export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}"
export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" 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 不读取交互式 # 后端也会调用 Node 生态工具,例如 feishu-mcp-pro。systemd 不读取交互式
# shell 的 nvm 配置,所以需要把部署时记录的 Node 路径显式传给 Python 进程。 # shell 的 nvm 配置,所以需要把部署时记录的 Node 路径显式传给 Python 进程。
+1
View File
@@ -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_BASE_URL="${OPENAI_BASE_URL:-http://model.mify.ai.srv/v1}"
export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}" export OPENAI_MODEL="${OPENAI_MODEL:-tongyi/deepseek-v4-pro}"
export OPENAI_TIMEOUT_SECONDS="${OPENAI_TIMEOUT_SECONDS:-3600}" 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" BACKEND_LOG="${RUN_DIR}/webui-backend.log"
FRONTEND_LOG="${RUN_DIR}/webui-frontend.log" FRONTEND_LOG="${RUN_DIR}/webui-frontend.log"
+3
View File
@@ -2936,6 +2936,9 @@ def transient_model_error_message(value: Any) -> str:
'connection reset by peer', 'connection reset by peer',
'connectionreseterror', 'connectionreseterror',
'broken pipe', 'broken pipe',
'timed out',
'timeouterror',
'socket timeout',
) )
if any(marker in normalized for marker in transport_markers): if any(marker in normalized for marker in transport_markers):
return ( return (
+6
View File
@@ -392,6 +392,12 @@ class EvaluationRuntimeTests(unittest.TestCase):
'响应流意外中断', '响应流意外中断',
transient_model_error_message('IncompleteRead(199 bytes read)'), 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: def test_transient_model_failure_retries_before_validation(self) -> None:
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory: