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
commit 55ecb06748
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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",