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 dbgWritef("nudge", "finish re-grounding nudge injected at %d tool calls this turn", m.toolRounds)
1265 m.history = append(m.history, chmctx.Message{
1266 Role: chmctx.RoleSystem,
1267 Content: nudgeOrigin + "Before you finish: re-read the original request and walk its acceptance criteria one at a time. For each, name the check you actually ran and what it showed. Anything runnable you built or changed is proven only by running it - build or type-check it, run the test, execute the script, or for a page or UI load it in a headless browser and drive the primary interaction (click Start, press the keys, submit the form) and confirm the state changed - then fix what breaks and re-run. If a check seems to need a runtime or browser this environment lacks, prove the lack with one read-only probe (`command -v node`, `command -v chromium chromium-browser google-chrome`, `ls ~/.cache/ms-playwright`) instead of assuming; the fire-once browser install your instructions allow is the ONE install worth attempting, and only if you haven't tried it this turn - never re-try a failed install or hunt missing libs, and if the probe comes up empty with no network, stop hunting. Only then mark the check `unverified: <what> - <why>` and lead your summary with it, not with a confident \"works\"; never dress up a static check (a brace count, a grep, an HTTP 200) as proof, and never report a check you didn't run. Then reply with your one-line summary.",
1268 })
1269 return true
1270}
1271
1272// cursorOnFirstLine: true when ↑ should walk prompt history instead of moving
1273// the textarea's own cursor. cursorOnLastLine is the mirror for ↓.
1274func (m Model) cursorOnFirstLine() bool { return m.ta.Line() == 0 }
1275func (m Model) cursorOnLastLine() bool { return m.ta.Line() == m.ta.LineCount()-1 }

Callers 2

InitMethod · 0.85
confirmActiveMethod · 0.85

Calls 1

ReachableFunction · 0.92

Tested by

no test coverage detected