Fix TypeScript compilation errors in native mode session management
Some checks failed
Release Binaries / release (push) Has been cancelled
Some checks failed
Release Binaries / release (push) Has been cancelled
This commit is contained in:
@@ -846,8 +846,8 @@ async function fetchAgents(instanceId: string): Promise<void> {
|
||||
mode: "native"
|
||||
}]
|
||||
} else {
|
||||
const response = await instance.client!.agents.list()
|
||||
agentList = (response.data || []).map((agent) => ({
|
||||
const response = await instance.client!.app.agents()
|
||||
agentList = (response.data || []).map((agent: any) => ({
|
||||
name: agent.name,
|
||||
description: agent.description || "",
|
||||
mode: agent.mode as "standard" | "subagent",
|
||||
@@ -1006,7 +1006,7 @@ async function loadMessages(instanceId: string, sessionId: string, force = false
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
const response = await instance.client!.session.getMessages({ path: { id: sessionId } })
|
||||
const response = await instance.client!.session.messages({ path: { id: sessionId } })
|
||||
if (!response.data || !Array.isArray(response.data)) {
|
||||
return
|
||||
}
|
||||
@@ -1041,8 +1041,8 @@ async function loadMessages(instanceId: string, sessionId: string, force = false
|
||||
let providerID = ""
|
||||
let modelID = ""
|
||||
|
||||
for (let i = response.data.length - 1; i >= 0; i--) {
|
||||
const apiMessage = response.data[i]
|
||||
for (let i = apiMessages.length - 1; i >= 0; i--) {
|
||||
const apiMessage = apiMessages[i]
|
||||
const info = apiMessage.info || apiMessage
|
||||
|
||||
if (info.role === "assistant") {
|
||||
@@ -1053,6 +1053,7 @@ async function loadMessages(instanceId: string, sessionId: string, force = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!agentName && !providerID && !modelID) {
|
||||
const defaultModel = await getDefaultModel(instanceId, session.agent)
|
||||
agentName = session.agent
|
||||
|
||||
Reference in New Issue
Block a user