Skip to content

Commit 8220c80

Browse files
committed
feat: Removes 'excludeThoughtOnReq' setting
Removes the 'excludeThoughtOnReq' setting, which was intended to exclude the thought process from API requests. The reasoning format is now always requested from the server but is not sent back in API requests.
1 parent 3029de2 commit 8220c80

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsDialog.svelte

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@
202202
key: 'showThoughtInProgress',
203203
label: 'Show thought in progress',
204204
type: 'checkbox'
205-
},
206-
{
207-
key: 'excludeThoughtOnReq',
208-
label: 'Exclude thought on request',
209-
type: 'checkbox'
210205
}
211206
]
212207
},

tools/server/webui/src/lib/constants/settings-config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const SETTING_CONFIG_DEFAULT: Record<string, string | number | boolean> =
66
theme: 'system',
77
showTokensPerSecond: false,
88
showThoughtInProgress: true,
9-
excludeThoughtOnReq: false,
109
pasteLongTextToFileLen: 2500,
1110
pdfAsImage: false,
1211
// make sure these default values are in sync with `common.h`
@@ -61,7 +60,6 @@ export const SETTING_CONFIG_INFO: Record<string, string> = {
6160
custom: 'Custom JSON parameters to send to the API. Must be valid JSON format.',
6261
showTokensPerSecond: 'Display generation speed in tokens per second during streaming.',
6362
showThoughtInProgress: 'Expand thought process by default when generating messages.',
64-
excludeThoughtOnReq: 'Exclude thought process when sending requests to API (Recommended for DeepSeek-R1).',
6563
pdfAsImage: 'Parse PDF as image instead of text (requires vision-capable model).',
6664
pyInterpreterEnabled: 'Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks.'
6765
};

tools/server/webui/src/lib/services/chat.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export class ChatService {
4040

4141
// Build base request body with system message injection
4242
const processedMessages = this.injectSystemMessage(messages);
43-
const currentConfig = config();
4443

4544
const requestBody: ApiChatCompletionRequest = {
4645
messages: processedMessages.map((msg: ApiChatMessageData) => ({
@@ -50,9 +49,8 @@ export class ChatService {
5049
stream
5150
};
5251

53-
if (!currentConfig.excludeThoughtOnReq) {
54-
requestBody.reasoning_format = 'auto';
55-
}
52+
// Always request reasoning content from server, but never send it back in message history
53+
requestBody.reasoning_format = 'auto';
5654

5755
// Add generation parameters if provided
5856
if (temperature !== undefined) requestBody.temperature = temperature;
@@ -195,7 +193,6 @@ export class ChatService {
195193
const decoder = new TextDecoder();
196194
let fullResponse = '';
197195
let fullReasoningContent = '';
198-
let thinkContent = '';
199196
let regularContent = '';
200197
let insideThinkTag = false;
201198
let hasReceivedData = false;
@@ -240,8 +237,8 @@ export class ChatService {
240237
insideThinkTag = this.processContentForThinkTags(
241238
content,
242239
insideThinkTag,
243-
(thinkChunk) => {
244-
thinkContent += thinkChunk;
240+
() => {
241+
// Think content is ignored - we don't include it in API requests
245242
},
246243
(regularChunk) => {
247244
regularContent += regularChunk;

0 commit comments

Comments
 (0)