fix(httpapi): accept empty session create body (#24640)

This commit is contained in:
Kit Langton
2026-04-27 13:17:11 -04:00
committed by GitHub
parent dc6991e5a8
commit 55ecb06748
2 changed files with 27 additions and 3 deletions

View File

@@ -151,6 +151,14 @@ describe("session HttpApi", () => {
await using tmp = await tmpdir({ git: true, config: { formatter: false, lsp: false, share: "disabled" } })
const headers = { "x-opencode-directory": tmp.path, "content-type": "application/json" }
const createdEmpty = await json<Session.Info>(
await app().request(SessionPaths.create, {
method: "POST",
headers,
}),
)
expect(createdEmpty.id).toBeTruthy()
const created = await json<Session.Info>(
await app().request(SessionPaths.create, {
method: "POST",