test(e2e): solve_grid over real MCP stdio with fake LLM

This commit is contained in:
2026-06-07 13:32:32 +01:00
parent 4c433e343f
commit a1f2b99935
3 changed files with 119 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
//go:build e2e
package e2e
import (
"io"
"net/http"
"net/http/httptest"
)
// startFakeLLM returns an OpenAI-compatible endpoint that always selects tiles 0,1,2.
func startFakeLLM() *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/v1/chat/completions":
_, _ = io.WriteString(w, `{"choices":[{"message":{"content":"{\"tiles\":[0,1,2],\"confidence\":0.95,\"recheck_recommended\":false}"}}]}`)
case "/v1/audio/transcriptions":
_, _ = io.WriteString(w, `{"text":"fortytwo"}`)
default:
http.NotFound(w, r)
}
}))
}