Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

Merge branch 'main' into feat/integration_improvement

Nghia Doan3b04e8231ade
diff --cc web-app/src/lib/custom-chat-transport.ts
index 581bb7fb8,7982db0b9..9ec19b95b
--- a/web-app/src/lib/custom-chat-transport.ts
+++ b/web-app/src/lib/custom-chat-transport.ts
@@@ -299,8 -303,15 +340,16 @@@ export class CustomChatTransport implem
this.mapUserInlineAttachments(options.messages)
)
+ // If continuing a truncated response, append the partial assistant content as a
+ // prefill so the model resumes from where it left off rather than regenerating.
+ const continueContent = this.continueFromContent
+ this.continueFromContent = null
+ const modelMessages = continueContent
+ ? [...baseMessages, { role: 'assistant' as const, content: continueContent }]
+ : baseMessages
+
// Include tools only if we have tools loaded AND model supports them
+ // In agent mode, OpenClaw manages its own tools
const hasTools = Object.keys(this.tools).length > 0
const selectedModel = useModelProvider.getState().selectedModel
const modelSupportsTools = selectedModel?.capabilities?.includes('tools') ?? this.modelSupportsTools