fix(session): accept routing params in message list (#26569)

Co-authored-by: Developer <temp@example.com>
This commit is contained in:
Kit Langton
2026-05-09 16:02:35 -04:00
committed by GitHub
parent ad79f3e0cf
commit 77da433e0a
2 changed files with 30 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
import { afterEach, describe, expect, test } from "bun:test"
import { Effect } from "effect"
import { Instance } from "../../src/project/instance"
import { WithInstance } from "../../src/project/with-instance"
import { Server } from "../../src/server/server"
import { Session as SessionNs } from "@/session/session"
@@ -165,4 +164,28 @@ describe("session messages endpoint", () => {
}),
)
})
test("accepts directory query used by workspace routing", async () => {
await using tmp = await tmpdir({ git: true })
await withoutWatcher(() =>
WithInstance.provide({
directory: tmp.path,
fn: async () => {
const session = await svc.create({})
await fill(session.id, 1)
const app = Server.Default().app
const res = await app.request(
`/session/${session.id}/message?limit=80&directory=${encodeURIComponent(tmp.path)}`,
)
expect(res.status).toBe(200)
const body = await res.json()
expect(Array.isArray(body)).toBe(true)
expect(body).toHaveLength(1)
await svc.remove(session.id)
},
}),
)
})
})