Remove OpenClaw provider wiring
All checks were successful
CI / test (push) Successful in 12s
Build and Deploy / build-and-deploy (push) Successful in 22s

This commit is contained in:
Grendgi
2026-06-08 13:48:32 +03:00
parent 12db90dc3b
commit e0f74c62b0
4 changed files with 1 additions and 67 deletions

View File

@@ -48,18 +48,9 @@ service.
- `LLM_MODEL`, default `qwen2.5-14b`
- `LLM_TIMEOUT`, default `5m`
- `WHISPERX_URL`, WhisperX endpoint for transcription jobs
- `OPENCLAW_URL`, optional OpenClaw gateway URL if we route through OpenClaw
instead of direct vLLM
## Next integration step
`telephony` should first mirror low-risk analysis jobs into this service while
continuing local processing. Remote execution can then be enabled by feature
flag per task type.
## OpenClaw note
Current Portal services call the local AI server directly: vLLM for LLM tasks
and WhisperX for transcription. OpenClaw is not required for the current
`ai-service` queue deployment. It becomes useful if we want centralized model
routing, provider fallback, request policy and cross-model gateway behavior.

View File

@@ -17,7 +17,6 @@ type Config struct {
LLMModel string
LLMTimeout time.Duration
WhisperXURL string
OpenClawURL string
}
func Load() Config {
@@ -32,7 +31,6 @@ func Load() Config {
LLMModel: envString("LLM_MODEL", "qwen2.5-14b"),
LLMTimeout: envDuration("LLM_TIMEOUT", 5*time.Minute),
WhisperXURL: envString("WHISPERX_URL", ""),
OpenClawURL: envString("OPENCLAW_URL", ""),
}
}

View File

@@ -34,7 +34,6 @@ func (s *Server) handleProviderStatus(w http.ResponseWriter, r *http.Request) {
Providers: []providerStatus{
s.checkLLM(ctx),
s.checkWhisperX(ctx),
s.checkOpenClaw(ctx),
},
}
writeJSON(w, http.StatusOK, resp)
@@ -102,58 +101,6 @@ func (s *Server) checkWhisperX(ctx context.Context) providerStatus {
return st
}
func (s *Server) checkOpenClaw(ctx context.Context) providerStatus {
baseURL := strings.TrimRight(strings.TrimSpace(s.cfg.OpenClawURL), "/")
st := providerStatus{Name: "openclaw", Configured: baseURL != "", URL: baseURL}
if !st.Configured {
return st
}
start := time.Now()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+"/healthz", nil)
if err != nil {
st.Error = err.Error()
return st
}
res, err := http.DefaultClient.Do(req)
st.LatencyMS = time.Since(start).Milliseconds()
if err != nil {
st.Error = err.Error()
return st
}
defer res.Body.Close()
if res.StatusCode == http.StatusNotFound {
return checkOpenClawHealth(ctx, baseURL, start)
}
if res.StatusCode >= 300 {
st.Error = fmt.Sprintf("http %d: %s", res.StatusCode, readSmallBody(res.Body))
return st
}
st.OK = true
return st
}
func checkOpenClawHealth(ctx context.Context, baseURL string, start time.Time) providerStatus {
st := providerStatus{Name: "openclaw", Configured: true, URL: baseURL}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+"/health", nil)
if err != nil {
st.Error = err.Error()
return st
}
res, err := http.DefaultClient.Do(req)
st.LatencyMS = time.Since(start).Milliseconds()
if err != nil {
st.Error = err.Error()
return st
}
defer res.Body.Close()
if res.StatusCode >= 300 {
st.Error = fmt.Sprintf("http %d: %s", res.StatusCode, readSmallBody(res.Body))
return st
}
st.OK = true
return st
}
func readSmallBody(r io.Reader) string {
body, err := io.ReadAll(io.LimitReader(r, 512))
if err != nil {

View File

@@ -7,10 +7,8 @@ data:
HTTP_HOST: "0.0.0.0"
HTTP_PORT: "8080"
MIGRATE_ON_START: "true"
# Default direct AI endpoints. OpenClaw can replace LLM_BASE_URL later when
# we decide to route model traffic through a gateway instead of direct vLLM.
# Direct AI endpoints on the local AI server.
LLM_BASE_URL: "http://10.2.3.5:8002"
LLM_MODEL: "qwen2.5-14b"
LLM_TIMEOUT: "5m"
WHISPERX_URL: "http://10.2.3.5:8001"
OPENCLAW_URL: ""