The dashboard chat handlers write raw Go and gRPC error strings straight to the browser: http.Error(w, err.Error(), ...) on the chat endpoints and the SSE error frame written when opening the stream fails. The gateway now maps provider failures to plain wording; these endpoints should do the same, plain message to the browser, cause in the server log.
The dashboard chat handlers write raw Go and gRPC error strings straight to the browser: http.Error(w, err.Error(), ...) on the chat endpoints and the SSE error frame written when opening the stream fails. The gateway now maps provider failures to plain wording; these endpoints should do the same, plain message to the browser, cause in the server log.
internal/webui/chat.go: every http.Error that could carry internals (the chat 500s, update Check/Install 502s, Defer 409) now goes through a small failChat helper, which logs the real cause with the injected logger's ErrorContext and answers with the plain sentence "something went wrong on Archie's side. Try again; the server log has the cause." (same wording pattern as the gateway's turn failure mapping, duplicated locally because webui must not import the gateway package). The SSE stream-open failure frame sends that plain text too. Safe messages kept as-is: the 400 validation strings, the 404, the static 501s. The update-check writer used by the version endpoint (not a chat endpoint) is untouched.
internal/webui/chat_errors_test.go (new): table-driven tests with a contract fake whose error embeds internal details (a SQL fragment, a gRPC status, a server path). They assert the response body and the SSE error frame contain none of those details, do contain the plain sentence, and that the real error reaches the server log. Also locks the kept 400 messages and the 501. Verified the tests fail against the old handlers.
Commands run and results:
go test -short ./internal/webui/... -> ok
golangci-lint run ./internal/webui/... -> 0 issues
task check from the worktree root on the exact committed tree -> exit 0 (fmt, proto:check, db:check, vet, lint, build, go test ./..., pnpm test, vue-tsc typecheck)
Sanitised dashboard chat error responses.
Changed files:
- internal/webui/chat.go: every http.Error that could carry internals (the chat 500s, update Check/Install 502s, Defer 409) now goes through a small failChat helper, which logs the real cause with the injected logger's ErrorContext and answers with the plain sentence "something went wrong on Archie's side. Try again; the server log has the cause." (same wording pattern as the gateway's turn failure mapping, duplicated locally because webui must not import the gateway package). The SSE stream-open failure frame sends that plain text too. Safe messages kept as-is: the 400 validation strings, the 404, the static 501s. The update-check writer used by the version endpoint (not a chat endpoint) is untouched.
- internal/webui/chat_errors_test.go (new): table-driven tests with a contract fake whose error embeds internal details (a SQL fragment, a gRPC status, a server path). They assert the response body and the SSE error frame contain none of those details, do contain the plain sentence, and that the real error reaches the server log. Also locks the kept 400 messages and the 501. Verified the tests fail against the old handlers.
Commands run and results:
- go test -short ./internal/webui/... -> ok
- golangci-lint run ./internal/webui/... -> 0 issues
- task check from the worktree root on the exact committed tree -> exit 0 (fmt, proto:check, db:check, vet, lint, build, go test ./..., pnpm test, vue-tsc typecheck)
PR: https://git.catlow.cloud/sam/archie/pulls/1909
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The dashboard chat handlers write raw Go and gRPC error strings straight to the browser: http.Error(w, err.Error(), ...) on the chat endpoints and the SSE error frame written when opening the stream fails. The gateway now maps provider failures to plain wording; these endpoints should do the same, plain message to the browser, cause in the server log.
Sanitised dashboard chat error responses.
Changed files:
Commands run and results:
PR: #1909
Closed upon merge of #1909