repl: fallback patterns — add 'Could not connect to server' (CURLE_COULDNT_CONNECT)

Surfaced by autonomous run of TC #48: pointing models.fast at
http://localhost:9999 (port closed, host resolves) emits
"transport: Could not connect to server" — CURLE_COULDNT_CONNECT
(7) which the Phase 5 fallback pattern set didn't include.

Added "Could not connect to server" to FALLBACK_PATTERNS in repl.lua.
Now fallback fires for the full set of common libcurl/HTTP transport
failure shapes:

  HTTP 5xx              server-side
  HTTP 404 model_not_found
  HTTP 408              gateway request timeout
  Couldn't resolve host CURLE_COULDNT_RESOLVE_HOST
  Could not connect to server   CURLE_COULDNT_CONNECT  (← added)
  Connection refused
  Timeout was reached   CURLE_OPERATION_TIMEDOUT (variant A)
  Operation timed out   CURLE_OPERATION_TIMEDOUT (variant B)

Re-tested #48 end-to-end:
  fast pointed at dead port → fast fails → status fires →
  cloud (anthropic/claude-haiku-4.5 via openrouter) responds normally

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 11:49:13 +00:00
parent d72689f709
commit 8e0e735e15
+1
View File
@@ -325,6 +325,7 @@ function M.run(config)
"^HTTP 404.*model_not_found",
"^HTTP 408",
"Couldn'?t resolve host",
"Could not connect to server", -- CURLE_COULDNT_CONNECT (port closed, host resolved)
"Connection refused",
"Timeout was reached",
"Operation timed out",