1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
-- obs_trace_e2e.lua
--
-- Exercises bridge-level ab.obs logging without external dependencies:
-- - http.request to 127.0.0.1:1 (expected connection error)
-- - mcp.call against a missing server (expected ok=false)
-- HTTP: trigger request/response-side logging path (request always logs before send).
local http_ok, http_err = pcall(function()
return http.request("http://127.0.0.1:1", {
method = "GET",
timeout = 1,
})
end)
if http_ok then
-- Unexpected, but keep script green for log assertions.
print("http_unexpected_ok")
else
print("http_error_ok")
end
-- MCP: trigger mcp_call + mcp_result logs (ok=false for unknown server).
local mcp_res = mcp.call("missing", "noop", {})
if mcp_res.ok then
print("mcp_unexpected_ok")
else
print("mcp_error_ok")
end
-- Tool: trigger tool_register + tool_call + tool_result logs.
tool.register("obs_echo", {
description = "echo tool for obs e2e",
input_schema = {
type = "object",
properties = {
message = { type = "string" },
},
},
}, function(input)
return input.message
end)
local echoed = tool.call("obs_echo", { message = "ok" })
if echoed == "ok" then
print("tool_ok")
else
print("tool_unexpected")
end