




















@@ -208,35 +208,44 @@ describe("gateway server agent", () => {
208208setRegistry(emptyRegistry);
209209});
210210211-test("agent reuses the last plugin delivery route when channel=last", async () => {
212-const registry = createRegistry([
213-{
214-pluginId: "msteams",
215-source: "test",
216-plugin: createMSTeamsPlugin(),
217-},
218-]);
219-setRegistry(registry);
220-await writeMainSessionEntry({
221-sessionId: "sess-teams",
222-lastChannel: "msteams",
223-lastTo: "conversation:teams-123",
224-});
225-const res = await rpcReq(ws, "agent", {
226-message: "hi",
227-sessionKey: "main",
228-channel: "last",
229-deliver: true,
230-idempotencyKey: "idem-agent-last-msteams",
231-});
232-expect(res.ok).toBe(true);
233-await expectAgentRoutingCall({
234-channel: "msteams",
235-deliver: true,
236-to: "conversation:teams-123",
237-runId: "idem-agent-last-msteams",
238-});
239-});
211+test(
212+"agent reuses the last plugin delivery route when channel=last",
213+{ timeout: 20_000 },
214+async () => {
215+const registry = createRegistry([
216+{
217+pluginId: "msteams",
218+source: "test",
219+plugin: createMSTeamsPlugin(),
220+},
221+]);
222+setRegistry(registry);
223+await writeMainSessionEntry({
224+sessionId: "sess-teams",
225+lastChannel: "msteams",
226+lastTo: "conversation:teams-123",
227+});
228+const res = await rpcReq(
229+ws,
230+"agent",
231+{
232+message: "hi",
233+sessionKey: "main",
234+channel: "last",
235+deliver: true,
236+idempotencyKey: "idem-agent-last-msteams",
237+},
238+20_000,
239+);
240+expect(res.ok).toBe(true);
241+await expectAgentRoutingCall({
242+channel: "msteams",
243+deliver: true,
244+to: "conversation:teams-123",
245+runId: "idem-agent-last-msteams",
246+});
247+},
248+);
240249241250test("agent preserves CLI session binding metadata when refreshing session state", async () => {
242251await useTempSessionStorePath();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。