|
|
@@ -322,9 +322,9 @@ export namespace Session {
|
|
|
for (const child of await children(sessionID)) {
|
|
|
await remove(child.id, false)
|
|
|
}
|
|
|
- await unshare(sessionID).catch(() => { })
|
|
|
- await Storage.remove(`session/info/${sessionID}`).catch(() => { })
|
|
|
- await Storage.removeDir(`session/message/${sessionID}/`).catch(() => { })
|
|
|
+ await unshare(sessionID).catch(() => {})
|
|
|
+ await Storage.remove(`session/info/${sessionID}`).catch(() => {})
|
|
|
+ await Storage.removeDir(`session/message/${sessionID}/`).catch(() => {})
|
|
|
state().sessions.delete(sessionID)
|
|
|
state().messages.delete(sessionID)
|
|
|
if (emitEvent) {
|
|
|
@@ -523,7 +523,7 @@ export namespace Session {
|
|
|
sessionID: input.sessionID,
|
|
|
abort: new AbortController().signal,
|
|
|
messageID: userMsg.id,
|
|
|
- metadata: async () => { },
|
|
|
+ metadata: async () => {},
|
|
|
}),
|
|
|
)
|
|
|
return [
|
|
|
@@ -632,7 +632,7 @@ export namespace Session {
|
|
|
|
|
|
// mark session as updated
|
|
|
// used for session list sorting (indicates when session was most recently interacted with)
|
|
|
- await update(input.sessionID, (_draft) => { })
|
|
|
+ await update(input.sessionID, (_draft) => {})
|
|
|
|
|
|
if (isLocked(input.sessionID)) {
|
|
|
return new Promise((resolve) => {
|
|
|
@@ -679,7 +679,9 @@ export namespace Session {
|
|
|
generateText({
|
|
|
maxOutputTokens: small.info.reasoning ? 1024 : 20,
|
|
|
providerOptions: {
|
|
|
- [input.providerID]: small.info.options,
|
|
|
+ [input.providerID]: {
|
|
|
+ ...small.info.options,
|
|
|
+ },
|
|
|
},
|
|
|
messages: [
|
|
|
...SystemPrompt.title(input.providerID).map(
|
|
|
@@ -712,7 +714,7 @@ export namespace Session {
|
|
|
draft.title = title.trim()
|
|
|
})
|
|
|
})
|
|
|
- .catch(() => { })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
|
|
|
const agent = await Agent.get(inputAgent)
|
|
|
@@ -927,11 +929,14 @@ export namespace Session {
|
|
|
},
|
|
|
maxRetries: 3,
|
|
|
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
|
|
|
- maxOutputTokens: model.info.id.startsWith("gpt-5") ? undefined : outputLimit,
|
|
|
+ maxOutputTokens: outputLimit,
|
|
|
abortSignal: abort.signal,
|
|
|
stopWhen: stepCountIs(1000),
|
|
|
providerOptions: {
|
|
|
- [input.providerID]: model.info.options,
|
|
|
+ [input.providerID]: {
|
|
|
+ ...ProviderTransform.options(input.providerID, input.modelID),
|
|
|
+ ...model.info.options,
|
|
|
+ },
|
|
|
},
|
|
|
temperature: params.temperature,
|
|
|
topP: params.topP,
|