mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 19:00:21 +00:00
fix(agents): split system prompt cache prefix by transport (#59054)
* fix(agents): restore Anthropic prompt cache seam * fix(agents): strip cache boundary for completions * fix(agents): strip cache boundary for cli backends * chore(changelog): note cross-transport cache boundary rollout * fix(agents): route default stream fallbacks through boundary shapers * fix(agents): strip cache boundary for provider streams
This commit is contained in:
@@ -4,6 +4,7 @@ import { MAX_IMAGE_BYTES } from "../media/constants.js";
|
||||
import { buildCliArgs, loadPromptRefImages } from "./cli-runner/helpers.js";
|
||||
import * as promptImageUtils from "./pi-embedded-runner/run/images.js";
|
||||
import type { SandboxFsBridge } from "./sandbox/fs-bridge.js";
|
||||
import { SYSTEM_PROMPT_CACHE_BOUNDARY } from "./system-prompt-cache-boundary.js";
|
||||
import * as toolImages from "./tool-images.js";
|
||||
|
||||
describe("loadPromptRefImages", () => {
|
||||
@@ -117,4 +118,19 @@ describe("buildCliArgs", () => {
|
||||
}),
|
||||
).toEqual(["exec", "resume", "thread-123", "--model", "gpt-5.4"]);
|
||||
});
|
||||
|
||||
it("strips the internal cache boundary from CLI system prompt args", () => {
|
||||
expect(
|
||||
buildCliArgs({
|
||||
backend: {
|
||||
command: "claude",
|
||||
systemPromptArg: "--append-system-prompt",
|
||||
},
|
||||
baseArgs: ["-p"],
|
||||
modelId: "claude-sonnet-4-6",
|
||||
systemPrompt: `Stable prefix${SYSTEM_PROMPT_CACHE_BOUNDARY}Dynamic suffix`,
|
||||
useResume: false,
|
||||
}),
|
||||
).toEqual(["-p", "--append-system-prompt", "Stable prefix\nDynamic suffix"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user