mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 05:12:43 +00:00
fix(whatsapp): remove implicit [openclaw] self-chat prefix
This commit is contained in:
@@ -30,6 +30,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- WhatsApp/self-chat response prefix fallback: stop forcing `"[openclaw]"` as the implicit outbound response prefix when no identity name or response prefix is configured, so blank/default prefix settings no longer inject branding text unexpectedly in self-chat flows. (#27962) Thanks @ecanmor.
|
||||||
- Memory/QMD search result decoding: accept `qmd search` hits that only include `file` URIs (for example `qmd://collection/path.md`) without `docid`, resolve them through managed collection roots, and keep multi-collection results keyed by file fallback so valid QMD hits no longer collapse to empty `memory_search` output. (#28181) Thanks @0x76696265.
|
- Memory/QMD search result decoding: accept `qmd search` hits that only include `file` URIs (for example `qmd://collection/path.md`) without `docid`, resolve them through managed collection roots, and keep multi-collection results keyed by file fallback so valid QMD hits no longer collapse to empty `memory_search` output. (#28181) Thanks @0x76696265.
|
||||||
- Memory/QMD collection-name conflict recovery: when `qmd collection add` fails because another collection already occupies the same `path + pattern`, detect the conflicting collection from `collection list`, remove it, and retry add so agent-scoped managed collections are created deterministically instead of being silently skipped; also add warning-only fallback when qmd metadata is unavailable to avoid destructive guesses. (#25496) Thanks @Ramsbaby.
|
- Memory/QMD collection-name conflict recovery: when `qmd collection add` fails because another collection already occupies the same `path + pattern`, detect the conflicting collection from `collection list`, remove it, and retry add so agent-scoped managed collections are created deterministically instead of being silently skipped; also add warning-only fallback when qmd metadata is unavailable to avoid destructive guesses. (#25496) Thanks @Ramsbaby.
|
||||||
- Slack/app_mention race dedupe: when `app_mention` dispatch wins while same-`ts` `message` prepare is still in-flight, suppress the later message dispatch so near-simultaneous Slack deliveries do not produce duplicate replies; keep single-retry behavior and add regression coverage for both dropped and successful message-prepare outcomes. (#37033) Thanks @Takhoffman.
|
- Slack/app_mention race dedupe: when `app_mention` dispatch wins while same-`ts` `message` prepare is still in-flight, suppress the later message dispatch so near-simultaneous Slack deliveries do not produce duplicate replies; keep single-retry behavior and add regression coverage for both dropped and successful message-prepare outcomes. (#37033) Thanks @Takhoffman.
|
||||||
|
|||||||
@@ -219,6 +219,33 @@ describe("web processMessage inbound contract", () => {
|
|||||||
expect(dispatcherOptions?.responsePrefix).toBe("[Mainbot]");
|
expect(dispatcherOptions?.responsePrefix).toBe("[Mainbot]");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not force an [openclaw] response prefix in self-chats when identity is unset", async () => {
|
||||||
|
capturedDispatchParams = undefined;
|
||||||
|
|
||||||
|
await processMessage(
|
||||||
|
makeProcessMessageArgs({
|
||||||
|
routeSessionKey: "agent:main:whatsapp:direct:+1555",
|
||||||
|
groupHistoryKey: "+1555",
|
||||||
|
cfg: {
|
||||||
|
messages: {},
|
||||||
|
session: { store: sessionStorePath },
|
||||||
|
} as unknown as ReturnType<typeof import("../../../config/config.js").loadConfig>,
|
||||||
|
msg: {
|
||||||
|
id: "msg1",
|
||||||
|
from: "+1555",
|
||||||
|
to: "+1555",
|
||||||
|
selfE164: "+1555",
|
||||||
|
chatType: "direct",
|
||||||
|
body: "hi",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
// oxlint-disable-next-line typescript/no-explicit-any
|
||||||
|
const dispatcherOptions = (capturedDispatchParams as any)?.dispatcherOptions;
|
||||||
|
expect(dispatcherOptions?.responsePrefix).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
it("clears pending group history when the dispatcher does not queue a final reply", async () => {
|
it("clears pending group history when the dispatcher does not queue a final reply", async () => {
|
||||||
capturedCtx = undefined;
|
capturedCtx = undefined;
|
||||||
const groupHistories = new Map<string, Array<{ sender: string; body: string }>>([
|
const groupHistories = new Map<string, Array<{ sender: string; body: string }>>([
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ export async function processMessage(params: {
|
|||||||
const responsePrefix =
|
const responsePrefix =
|
||||||
prefixOptions.responsePrefix ??
|
prefixOptions.responsePrefix ??
|
||||||
(configuredResponsePrefix === undefined && isSelfChat
|
(configuredResponsePrefix === undefined && isSelfChat
|
||||||
? (resolveIdentityNamePrefix(params.cfg, params.route.agentId) ?? "[openclaw]")
|
? resolveIdentityNamePrefix(params.cfg, params.route.agentId)
|
||||||
: undefined);
|
: undefined);
|
||||||
|
|
||||||
const inboundHistory =
|
const inboundHistory =
|
||||||
|
|||||||
Reference in New Issue
Block a user