@@ -3,7 +3,6 @@
|
3 | 3 | import { describe, expect, it } from "vitest"; |
4 | 4 | import { |
5 | 5 | buildCurrentInboundPrompt, |
6 | | -buildCurrentInboundPromptContextPrefix, |
7 | 6 | buildRuntimeContextCustomMessage, |
8 | 7 | resolveRuntimeContextPromptParts, |
9 | 8 | } from "./runtime-context-prompt.js"; |
@@ -282,31 +281,6 @@ describe("runtime context prompt submission", () => {
|
282 | 281 | }); |
283 | 282 | }); |
284 | 283 | |
285 | | -it("uses current-turn context as prompt-local text", () => { |
286 | | -expect( |
287 | | -buildCurrentInboundPromptContextPrefix({ |
288 | | -text: "Conversation info (untrusted metadata):\n```json\n{}\n```", |
289 | | -}), |
290 | | -).toBe("Conversation info (untrusted metadata):\n```json\n{}\n```"); |
291 | | -}); |
292 | | - |
293 | | -it("can use compact current-turn context for resumable backends", () => { |
294 | | -expect( |
295 | | -buildCurrentInboundPromptContextPrefix( |
296 | | -{ |
297 | | -text: "Room context:\nAlice: lunch?\n\nCurrent event:\nBob: yes", |
298 | | -resumableText: "Current event:\nBob: yes", |
299 | | -}, |
300 | | -{ preferResumableText: true }, |
301 | | -), |
302 | | -).toBe("Current event:\nBob: yes"); |
303 | | -}); |
304 | | - |
305 | | -it("omits empty current-turn context", () => { |
306 | | -expect(buildCurrentInboundPromptContextPrefix(undefined)).toBe(""); |
307 | | -expect(buildCurrentInboundPromptContextPrefix({ text: " " })).toBe(""); |
308 | | -}); |
309 | | - |
310 | 284 | it("joins current-turn context and prompt with the requested separator", () => { |
311 | 285 | expect( |
312 | 286 | buildCurrentInboundPrompt({ |
@@ -332,6 +306,13 @@ describe("runtime context prompt submission", () => {
|
332 | 306 | preferResumableText: true, |
333 | 307 | }), |
334 | 308 | ).toBe("Current event:\nBob: yes\n\n[OpenClaw room event]"); |
| 309 | + |
| 310 | +expect( |
| 311 | +buildCurrentInboundPrompt({ |
| 312 | +context: { text: " " }, |
| 313 | +prompt: "visible ask", |
| 314 | +}), |
| 315 | +).toBe("visible ask"); |
335 | 316 | }); |
336 | 317 | |
337 | 318 | it("builds runtime context as prompt-local custom context before the current user prompt", () => { |
|