Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/triggers/trello/label-added.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ export class ReadyToProcessLabelTrigger implements TriggerHandler {
} else if (currentListId === lists.todo) {
agentType = 'implementation';
} else {
// Default to splitting if list not recognized
logger.warn('Card in unrecognized list, defaulting to splitting', { currentListId, lists });
agentType = 'splitting';
logger.info('Card not in a trigger-eligible list, skipping ready-to-process label', {
currentListId,
lists,
});
return null;
}

logger.info('Agent type determined', { agentType, cardId, listId: currentListId });
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/triggers/label-added.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ describe('ReadyToProcessLabelTrigger', () => {
expect(result.workItemId).toBe('card789');
});

it('defaults to splitting agent when card is in unknown list', async () => {
it('returns null when card is in an unrecognized list (e.g. IN PROGRESS)', async () => {
mockGetCard.mockResolvedValue({
id: 'card999',
name: 'Unknown List Card',
desc: '',
url: 'https://trello.com/c/xyz',
shortUrl: 'https://trello.com/c/xyz',
idList: 'unknown-list-id',
idList: 'in-progress-list-id',
labels: [],
});

Expand All @@ -268,7 +268,7 @@ describe('ReadyToProcessLabelTrigger', () => {

const result = await trigger.handle(ctx);

expect(result.agentType).toBe('splitting');
expect(result).toBeNull();
});

it('returns null when card ID is missing', async () => {
Expand Down