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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apps/api/src/handlers/discord/automation-suggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function postCurrentThreadSuggestionsToDiscord(params: {
sourceTaskId: string;
suggestionGroupKey: string;
createdByUserId: string | null;
launchRouting?: 'router';
channelId: string;
threadId?: string | null;
suggestions: DiscordAutomationSuggestion[];
Expand Down Expand Up @@ -66,6 +67,9 @@ export async function postCurrentThreadSuggestionsToDiscord(params: {
suggestionType: 'suggested_tasks',
suggestionKey: `${params.sourceTaskId}:${suggestion.id}`,
suggestionGroupKey: params.suggestionGroupKey,
...(params.launchRouting
? { launchRouting: params.launchRouting }
: {}),
},
};
await db
Expand Down
14 changes: 10 additions & 4 deletions apps/api/src/handlers/discord/setup-suggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export async function claimDiscordSuggestionLaunch(input: {
eq(trackedMessages.channelId, input.channelId),
eq(trackedMessages.workItemId, input.suggestionId),
),
columns: { id: true },
columns: { id: true, metadata: true },
});

if (!trackedCard) {
Expand All @@ -206,13 +206,19 @@ export async function claimDiscordSuggestionLaunch(input: {
return null;
}

// Cards marked launchRouting: 'router' are presentation-only chat-reply
// suggestions; drop their pinned launch metadata so the task router selects
// the workspace. Unmarked cards (scan and setup) keep their verified
// targets.
const routed = trackedCard.metadata?.launchRouting === 'router';

return {
id: claimed.id,
title: claimed.title,
brief: claimed.brief,
investigationContext: claimed.investigationContext,
targetRepositoryFullName: claimed.targetRepositoryFullName,
targetEnvironmentId: claimed.targetEnvironmentId,
investigationContext: routed ? null : claimed.investigationContext,
targetRepositoryFullName: routed ? null : claimed.targetRepositoryFullName,
targetEnvironmentId: routed ? null : claimed.targetEnvironmentId,
launchClaimedAt: claimed.launchClaimedAt,
};
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading