mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(hooks): prevent rejected inbound conversation claims (#109857)
* fix(hooks): honor rejected inbound conversations * test(hooks): trim rejection fixture --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
co-authored by
Peter Steinberger
parent
6a053f59cd
commit
6caf637163
@@ -464,6 +464,24 @@ describe("message hook mappers", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not fall back when a channel rejects inbound claim resolution", () => {
|
||||
const canonical = deriveInboundMessageHookContext(
|
||||
makeInboundCtx({
|
||||
Provider: "claim-chat",
|
||||
Surface: "claim-chat",
|
||||
OriginatingChannel: "claim-chat",
|
||||
From: undefined,
|
||||
To: "channel:room-123",
|
||||
OriginatingTo: "channel:room-123",
|
||||
GroupChannel: undefined,
|
||||
GroupSubject: undefined,
|
||||
}),
|
||||
);
|
||||
|
||||
expect(toPluginInboundClaimContext(canonical).conversationId).toBeUndefined();
|
||||
expect(toPluginInboundClaimEvent(canonical).conversationId).toBeUndefined();
|
||||
});
|
||||
|
||||
it("passes thread parent ids to channel plugin claim resolvers", () => {
|
||||
const canonical = deriveInboundMessageHookContext(
|
||||
makeInboundCtx({
|
||||
|
||||
@@ -323,7 +323,11 @@ function resolveInboundConversation(canonical: CanonicalInboundMessageHookContex
|
||||
threadParentId: canonical.threadParentId,
|
||||
isGroup: canonical.isGroup,
|
||||
})
|
||||
: null;
|
||||
: undefined;
|
||||
if (pluginResolved === null) {
|
||||
// A plugin-owned null is an explicit rejection, so generic parsing must not reclaim it.
|
||||
return {};
|
||||
}
|
||||
if (pluginResolved) {
|
||||
return {
|
||||
conversationId: normalizeOptionalString(pluginResolved.conversationId),
|
||||
|
||||
Reference in New Issue
Block a user