test: simplify raw body prompt prefixing · openclaw/openclaw@2cb18cb
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,9 +23,10 @@ describe("RawBody directive parsing", () => {
|
23 | 23 | const directives = parseInlineDirectives(sessionCtx.BodyForCommands ?? "", { |
24 | 24 | allowStatusDirective: true, |
25 | 25 | }); |
26 | | -const prefixedBody = [buildInboundUserContextPrefix(sessionCtx), directives.cleaned] |
27 | | -.filter(Boolean) |
28 | | -.join("\n\n"); |
| 26 | +const contextPrefix = buildInboundUserContextPrefix(sessionCtx); |
| 27 | +const prefixedBody = contextPrefix |
| 28 | + ? `${contextPrefix}\n\n${directives.cleaned}` |
| 29 | + : directives.cleaned; |
29 | 30 | const prompt = buildReplyPromptBodies({ |
30 | 31 | ctx: sessionCtx, |
31 | 32 | sessionCtx: { ...sessionCtx, BodyStripped: directives.cleaned }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。