@@ -707,10 +707,9 @@ describe("buildGatewayCronService", () => {
|
707 | 707 | expect((enqueueCall?.[1] as { sessionKey?: string } | undefined)?.sessionKey).toBe( |
708 | 708 | "agent:primary:discord:channel:ops", |
709 | 709 | ); |
710 | | -expect(wakeCall?.[0]).toMatchObject({ |
711 | | -agentId: "primary", |
712 | | -sessionKey: "agent:primary:discord:channel:ops", |
713 | | -}); |
| 710 | +const wakeRequest = wakeCall?.[0] as { agentId?: string; sessionKey?: string } | undefined; |
| 711 | +expect(wakeRequest?.agentId).toBe("primary"); |
| 712 | +expect(wakeRequest?.sessionKey).toBe("agent:primary:discord:channel:ops"); |
714 | 713 | } finally { |
715 | 714 | state.cron.stop(); |
716 | 715 | } |
@@ -768,10 +767,9 @@ describe("buildGatewayCronService", () => {
|
768 | 767 | expect((enqueueCall?.[1] as { sessionKey?: string } | undefined)?.sessionKey).toBe( |
769 | 768 | "agent:primary:main", |
770 | 769 | ); |
771 | | -expect(wakeCall?.[0]).toMatchObject({ |
772 | | -agentId: "primary", |
773 | | -sessionKey: "agent:primary:main", |
774 | | -}); |
| 770 | +const wakeRequest = wakeCall?.[0] as { agentId?: string; sessionKey?: string } | undefined; |
| 771 | +expect(wakeRequest?.agentId).toBe("primary"); |
| 772 | +expect(wakeRequest?.sessionKey).toBe("agent:primary:main"); |
775 | 773 | } finally { |
776 | 774 | state.cron.stop(); |
777 | 775 | } |
@@ -813,15 +811,20 @@ describe("buildGatewayCronService", () => {
|
813 | 811 | expect((enqueueCall?.[1] as { sessionKey?: string } | undefined)?.sessionKey).toMatch( |
814 | 812 | /^agent:ops:/, |
815 | 813 | ); |
816 | | -expect(wakeCall?.[0]).toMatchObject({ |
817 | | -source: "manual", |
818 | | -intent: "immediate", |
819 | | -reason: "wake", |
820 | | -agentId: "ops", |
821 | | -}); |
822 | | -expect((wakeCall?.[0] as { sessionKey?: string } | undefined)?.sessionKey).toMatch( |
823 | | -/^agent:ops:/, |
824 | | -); |
| 814 | +const wakeRequest = wakeCall?.[0] as |
| 815 | +| { |
| 816 | +source?: string; |
| 817 | +intent?: string; |
| 818 | +reason?: string; |
| 819 | +agentId?: string; |
| 820 | +sessionKey?: string; |
| 821 | +} |
| 822 | +| undefined; |
| 823 | +expect(wakeRequest?.source).toBe("manual"); |
| 824 | +expect(wakeRequest?.intent).toBe("immediate"); |
| 825 | +expect(wakeRequest?.reason).toBe("wake"); |
| 826 | +expect(wakeRequest?.agentId).toBe("ops"); |
| 827 | +expect(wakeRequest?.sessionKey).toMatch(/^agent:ops:/); |
825 | 828 | } finally { |
826 | 829 | state.cron.stop(); |
827 | 830 | } |
|