mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-08 15:02:53 +00:00
* fix(agents): bound plugin system context * test(agents): align wrapped system context expectations * style(agents): format hook context helper * test(codex): expect plugin system context boundary --------- Co-authored-by: Alix-007 <267018309+Alix-007@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
16 lines
535 B
TypeScript
16 lines
535 B
TypeScript
import { normalizeStructuredPromptSection } from "./prompt-cache-stability.js";
|
|
|
|
const HOOK_SYSTEM_CONTEXT_HEADER =
|
|
"OpenClaw plugin-injected system context. This block is not workspace file content.";
|
|
|
|
export function wrapPluginSystemContextSection(value?: string): string | undefined {
|
|
if (typeof value !== "string") {
|
|
return undefined;
|
|
}
|
|
const normalized = normalizeStructuredPromptSection(value);
|
|
if (!normalized) {
|
|
return undefined;
|
|
}
|
|
return `---\n\n${HOOK_SYSTEM_CONTEXT_HEADER}\n\n${normalized}\n\n---`;
|
|
}
|