MCPcopy Create free account
hub / github.com/codehamr/codehamr / pingBackend

Function pingBackend

internal/tui/model.go:1266–1272  ·  view source on GitHub ↗

pingBackend issues a short GET to baseURL/v1/models via cloud.Reachable. Any HTTP response counts as reachable; transport errors and timeouts mean disconnected. The result carries the URL it was issued against so Update can drop late results arriving after a /models switch.

(baseURL string)

Source from the content-addressed store, hash-verified

1264 return true
1265 }
1266 switch name {
1267 case tools.WriteFileName, tools.EditFileName:
1268 // write/edit report success as plain text ("wrote N bytes", "edited …")
1269 // and every error in parens, so a leading "(" is the failure signal.
1270 return strings.HasPrefix(t, "(")
1271 case tools.ReadFileName:
1272 // read_file returns the file's RAW content on success, which can
1273 // legitimately start with "(" (Lisp, S-expressions, a leading paren
1274 // expr). Match only its two real failure outputs so a successful read
1275 // isn't counted as a failure and made to feed the repeated-failure nudge.

Callers 2

InitMethod · 0.85
confirmActiveMethod · 0.85

Calls 1

ReachableFunction · 0.92

Tested by

no test coverage detected