mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:59:36 +00:00
fix(agents): remove synthetic done fallback reply
This commit is contained in:
@@ -129,18 +129,17 @@ describe("buildEmbeddedRunPayloads", () => {
|
||||
expectSinglePayloadText(payloads, "All good");
|
||||
});
|
||||
|
||||
it("adds completion fallback when tools run successfully without final assistant text", () => {
|
||||
it("does not add synthetic completion text when tools run without final assistant text", () => {
|
||||
const payloads = buildPayloads({
|
||||
sessionKey: "agent:main:discord:direct:u123",
|
||||
toolMetas: [{ toolName: "write", meta: "/tmp/out.md" }],
|
||||
lastAssistant: makeStoppedAssistant(),
|
||||
});
|
||||
|
||||
expectSinglePayloadText(payloads, "✅ Done.");
|
||||
expect(payloads[0]?.isError).toBeUndefined();
|
||||
expect(payloads).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("does not add completion fallback for channel sessions", () => {
|
||||
it("does not add synthetic completion text for channel sessions", () => {
|
||||
const payloads = buildPayloads({
|
||||
sessionKey: "agent:main:discord:channel:c123",
|
||||
toolMetas: [{ toolName: "write", meta: "/tmp/out.md" }],
|
||||
@@ -154,7 +153,7 @@ describe("buildEmbeddedRunPayloads", () => {
|
||||
expect(payloads).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("does not add completion fallback for group sessions", () => {
|
||||
it("does not add synthetic completion text for group sessions", () => {
|
||||
const payloads = buildPayloads({
|
||||
sessionKey: "agent:main:telegram:group:g123",
|
||||
toolMetas: [{ toolName: "write", meta: "/tmp/out.md" }],
|
||||
@@ -168,7 +167,7 @@ describe("buildEmbeddedRunPayloads", () => {
|
||||
expect(payloads).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("does not add completion fallback when messaging tool already delivered output", () => {
|
||||
it("does not add synthetic completion text when messaging tool already delivered output", () => {
|
||||
const payloads = buildPayloads({
|
||||
sessionKey: "agent:main:discord:direct:u123",
|
||||
toolMetas: [{ toolName: "message_send", meta: "sent to #ops" }],
|
||||
@@ -183,7 +182,7 @@ describe("buildEmbeddedRunPayloads", () => {
|
||||
expect(payloads).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("does not add completion fallback when the run still has a tool error", () => {
|
||||
it("does not add synthetic completion text when the run still has a tool error", () => {
|
||||
const payloads = buildPayloads({
|
||||
toolMetas: [{ toolName: "browser", meta: "open https://example.com" }],
|
||||
lastToolError: { toolName: "browser", error: "url required" },
|
||||
@@ -192,7 +191,7 @@ describe("buildEmbeddedRunPayloads", () => {
|
||||
expect(payloads).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("does not add completion fallback when no tools ran", () => {
|
||||
it("does not add synthetic completion text when no tools ran", () => {
|
||||
const payloads = buildPayloads({
|
||||
lastAssistant: makeStoppedAssistant(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user