Skip to content

Commit cc534da

Browse files
dgibbs64Copilot
andcommitted
fix(labeler): improve game detection logic for structured fields
* Refine fallback logic to avoid guessing from free text when a structured Game field exists. * Ensure AI-detected game fallback only occurs when no structured Game field is present. Co-authored-by: Copilot <[email protected]>
1 parent da3bff7 commit cc534da

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ jobs:
491491
}
492492
493493
// Legacy issues often have no form section; fall back to deterministic text matching.
494-
if (desiredGames.size === 0) {
494+
// If a structured Game field exists but does not map, do not guess from free text.
495+
if (desiredGames.size === 0 && !hasStructuredGameSelection) {
495496
const fromText = findGamesFromText(`${title}\n${body}`, gameAliasToLabel, gameAliasToScript);
496497
for (const label of fromText.labels) desiredGames.add(label);
497498
for (const scriptName of fromText.scripts) desiredServerScripts.add(scriptName);
@@ -585,10 +586,10 @@ jobs:
585586
const missing = Array.isArray(triage?.missing_info) ? triage.missing_info : [];
586587
const hasIssues = isPoor || missing.length > 0;
587588
588-
// Fallback to AI-detected game only if explicit form mapping was unavailable.
589+
// Fallback to AI-detected game only when no structured Game field exists.
589590
const detectedGame = triage?.detected_game;
590591
const gameConfidence = triage?.game_confidence;
591-
if (desiredGames.size === 0 && detectedGame && gameConfidence === 'high') {
592+
if (desiredGames.size === 0 && !hasStructuredGameSelection && detectedGame && gameConfidence === 'high') {
592593
const normalizedDetectedGame = normalizeName(detectedGame);
593594
const mapped = gameLabelByNormalized.get(normalizedDetectedGame);
594595
if (mapped) {

0 commit comments

Comments
 (0)