Skip to content

Commit 10c33dc

Browse files
committed
Match upstream-error test to sanitized client messages
Core 7603cf7 (in v0.2.5) keeps transport failure detail out of client messages: the SSE error event now carries a generic upstream_error, and the status/body detail rides the Failed outcome to operator logs. The test asserted the old leaky behavior, which only survived this long because the lock pinned a pre-rebase observer-port commit that predated the change.
1 parent 801af9a commit 10c33dc

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/atuin_ai_server_test.exs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ defmodule AtuinAI.ServerTest do
169169
assert Plug.Conn.get_req_header(upstream_conn, "authorization") == []
170170
end
171171

172-
test "an upstream HTTP error fails the turn fast with the status and body", %{
172+
test "an upstream HTTP error fails the turn fast with a generic error event", %{
173173
server_port: port
174174
} do
175175
body =
@@ -193,8 +193,14 @@ defmodule AtuinAI.ServerTest do
193193
{:ok, {{_, 200, _}, _headers, response}} = Task.await(task, 5000)
194194
response = to_string(response)
195195

196-
assert response =~ "HTTP 404"
197-
assert response =~ "not found, try pulling it first"
196+
assert response =~ "event: error"
197+
assert response =~ ~s("code":"upstream_error")
198+
assert response =~ "LLM request failed, please retry"
199+
200+
# Since core v0.2.5 the upstream status and body are operator detail
201+
# (logged via the Failed outcome); they must not reach the client.
202+
refute response =~ "HTTP 404"
203+
refute response =~ "not found, try pulling it first"
198204
end
199205

200206
test "unknown model alias is a 400", %{server_port: port} do

0 commit comments

Comments
 (0)