Fix hidden reasoning not allowing manual parsing

This commit is contained in:
Wolfsblvt
2025-02-21 18:01:25 +01:00
parent 4c7ede67f3
commit b0a2f241d2

View File

@ -338,14 +338,15 @@ export class ReasoningHandler {
return mesChanged;
}
if (this.state === ReasoningState.None) {
if (this.state === ReasoningState.None || this.#isHiddenReasoningModel) {
// If streamed message starts with the opening, cut it out and put all inside reasoning
if (message.mes.startsWith(power_user.reasoning.prefix) && message.mes.length > power_user.reasoning.prefix.length) {
this.#isParsingReasoning = true;
// Manually set starting state here, as we might already have received the ending suffix
this.state = ReasoningState.Thinking;
this.startTime = this.initialTime;
this.startTime = this.startTime ?? this.initialTime;
this.endTime = null;
}
}