diff options
| author | Dax Raad <[email protected]> | 2026-04-01 11:08:46 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-04-01 11:09:29 -0400 |
| commit | d58004a864ee04a34a30fbbcdde9336d477fc8fa (patch) | |
| tree | 96f698cddcff29bd14de07d2d97f4db901895712 | |
| parent | 5fd833aa18d2cc71c977925c0646392a7f78ece2 (diff) | |
| download | opencode-d58004a864ee04a34a30fbbcdde9336d477fc8fa.tar.gz opencode-d58004a864ee04a34a30fbbcdde9336d477fc8fa.zip | |
fall back to first agent if last used agent is not available
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/context/local.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/context/local.tsx b/packages/opencode/src/cli/cmd/tui/context/local.tsx index e131df358..ec3931b20 100644 --- a/packages/opencode/src/cli/cmd/tui/context/local.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/local.tsx @@ -57,7 +57,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ return agents() }, current() { - return agents().find((x) => x.name === agentStore.current)! + return agents().find((x) => x.name === agentStore.current) ?? agents()[0] }, set(name: string) { if (!agents().some((x) => x.name === name)) |
