feat(config): align LLM timeout/retry SLA with FastGPT client (60s/3)

Replaces the unequal SLA (LLM 30s/2 retries vs FastGPT client 60s/3)
that made the LangGraph backend look less stable under gray release.

- core/fastgpt_client: FASTGPT_TIMEOUT_SECONDS / FASTGPT_MAX_RETRIES
  module constants (were inline literals in lifespan)
- agent/llm: OpenAILLMService defaults 60.0s / 3 retries
- core/config: named-profile fallback defaults 60/3 (prefixed and
  JSON-dict forms)
- contract test test/backends/test_sla_alignment.py pins both sides to
  the same constants so the SLA cannot drift apart again
- retry backoff intentionally differs (FastGPT fixed 1s vs LLM
  exponential) and is documented; aligned parameters are per-call
  timeout and max retry count

Verified: 215 unit tests (3 new SLA contract tests)
This commit is contained in:
Eric Wang
2026-10-22 22:31:28 +08:00
parent ca73b1e8c5
commit 833725d8a3
5 changed files with 60 additions and 8 deletions
+2 -2
View File
@@ -100,8 +100,8 @@ class OpenAILLMService:
model: str,
api_key: str,
base_url: str = "",
timeout_seconds: float = 30.0,
max_retries: int = 2,
timeout_seconds: float = 60.0,
max_retries: int = 3,
temperature: float | None = None,
extra_body: dict | None = None,
):