Skip to content

Commit 1a2ec7f

Browse files
committed
type error
1 parent 75a4b8a commit 1a2ec7f

File tree

1 file changed

+4
-3
lines changed
  • packages/opencode/src/cli/cmd/tui/routes/session

1 file changed

+4
-3
lines changed

packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ export function Sidebar(props: { sessionID: string }) {
3232
const context = createMemo(() => {
3333
const list = messages() as TokenMessage[]
3434
const last: TokenMessage | undefined = list.findLast((msg) => msg.role === "assistant" && msg.tokens.output > 0)
35-
const model = last
36-
? sync.data.provider.find((item) => item.id === last.providerID)?.models[last.modelID]
37-
: undefined
35+
const model =
36+
last && last.providerID && last.modelID
37+
? sync.data.provider.find((item) => item.id === last.providerID)?.models[last.modelID]
38+
: undefined
3839
const summary = summarizeContext({
3940
messages: list,
4041
partsFor: (id) => sync.data.part[id] ?? [],

0 commit comments

Comments
 (0)