mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 07:11:39 +00:00
refactor(auto-reply): share mode-switch events
This commit is contained in:
@@ -21,10 +21,9 @@ import {
|
||||
import { maybeHandleQueueDirective } from "./directive-handling.queue-validation.js";
|
||||
import {
|
||||
formatDirectiveAck,
|
||||
formatElevatedEvent,
|
||||
formatElevatedRuntimeHint,
|
||||
formatElevatedUnavailableText,
|
||||
formatReasoningEvent,
|
||||
enqueueModeSwitchEvents,
|
||||
withOptions,
|
||||
} from "./directive-handling.shared.js";
|
||||
|
||||
@@ -363,20 +362,13 @@ export async function handleDirectiveOnly(
|
||||
});
|
||||
}
|
||||
}
|
||||
if (elevatedChanged) {
|
||||
const nextElevated = (sessionEntry.elevatedLevel ?? "off") as ElevatedLevel;
|
||||
enqueueSystemEvent(formatElevatedEvent(nextElevated), {
|
||||
sessionKey,
|
||||
contextKey: "mode:elevated",
|
||||
});
|
||||
}
|
||||
if (reasoningChanged) {
|
||||
const nextReasoning = (sessionEntry.reasoningLevel ?? "off") as ReasoningLevel;
|
||||
enqueueSystemEvent(formatReasoningEvent(nextReasoning), {
|
||||
sessionKey,
|
||||
contextKey: "mode:reasoning",
|
||||
});
|
||||
}
|
||||
enqueueModeSwitchEvents({
|
||||
enqueueSystemEvent,
|
||||
sessionEntry,
|
||||
sessionKey,
|
||||
elevatedChanged,
|
||||
reasoningChanged,
|
||||
});
|
||||
|
||||
const parts: string[] = [];
|
||||
if (directives.hasThinkDirective && directives.thinkLevel) {
|
||||
|
||||
Reference in New Issue
Block a user