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

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

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
Clarify MEMORY guidance over generic TTS hints (#81930) ·...
giodl73-repo · 2026-05-17 · via Recent Commits to openclaw:main

File tree

  • extensions/speech-core/src

  • src/agents

Original file line numberDiff line numberDiff line change

@@ -108,6 +108,7 @@ vi.mock("../api.js", async () => {

108108
109109

const {

110110

_test,

111+

buildTtsSystemPromptHint,

111112

getTtsPersona,

112113

getTtsProvider,

113114

maybeApplyTtsToPayload,

@@ -238,6 +239,18 @@ describe("speech-core native voice-note routing", () => {

238239

expect(_test.supportsNativeVoiceNoteTts(undefined)).toBe(false);

239240

});

240241
242+

it("tells generic TTS guidance to defer to MEMORY voice-delivery instructions", () => {

243+

const hint = buildTtsSystemPromptHint(createTtsConfig("openclaw-speech-core-tts-hint-test"));

244+
245+

expect(hint).toContain("Voice (TTS) is enabled.");

246+

expect(hint).toContain(

247+

"If workspace context (especially MEMORY.md) tells you not to use [[tts:...]] or to use a local/non-tagged voice workflow, follow that workspace instruction instead.",

248+

);

249+

expect(hint).toContain(

250+

"Use [[tts:...]] and optional [[tts:text]]...[[/tts:text]] to control voice/expressiveness.",

251+

);

252+

});

253+
241254

it("marks Discord auto TTS replies as native voice messages", async () => {

242255

await expectTtsPayloadResult({

243256

channel: "discord",

Original file line numberDiff line numberDiff line change

@@ -557,6 +557,7 @@ export function buildTtsSystemPromptHint(

557557

? `Active TTS persona: ${persona.label ?? persona.id}${persona.description ? ` - ${persona.description}` : ""}.`

558558

: undefined,

559559

`Keep spoken text ≤${maxLength} chars to avoid auto-summary (summary ${summarize}).`,

560+

"If workspace context (especially MEMORY.md) tells you not to use [[tts:...]] or to use a local/non-tagged voice workflow, follow that workspace instruction instead.",

560561

"Use [[tts:...]] and optional [[tts:text]]...[[/tts:text]] to control voice/expressiveness.",

561562

]

562563

.filter(Boolean)

Original file line numberDiff line numberDiff line change

@@ -734,6 +734,28 @@ describe("buildAgentSystemPrompt", () => {

734734

);

735735

});

736736
737+

it("adds MEMORY guidance when a memory file is present", () => {

738+

const prompt = buildAgentSystemPrompt({

739+

workspaceDir: "/tmp/openclaw",

740+

contextFiles: [

741+

{

742+

path: "MEMORY.md",

743+

content: "NEVER use [[tts:...]] or TTS commands; ALWAYS use local Piper.",

744+

},

745+

],

746+

ttsHint:

747+

"Voice (TTS) is enabled.\nUse [[tts:...]] and optional [[tts:text]]...[[/tts:text]] to control voice/expressiveness.",

748+

});

749+
750+

expect(prompt).toContain(

751+

"MEMORY.md: durable user preferences and behavior guidance. Keep following it throughout the session unless higher-priority instructions override.",

752+

);

753+

expect(prompt.indexOf("NEVER use [[tts:...]]")).toBeGreaterThan(-1);

754+

expect(prompt.lastIndexOf("## Voice (TTS)")).toBeGreaterThan(

755+

prompt.indexOf("NEVER use [[tts:...]]"),

756+

);

757+

});

758+
737759

it("omits project context when no context files are injected", () => {

738760

const prompt = buildAgentSystemPrompt({

739761

workspaceDir: "/tmp/openclaw",

Original file line numberDiff line numberDiff line change

@@ -186,10 +186,18 @@ function buildProjectContextSection(params: {

186186

const hasSoulFile = params.files.some(

187187

(file) => getContextFileBasename(file.path) === "soul.md",

188188

);

189+

const hasMemoryFile = params.files.some(

190+

(file) => getContextFileBasename(file.path) === "memory.md",

191+

);

189192

lines.push("The following project context files have been loaded:");

190193

if (hasSoulFile) {

191194

lines.push("SOUL.md: persona/tone. Follow it unless higher-priority instructions override.");

192195

}

196+

if (hasMemoryFile) {

197+

lines.push(

198+

"MEMORY.md: durable user preferences and behavior guidance. Keep following it throughout the session unless higher-priority instructions override.",

199+

);

200+

}

193201

lines.push("");

194202

}

195203

for (const file of params.files) {