惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
D
Docker
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
U
Unit 42

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(agents): bound plugin system context · openclaw/openc...
Alix-007 · 2026-05-28 · via Recent Commits to openclaw:main

@@ -7,6 +7,7 @@ vi.mock("../context-engine-capabilities.js", () => ({

77

import type { OpenClawConfig } from "../../../config/config.js";

88

import { addSession, resetProcessRegistryForTests } from "../../bash-process-registry.js";

99

import { createProcessSessionFixture } from "../../bash-process-registry.test-helpers.js";

10+

import { wrapPluginSystemContextSection } from "../../hook-system-context-boundary.js";

1011

import { SYSTEM_PROMPT_CACHE_BOUNDARY } from "../../system-prompt-cache-boundary.js";

1112

import { buildAgentSystemPrompt } from "../../system-prompt.js";

1213

import { resolveBootstrapContextTargets } from "./attempt-bootstrap-routing.js";

@@ -88,6 +89,10 @@ function requireContentItem(

8889

return requireRecord(content[index], `content item ${index}`);

8990

}

909192+

function wrappedPluginSystemContext(text: string): string {

93+

return wrapPluginSystemContextSection(text) ?? "";

94+

}

95+9196

function expectSingleTextContent(

9297

content: Array<{ type?: string; text?: string }> | unknown[],

9398

textFragment: string,

@@ -715,8 +720,12 @@ describe("resolvePromptBuildHookResult", () => {

715720716721

expect(result.prependContext).toBe("prompt context\n\nagent start context");

717722

expect(result.appendContext).toBe("prompt append context\n\nagent start append context");

718-

expect(result.prependSystemContext).toBe("prompt prepend\n\nagent start prepend");

719-

expect(result.appendSystemContext).toBe("prompt append\n\nagent start append");

723+

expect(result.prependSystemContext).toBe(

724+

`${wrappedPluginSystemContext("prompt prepend")}\n\n${wrappedPluginSystemContext("agent start prepend")}`,

725+

);

726+

expect(result.appendSystemContext).toBe(

727+

`${wrappedPluginSystemContext("prompt append")}\n\n${wrappedPluginSystemContext("agent start append")}`,

728+

);

720729

});

721730722731

it("applies heartbeat prompt contributions only during heartbeat turns", async () => {

@@ -766,29 +775,33 @@ describe("composeSystemPromptWithHookContext", () => {

766775

expect(

767776

composeSystemPromptWithHookContext({

768777

baseSystemPrompt: " base system ",

769-

prependSystemContext: " prepend ",

770-

appendSystemContext: " append ",

778+

prependSystemContext: wrappedPluginSystemContext(" prepend "),

779+

appendSystemContext: wrappedPluginSystemContext(" append "),

771780

}),

772-

).toBe("prepend\n\nbase system\n\nappend");

781+

).toBe(

782+

`${wrappedPluginSystemContext(" prepend")}\n\nbase system\n\n${wrappedPluginSystemContext(" append")}`,

783+

);

773784

});

774785775-

it("normalizes hook system context line endings and trailing whitespace", () => {

786+

it("normalizes hook system context block line endings and trailing whitespace", () => {

776787

expect(

777788

composeSystemPromptWithHookContext({

778789

baseSystemPrompt: " base system ",

779-

prependSystemContext: " prepend line \r\nsecond line\t\r\n",

780-

appendSystemContext: " append \t\r\n",

790+

prependSystemContext: wrappedPluginSystemContext(" prepend line \r\nsecond line\t\r\n"),

791+

appendSystemContext: wrappedPluginSystemContext(" append \t\r\n"),

781792

}),

782-

).toBe("prepend line\nsecond line\n\nbase system\n\nappend");

793+

).toBe(

794+

`${wrappedPluginSystemContext(" prepend line\nsecond line")}\n\nbase system\n\n${wrappedPluginSystemContext(" append")}`,

795+

);

783796

});

784797785798

it("avoids blank separators when base system prompt is empty", () => {

786799

expect(

787800

composeSystemPromptWithHookContext({

788801

baseSystemPrompt: " ",

789-

appendSystemContext: " append only ",

802+

appendSystemContext: wrappedPluginSystemContext(" append only "),

790803

}),

791-

).toBe("append only");

804+

).toBe(wrappedPluginSystemContext(" append only"));

792805

});

793806794807

it("keeps bootstrap truncation notices in the system prompt instead of the user prompt", () => {