feat(session): filter v2 session list by parent (#35037)

Co-authored-by: Dax <mail@thdxr.com>
This commit is contained in:
opencode-agent[bot]
2026-07-02 19:48:49 -04:00
committed by GitHub
co-authored by Dax
parent 7ebd344fa2
commit 6555df912a
17 changed files with 180 additions and 21 deletions
+2 -2
View File
@@ -247,7 +247,7 @@ test("session methods use the public HTTP contract", async () => {
},
})
const page = await client.session.list({ limit: 10, order: "desc" })
const page = await client.session.list({ limit: 10, order: "desc", parentID: null })
const active = await client.session.active()
const created = await client.session.create({ location: { directory: "/tmp/project" } })
await client.session.switchAgent({ sessionID: "ses_test", agent: "build" })
@@ -276,7 +276,7 @@ test("session methods use the public HTTP contract", async () => {
expect(log).toEqual([modelSwitchedEvent, caughtUp])
expect(message).toEqual(modelSwitchedMessage)
expect(requests.map((request) => [request.init?.method, request.url])).toEqual([
["GET", "http://localhost:3000/api/session?limit=10&order=desc"],
["GET", "http://localhost:3000/api/session?limit=10&order=desc&parentID=null"],
["GET", "http://localhost:3000/api/session/active"],
["POST", "http://localhost:3000/api/session"],
["POST", "http://localhost:3000/api/session/ses_test/agent"],