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

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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: preserve embedded base system prompts · openclaw/ope...
shakkernerd · 2026-05-29 · via Recent Commits to openclaw:main

@@ -2096,12 +2096,16 @@ export async function runEmbeddedAttempt(

20962096

},

20972097

});

20982098

session = createdSession.session;

2099-

applySystemPromptToSession(session, systemPromptText);

21002099

if (!session) {

21012100

throw new Error("Embedded agent session missing");

21022101

}

21032102

session.setActiveToolsByName(sessionToolAllowlist);

21042103

const activeSession = session;

2104+

const setActiveSessionSystemPrompt = (nextSystemPrompt: string) => {

2105+

systemPromptText = nextSystemPrompt;

2106+

applySystemPromptToSession(activeSession, nextSystemPrompt);

2107+

};

2108+

setActiveSessionSystemPrompt(systemPromptText);

21052109

installMessageToolOnlyTerminalHook({

21062110

agent: activeSession.agent,

21072111

sourceReplyDeliveryMode: params.sourceReplyDeliveryMode,

@@ -2113,8 +2117,7 @@ export async function runEmbeddedAttempt(

21132117

// and queues; the empty system prompt prevents the runtime from rebuilding the

21142118

// normal OpenClaw agent/tool prompt when `session.prompt()` starts.

21152119

activeSession.agent.reset();

2116-

applySystemPromptToSession(activeSession, "");

2117-

systemPromptText = "";

2120+

setActiveSessionSystemPrompt("");

21182121

}

21192122

if (typeof activeSession.agent.convertToLlm === "function") {

21202123

const baseConvertToLlm = activeSession.agent.convertToLlm.bind(activeSession.agent);

@@ -2661,8 +2664,7 @@ export async function runEmbeddedAttempt(

26612664

try {

26622665

if (isRawModelRun) {

26632666

activeSession.agent.reset();

2664-

applySystemPromptToSession(activeSession, "");

2665-

systemPromptText = "";

2667+

setActiveSessionSystemPrompt("");

26662668

cacheTrace?.recordStage("session:raw-model-run", {

26672669

messages: activeSession.messages,

26682670

system: systemPromptText,

@@ -2739,11 +2741,12 @@ export async function runEmbeddedAttempt(

27392741

hasSessionsYield: effectiveTools.some((tool) => tool.name === "sessions_yield"),

27402742

});

27412743

if (activeSubagentPromptAddition) {

2742-

systemPromptText = prependSystemPromptAddition({

2743-

systemPrompt: systemPromptText,

2744-

systemPromptAddition: activeSubagentPromptAddition,

2745-

});

2746-

applySystemPromptToSession(activeSession, systemPromptText);

2744+

setActiveSessionSystemPrompt(

2745+

prependSystemPromptAddition({

2746+

systemPrompt: systemPromptText,

2747+

systemPromptAddition: activeSubagentPromptAddition,

2748+

}),

2749+

);

27472750

}

27482751

}

27492752

@@ -2805,11 +2808,12 @@ export async function runEmbeddedAttempt(

28052808

preassemblyContextEngineMessagesForPrecheck;

28062809

}

28072810

if (assembled.systemPromptAddition) {

2808-

systemPromptText = prependSystemPromptAddition({

2809-

systemPrompt: systemPromptText,

2810-

systemPromptAddition: assembled.systemPromptAddition,

2811-

});

2812-

applySystemPromptToSession(activeSession, systemPromptText);

2811+

setActiveSessionSystemPrompt(

2812+

prependSystemPromptAddition({

2813+

systemPrompt: systemPromptText,

2814+

systemPromptAddition: assembled.systemPromptAddition,

2815+

}),

2816+

);

28132817

log.debug(

28142818

`context engine: prepended system prompt addition (${assembled.systemPromptAddition.length} chars)`,

28152819

);

@@ -3277,8 +3281,7 @@ export async function runEmbeddedAttempt(

32773281

}

32783282

const legacySystemPrompt = normalizeOptionalString(hookResult?.systemPrompt) ?? "";

32793283

if (legacySystemPrompt) {

3280-

applySystemPromptToSession(activeSession, legacySystemPrompt);

3281-

systemPromptText = legacySystemPrompt;

3284+

setActiveSessionSystemPrompt(legacySystemPrompt);

32823285

log.debug(`hooks: applied systemPrompt (${legacySystemPrompt.length} chars)`);

32833286

}

32843287

const prependedOrAppendedSystemPrompt = composeSystemPromptWithHookContext({

@@ -3293,8 +3296,7 @@ export async function runEmbeddedAttempt(

32933296

if (prependedOrAppendedSystemPrompt) {

32943297

const prependSystemLen = hookResult?.prependSystemContext?.trim().length ?? 0;

32953298

const appendSystemLen = hookResult?.appendSystemContext?.trim().length ?? 0;

3296-

applySystemPromptToSession(activeSession, prependedOrAppendedSystemPrompt);

3297-

systemPromptText = prependedOrAppendedSystemPrompt;

3299+

setActiveSessionSystemPrompt(prependedOrAppendedSystemPrompt);

32983300

log.debug(

32993301

`hooks: applied prependSystemContext/appendSystemContext (${prependSystemLen}+${appendSystemLen} chars)`,

33003302

);

@@ -3305,8 +3307,7 @@ export async function runEmbeddedAttempt(

33053307

model: runtimeInfo.model,

33063308

});

33073309

if (modelAwareSystemPrompt !== systemPromptText) {

3308-

applySystemPromptToSession(activeSession, modelAwareSystemPrompt);

3309-

systemPromptText = modelAwareSystemPrompt;

3310+

setActiveSessionSystemPrompt(modelAwareSystemPrompt);

33103311

}

3311331233123313

if (cacheObservabilityEnabled) {

@@ -3481,8 +3482,7 @@ export async function runEmbeddedAttempt(

34813482

appendSystemContext: runtimeSystemContext,

34823483

});

34833484

if (runtimeSystemPrompt) {

3484-

applySystemPromptToSession(activeSession, runtimeSystemPrompt);

3485-

systemPromptText = runtimeSystemPrompt;

3485+

setActiveSessionSystemPrompt(runtimeSystemPrompt);

34863486

}

34873487

}

34883488

const runtimeContextForHook = promptSubmission.runtimeOnly