fix: type errors

This commit is contained in:
Tomasz Stefaniak 2025-05-21 12:53:33 -07:00
parent 17a249c1ce
commit cd82f4c61f
2 changed files with 4 additions and 3 deletions

View file

@ -122,6 +122,7 @@ export async function* streamDiffLines({
(msg) => msg.role === "user" || msg.role === "tool",
) as UserChatMessage | ToolResultChatMessage | undefined),
baseSystemMessage: undefined,
contextItems: [],
})
: undefined;

View file

@ -84,8 +84,8 @@ ${EDIT_MESSAGE}
function getUserContextItems(
userMsg: UserChatMessage | ToolResultChatMessage | undefined,
history: ChatHistoryItem[],
): ContextItemWithId[] | undefined {
if (!userMsg) return undefined;
): ContextItemWithId[] {
if (!userMsg) return [];
// Find the history item that contains the userMsg
const historyItem = history.find((item) => {
@ -100,7 +100,7 @@ function getUserContextItems(
);
});
return historyItem?.contextItems;
return historyItem?.contextItems || [];
}
export function constructMessages(