fix(httpapi): expose v2 session not found

This commit is contained in:
Shoubhit Dash
2026-05-21 01:02:03 +05:30
parent 47029b8440
commit b4e7f11193
8 changed files with 140 additions and 30 deletions
@@ -675,22 +675,14 @@ const scenarios: Scenario[] = [
path: route("/api/session/{sessionID}/context", { sessionID: "ses_httpapi_missing" }),
headers: ctx.headers(),
}))
.json(200, array, "none"),
.json(404, object, "status"),
http.protected
.get("/api/session/{sessionID}/message", "v2.session.messages")
.at((ctx) => ({
path: route("/api/session/{sessionID}/message", { sessionID: "ses_httpapi_missing" }),
headers: ctx.headers(),
}))
.json(
200,
(body) => {
object(body)
array(body.items)
object(body.cursor)
},
"none",
),
.json(404, object, "status"),
http.protected
.get("/api/session/{sessionID}/message", "v2.session.messages.params")
.at((ctx) => ({
@@ -752,14 +744,14 @@ const scenarios: Scenario[] = [
path: route("/api/session/{sessionID}/compact", { sessionID: "ses_httpapi_missing" }),
headers: ctx.headers(),
}))
.status(204, undefined, "none"),
.status(404, undefined, "status"),
http.protected
.post("/api/session/{sessionID}/wait", "v2.session.wait")
.at((ctx) => ({
path: route("/api/session/{sessionID}/wait", { sessionID: "ses_httpapi_missing" }),
headers: ctx.headers(),
}))
.status(204, undefined, "none"),
.status(404, undefined, "status"),
http.protected
.get("/session", "session.list")
.seeded((ctx) => ctx.session({ title: "List me" }))