feat(tui): add mini agent switching (#38287)

Fixes #36121
This commit is contained in:
Simon Klee 2026-07-22 13:14:10 +02:00 committed by GitHub
commit a3e2cc0dcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 268 additions and 33 deletions

View file

@ -62,6 +62,7 @@ describe("run interactive runtime", () => {
variants: ["low", "high"],
})
let lifecycle!: LifecycleInput
let turnAgent: string | undefined
let turnModel: { providerID: string; modelID: string } | undefined
let refreshCatalog: (() => Promise<unknown>) | undefined
stubCatalogLists(sdk, {
@ -107,6 +108,7 @@ describe("run interactive runtime", () => {
catalogLoaded.resolve()
return {
runPromptTurn: async (input) => {
turnAgent = input.agent
turnModel = input.model
api.close()
},
@ -139,8 +141,10 @@ describe("run interactive runtime", () => {
selection: { providerID: "test", modelID: "resolved" },
})
expect(lifecycle.onCycleVariant?.()).toMatchObject({ status: "variant low", variant: "low" })
lifecycle.onAgentSelect?.("review")
ui.submit("hello")
while (!turnModel) await Bun.sleep(0)
expect(turnAgent).toBe("review")
expect(turnModel).toEqual({ providerID: "test", modelID: "resolved" })
await task
})