feat(core): expose session switching endpoints

This commit is contained in:
Dax Raad 2026-06-21 23:59:01 -04:00
commit 35b3fc85d0
7 changed files with 283 additions and 4 deletions

View file

@ -955,6 +955,24 @@ const scenarios: Scenario[] = [
headers: ctx.headers(),
}))
.json(200, data(object)),
http.protected
.post("/api/session/{sessionID}/agent", "v2.session.switchAgent")
.seeded((ctx) => ctx.session({ title: "Switch agent" }))
.at((ctx) => ({
path: route("/api/session/{sessionID}/agent", { sessionID: ctx.state.id }),
headers: { ...ctx.headers(), "content-type": "application/json" },
body: { agent: "plan" },
}))
.status(204, undefined, "none"),
http.protected
.post("/api/session/{sessionID}/model", "v2.session.switchModel")
.seeded((ctx) => ctx.session({ title: "Switch model" }))
.at((ctx) => ({
path: route("/api/session/{sessionID}/model", { sessionID: ctx.state.id }),
headers: { ...ctx.headers(), "content-type": "application/json" },
body: { model: { providerID: "opencode", id: "big-pickle" } },
}))
.status(204, undefined, "none"),
http.protected
.get("/api/session/{sessionID}/context", "v2.session.context")
.at((ctx) => ({