Files
openclaw/src/agents/hook-system-context-boundary.ts
Alix-007 f4329fe0d6 fix(agents): bound plugin system context
* 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>
2026-05-27 21:16:15 +01:00

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---`;
}