



























@@ -2345,18 +2345,21 @@ describe("runCodexAppServerAttempt", () => {
23452345testing.buildDeveloperInstructions(params, {
23462346dynamicTools: [createMessageDynamicTool("Message test tool")],
23472347}),
2348-).toContain("To send a visible message, use the `message` tool.");
2348+).toContain("Visible source replies are not automatically delivered for this run.");
2349234923502350const withoutMessageToolInstructions = testing.buildDeveloperInstructions(params, {
23512351dynamicTools: [],
23522352});
2353-expect(withoutMessageToolInstructions).toContain("active Codex delivery path");
2354-expect(withoutMessageToolInstructions).not.toContain("use the `message` tool");
2353+expect(withoutMessageToolInstructions).toContain(
2354+"reply normally in your final assistant message",
2355+);
2356+expect(withoutMessageToolInstructions).not.toContain("message(action=send)");
2357+expect(withoutMessageToolInstructions).not.toContain("Use `message`");
2355235823562359params.sourceReplyDeliveryMode = "automatic";
23572360const automaticInstructions = testing.buildDeveloperInstructions(params);
2358-expect(automaticInstructions).toContain("active Codex delivery path");
2359-expect(automaticInstructions).not.toContain("use the `message` tool");
2361+expect(automaticInstructions).toContain("reply normally in your final assistant message");
2362+expect(automaticInstructions).not.toContain("message(action=send)");
23602363});
2361236423622365it("includes Codex app-server scoped plugin command guidance in developer instructions", () => {
@@ -2444,6 +2447,36 @@ describe("runCodexAppServerAttempt", () => {
24442447]);
24452448});
244624492450+it("keeps leading delivery hints out of the Codex current user request", async () => {
2451+const sessionFile = path.join(tempDir, "session-delivery-hint.jsonl");
2452+const workspaceDir = path.join(tempDir, "workspace-delivery-hint");
2453+const harness = createStartedThreadHarness();
2454+const params = createParams(sessionFile, workspaceDir);
2455+params.prompt = "Delivery: to send a message, use the `message` tool.\n\nhello";
2456+params.skillsSnapshot = {
2457+prompt: "<available_skills><skill><name>demo</name></skill></available_skills>",
2458+skills: [],
2459+};
2460+2461+const run = runCodexAppServerAttempt(params);
2462+await harness.waitForMethod("turn/start");
2463+await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });
2464+await run;
2465+2466+const turnStart = harness.requests.find((request) => request.method === "turn/start");
2467+const turnStartParams = turnStart?.params as {
2468+input?: Array<{ text?: string }>;
2469+};
2470+const inputText = turnStartParams.input?.[0]?.text ?? "";
2471+expect(inputText).toContain("OpenClaw delivery metadata:");
2472+expect(inputText).toContain(
2473+"This delivery metadata is runtime routing guidance, not the user's request.",
2474+);
2475+expect(inputText).toContain("Delivery: to send a message, use the `message` tool.");
2476+expect(inputText).toContain("Current user request:\nhello");
2477+expect(inputText).not.toContain("Current user request:\nDelivery:");
2478+});
2479+24472480it("mirrors the Codex prompt into the transcript when the turn starts", async () => {
24482481const sessionFile = path.join(tempDir, "session-early-prompt.jsonl");
24492482const workspaceDir = path.join(tempDir, "workspace-early-prompt");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。