Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function DialogAgent() {
return (
<DialogSelect
title="Select agent"
current={local.agent.current().name}
current={local.agent.current()?.name}
options={options()}
onSelect={(option) => {
local.agent.set(option.value)
Expand Down
12 changes: 6 additions & 6 deletions packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export function Prompt(props: PromptProps) {
if (store.mode === "shell") {
sdk.client.session.shell({
sessionID,
agent: local.agent.current().name,
agent: local.agent.current()?.name ?? "build",
model: {
providerID: selectedModel.providerID,
modelID: selectedModel.modelID,
Expand All @@ -552,7 +552,7 @@ export function Prompt(props: PromptProps) {
sessionID,
command: command.slice(1),
arguments: args.join(" "),
agent: local.agent.current().name,
agent: local.agent.current()?.name ?? "build",
model: `${selectedModel.providerID}/${selectedModel.modelID}`,
messageID,
variant,
Expand All @@ -569,7 +569,7 @@ export function Prompt(props: PromptProps) {
sessionID,
...selectedModel,
messageID,
agent: local.agent.current().name,
agent: local.agent.current()?.name ?? "build",
model: selectedModel,
variant,
parts: [
Expand Down Expand Up @@ -690,7 +690,7 @@ export function Prompt(props: PromptProps) {
const highlight = createMemo(() => {
if (keybind.leader) return theme.border
if (store.mode === "shell") return theme.primary
return local.agent.color(local.agent.current().name)
return local.agent.color(local.agent.current()?.name ?? "build")
})

const showVariant = createMemo(() => {
Expand All @@ -701,7 +701,7 @@ export function Prompt(props: PromptProps) {
})

const spinnerDef = createMemo(() => {
const color = local.agent.color(local.agent.current().name)
const color = local.agent.color(local.agent.current()?.name ?? "build")
return {
frames: createFrames({
color,
Expand Down Expand Up @@ -935,7 +935,7 @@ export function Prompt(props: PromptProps) {
/>
<box flexDirection="row" flexShrink={0} paddingTop={1} gap={1}>
<text fg={highlight()}>
{store.mode === "shell" ? "Shell" : Locale.titlecase(local.agent.current().name)}{" "}
{store.mode === "shell" ? "Shell" : Locale.titlecase(local.agent.current()?.name ?? "build")}{" "}
</text>
<Show when={store.mode === "normal"}>
<box flexDirection="row" gap={1}>
Expand Down