






























@@ -292,13 +292,23 @@ describe("resolveDiscordAutoThreadContext", () => {
292292createdThreadId: "thread",
293293expectedNull: false,
294294parentInheritanceEnabled: false,
295+expectedModelParentSessionKey: buildAgentSessionKey({
296+agentId: "agent",
297+channel: "discord",
298+peer: { kind: "channel", id: "parent" },
299+}),
295300expectedParentSessionKey: undefined,
296301},
297302{
298303name: "created thread with parent inheritance",
299304createdThreadId: "thread",
300305expectedNull: false,
301306parentInheritanceEnabled: true,
307+expectedModelParentSessionKey: buildAgentSessionKey({
308+agentId: "agent",
309+channel: "discord",
310+peer: { kind: "channel", id: "parent" },
311+}),
302312expectedParentSessionKey: buildAgentSessionKey({
303313agentId: "agent",
304314channel: "discord",
@@ -333,6 +343,9 @@ describe("resolveDiscordAutoThreadContext", () => {
333343}),
334344);
335345expect(context?.ParentSessionKey, testCase.name).toBe(testCase.expectedParentSessionKey);
346+expect(context?.ModelParentSessionKey, testCase.name).toBe(
347+testCase.expectedModelParentSessionKey,
348+);
336349}
337350});
338351});
@@ -511,6 +524,11 @@ describe("resolveDiscordAutoThreadReplyPlan", () => {
511524channel: "discord",
512525peer: { kind: "channel", id: "thread" },
513526}),
527+expectedModelParentSessionKey: buildAgentSessionKey({
528+agentId: "agent",
529+channel: "discord",
530+peer: { kind: "channel", id: "parent" },
531+}),
514532expectedParentSessionKey: undefined,
515533},
516534{
@@ -525,6 +543,11 @@ describe("resolveDiscordAutoThreadReplyPlan", () => {
525543channel: "discord",
526544peer: { kind: "channel", id: "thread" },
527545}),
546+expectedModelParentSessionKey: buildAgentSessionKey({
547+agentId: "agent",
548+channel: "discord",
549+peer: { kind: "channel", id: "parent" },
550+}),
528551expectedParentSessionKey: buildAgentSessionKey({
529552agentId: "agent",
530553channel: "discord",
@@ -566,6 +589,9 @@ describe("resolveDiscordAutoThreadReplyPlan", () => {
566589expect(plan.autoThreadContext?.ParentSessionKey, testCase.name).toBe(
567590testCase.expectedParentSessionKey,
568591);
592+expect(plan.autoThreadContext?.ModelParentSessionKey, testCase.name).toBe(
593+testCase.expectedModelParentSessionKey,
594+);
569595}
570596}
571597});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。