tui: fix agent cycling and prompt metadata polish (#23115)

This commit is contained in:
Kit Langton
2026-04-17 12:45:29 -04:00
committed by GitHub
parent c491161c0c
commit 13dfe569ef
4 changed files with 24 additions and 12 deletions

View File

@@ -75,7 +75,9 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
},
move(direction: 1 | -1) {
batch(() => {
let next = agents().findIndex((x) => x.name === agentStore.current) + direction
const current = this.current()
if (!current) return
let next = agents().findIndex((x) => x.name === current.name) + direction
if (next < 0) next = agents().length - 1
if (next >= agents().length) next = 0
const value = agents()[next]