feat: configure ready outreach funnel limit
This commit is contained in:
1 parent
22eb32e5bf
commit
e9083281a8
15 files changed
+66
-11
No files matched your search
@@ -119,7 +119,7 @@ describe('CandidateQueueRepository', () => {
|
||||
queue.deferDelivery('p1', 'send-a', 'Matrix rate limited', 1_100, 1_004);
|
||||
|
||||
expect(queue.claimReady('account-b', 'send-b', 100, 1_099)).toBeNull();
|
||||
expect(queue.promoteDueRetries(1_100)).toBe(1);
|
||||
expect(queue.promoteDueRetries(25, 1_100)).toBe(1);
|
||||
expect(queue.claimReady('account-b', 'send-b', 100, 1_101)).toMatchObject({
|
||||
postId: 'p1',
|
||||
assignedAccountId: 'account-b',
|
||||
|
||||
@@ -41,6 +41,18 @@ describe('ConfigSchema', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('defaults the ready-post limit to 25 and requires a bounded integer', () => {
|
||||
const result = ConfigSchema.safeParse(minimalConfig({ reddit: { subreddits: ['test'] } }));
|
||||
expect(result.success).toBe(true);
|
||||
if (result.success) expect(result.data.reddit.maxReadyCandidates).toBe(25);
|
||||
expect(ConfigSchema.safeParse(minimalConfig({
|
||||
reddit: { subreddits: ['test'], maxReadyCandidates: 0 },
|
||||
})).success).toBe(false);
|
||||
expect(ConfigSchema.safeParse(minimalConfig({
|
||||
reddit: { subreddits: ['test'], maxReadyCandidates: 25.5 },
|
||||
})).success).toBe(false);
|
||||
});
|
||||
|
||||
it('applies default tone to subreddits', () => {
|
||||
const result = ConfigSchema.safeParse(minimalConfig({ reddit: { subreddits: ['test'] } }));
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { SettingsRoute } from '../../apps/dashboard/src/features/settings/settin
|
||||
const config = {
|
||||
rateLimit: { minDelayBetweenMessagesMs: 300_000, maxMessagesPerHour: 8, jitterMs: 60_000 },
|
||||
browser: { dryRun: true },
|
||||
reddit: { prioritizeRecentPosts: false, recentWindowMinutes: 60 },
|
||||
reddit: { prioritizeRecentPosts: false, recentWindowMinutes: 60, maxReadyCandidates: 25 },
|
||||
subreddits: [{ name: 'casualconversation', type: 'chat', weight: 2, tone: 'default' }],
|
||||
tones: ['default', 'dominant', 'submissive', 'playful', 'direct', 'gentle', 'kink-friendly', 'teasing'],
|
||||
advanced: { openrouter: { chatModel: 'example/chat-model' } },
|
||||
@@ -173,7 +173,7 @@ describe('settings and access', () => {
|
||||
expect(screen.getByRole('button', { name: 'Saving settings' })).toBeDisabled();
|
||||
|
||||
await waitFor(() => expect(resolveUpdate).toBeTypeOf('function'));
|
||||
expect(requestBody).toMatchObject({ reddit: { prioritizeRecentPosts: true, recentWindowMinutes: 60 } });
|
||||
expect(requestBody).toMatchObject({ reddit: { prioritizeRecentPosts: true, recentWindowMinutes: 60, maxReadyCandidates: 25 } });
|
||||
resolveUpdate?.(HttpResponse.json({
|
||||
success: true,
|
||||
config: {
|
||||
|
||||
@@ -43,6 +43,7 @@ export function getTestConfig(overrides?: Partial<Config>): Config {
|
||||
sellerDomains: [],
|
||||
prioritizeRecentPosts: false,
|
||||
recentWindowMinutes: 60,
|
||||
maxReadyCandidates: 25,
|
||||
...overrides?.reddit,
|
||||
},
|
||||
openrouter: {
|
||||
|
||||
Reference in new issue
Block a user