Skip to content

Commit e7aa4bc

Browse files
committed
fix(test): align deep-research expectations with v0.2.0 pack shape
1 parent 429cf79 commit e7aa4bc

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

registry/curated/research/deep-research/test/ResearchService.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@ describe('ResearchService', () => {
414414
});
415415

416416
it('should fetch Reddit trends', async () => {
417+
// `id` is required: getRedditTrends() dedupes on p.data.id and
418+
// filters out posts without one. Real Reddit responses always
419+
// include an id; the fixture must mirror that shape.
417420
mockGet.mockResolvedValue({
418421
data: {
419422
data: {
420423
children: [
421-
{ data: { title: 'Reddit Post', selftext: 'Content', permalink: '/r/test/1', score: 500, subreddit: 'test' } },
424+
{ data: { id: 'abc123', title: 'Reddit Post', selftext: 'Content', permalink: '/r/test/1', score: 500, subreddit: 'test' } },
422425
],
423426
},
424427
},

registry/curated/research/deep-research/test/index.spec.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ describe('Deep Research – createExtensionPack', () => {
4141
expect(pack.name).toBe('@framers/agentos-ext-deep-research');
4242
});
4343

44-
it('should have version 0.1.0', () => {
45-
expect(pack.version).toBe('0.1.0');
44+
it('should have version 0.2.0', () => {
45+
expect(pack.version).toBe('0.2.0');
4646
});
4747

4848
// ── Descriptor count and IDs ──
4949

50-
it('should contain exactly 5 tool descriptors', () => {
51-
expect(pack.descriptors).toHaveLength(5);
50+
it('should contain exactly 6 tool descriptors', () => {
51+
expect(pack.descriptors).toHaveLength(6);
5252
});
5353

5454
it('should have all expected descriptor IDs', () => {
@@ -59,6 +59,7 @@ describe('Deep Research – createExtensionPack', () => {
5959
'researchScrape',
6060
'researchAggregate',
6161
'researchTrending',
62+
'deepResearch',
6263
]);
6364
});
6465

@@ -69,10 +70,21 @@ describe('Deep Research – createExtensionPack', () => {
6970
});
7071

7172
// ── Priority ──
72-
73-
it('should set priority 50 for all descriptors', () => {
73+
// The five legacy single-step research tools share priority 50;
74+
// the multi-step deepResearch engine is bumped to 90 so it wins
75+
// the dispatcher tie-break for open-ended research queries.
76+
77+
it('should set priority 50 for legacy research tools and 90 for deepResearch', () => {
78+
const expectedPriority: Record<string, number> = {
79+
researchInvestigate: 50,
80+
researchAcademic: 50,
81+
researchScrape: 50,
82+
researchAggregate: 50,
83+
researchTrending: 50,
84+
deepResearch: 90,
85+
};
7486
for (const d of pack.descriptors) {
75-
expect(d.priority).toBe(50);
87+
expect(d.priority).toBe(expectedPriority[d.id]);
7688
}
7789
});
7890

@@ -141,7 +153,7 @@ describe('Deep Research – createExtensionPack', () => {
141153
},
142154
};
143155
const p = createExtensionPack(ctx);
144-
expect(p.descriptors).toHaveLength(5);
156+
expect(p.descriptors).toHaveLength(6);
145157
p.onDeactivate?.();
146158
});
147159
});

0 commit comments

Comments
 (0)