mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:24:35 +00:00
fix: harden plugin and hook install paths
This commit is contained in:
@@ -78,8 +78,11 @@ export function createSystemPromptOverride(systemPrompt: string): string {
|
||||
return systemPrompt.trim();
|
||||
}
|
||||
|
||||
export function applySystemPromptOverrideToSession(session: AgentSession, override: string) {
|
||||
const prompt = override.trim();
|
||||
export function applySystemPromptOverrideToSession(
|
||||
session: AgentSession,
|
||||
override: string | ((defaultPrompt?: string) => string),
|
||||
) {
|
||||
const prompt = typeof override === "function" ? override() : override.trim();
|
||||
session.agent.setSystemPrompt(prompt);
|
||||
const mutableSession = session as unknown as {
|
||||
_baseSystemPrompt?: string;
|
||||
|
||||
Reference in New Issue
Block a user