





























@@ -28,10 +28,12 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
2828currentSessionKey: "agent:main:workspace:channel:c123:thread:current-1",
2929});
303031-expect(route).toMatchObject({
32-sessionKey: "agent:main:workspace:channel:c123:thread:reply-1",
33-threadId: "reply-1",
34-});
31+expect(route).toEqual(
32+baseRoute({
33+sessionKey: "agent:main:workspace:channel:c123:thread:reply-1",
34+threadId: "reply-1",
35+}),
36+);
3537});
36383739it("supports provider-specific threadId-first precedence", () => {
@@ -42,10 +44,12 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
4244precedence: ["threadId", "replyToId", "currentSession"],
4345});
444645-expect(route).toMatchObject({
46-sessionKey: "agent:main:workspace:channel:c123:thread:thread-1",
47-threadId: "thread-1",
48-});
47+expect(route).toEqual(
48+baseRoute({
49+sessionKey: "agent:main:workspace:channel:c123:thread:thread-1",
50+threadId: "thread-1",
51+}),
52+);
4953});
50545155it("keeps numeric delivery thread ids on the route while stringifying the session suffix", () => {
@@ -54,10 +58,12 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
5458threadId: 99,
5559});
566057-expect(route).toMatchObject({
58-sessionKey: "agent:main:workspace:channel:c123:thread:99",
59-threadId: 99,
60-});
61+expect(route).toEqual(
62+baseRoute({
63+sessionKey: "agent:main:workspace:channel:c123:thread:99",
64+threadId: 99,
65+}),
66+);
6167});
62686369it("recovers a current-session thread only when the base session matches", () => {
@@ -82,10 +88,11 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
8288canRecoverCurrentThread: () => false,
8389});
849085-expect(route).toMatchObject({
86-sessionKey: "agent:main:workspace:channel:c123",
87-});
88-expect(route.threadId).toBeUndefined();
91+expect(route).toEqual(
92+baseRoute({
93+sessionKey: "agent:main:workspace:channel:c123",
94+}),
95+);
8996});
90979198it("preserves provider-specific thread case when requested", () => {
@@ -95,10 +102,12 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
95102normalizeThreadId: (threadId) => threadId,
96103});
9710498-expect(route).toMatchObject({
99-sessionKey: "agent:main:workspace:channel:c123:thread:$EventID:Example.Org",
100-threadId: "$EventID:Example.Org",
101-});
105+expect(route).toEqual(
106+baseRoute({
107+sessionKey: "agent:main:workspace:channel:c123:thread:$EventID:Example.Org",
108+threadId: "$EventID:Example.Org",
109+}),
110+);
102111});
103112104113it("can carry a delivery thread without adding a session suffix", () => {
@@ -108,9 +117,11 @@ describe("buildThreadAwareOutboundSessionRoute", () => {
108117useSuffix: false,
109118});
110119111-expect(route).toMatchObject({
112-sessionKey: "agent:main:workspace:channel:c123",
113-threadId: "thread-1",
114-});
120+expect(route).toEqual(
121+baseRoute({
122+sessionKey: "agent:main:workspace:channel:c123",
123+threadId: "thread-1",
124+}),
125+);
115126});
116127});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。