fix: Prevent keyword matcher from applying all labels#733
Conversation
The keyword matching in label_matcher.py was returning 0.95 for ANY token overlap between the query and label descriptions. This caused ALL labels to be applied to issues since common words like 'issue', 'request', 'new', etc. appear in most label descriptions. Changes: - Add comprehensive stopword list to filter out common words - Require label NAME tokens to appear in query for 0.95 score - Use label NAME only (not description) for category matching - Fix: 'duplicate' label no longer matches feature keywords because its description contains 'request' Root cause: The original code at line 250-251 returned 0.95 if ANY tokenized word from the query matched ANY word in the label text (name + description), which was far too permissive. Test results before fix: - All 5 test issues got 15+ labels each (bug, enhancement, duplicate, documentation, agents:*, verify:*, etc.) Test results after fix: - Bug report → only 'bug' label (0.91) - Feature request → only 'enhancement' label (0.9) - Other issues → rely on semantic matching only
|
Status | ✅ no new diagnostics |
Automated Status SummaryHead SHA: c790e59
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeAfter merging PR #103 (multi-agent routing infrastructure), we need to:
Context for AgentDesign Decisions & Constraints
Related Issues/PRsReferencesBlockers & Dependencies
TasksPipeline Validation
GITHUB_STEP_SUMMARY
Conditional Status Summary
Comment Pattern Cleanup
Acceptance criteria
Dependencies
|
🤖 Keepalive Loop StatusPR #733 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in the label keyword matching logic that caused all labels to be applied to every issue due to overly permissive token overlap detection. The fix introduces a stopwords list and requires label names (not just descriptions) to match query tokens for high-confidence scoring.
Changes:
- Added a comprehensive stopwords list to filter common words that shouldn't trigger keyword matches
- Modified keyword matching to require label NAME tokens to appear in the query (after stopword filtering) for the 0.95 confidence score
- Changed category matching (bug/feature/docs) to check only label NAMEs instead of names + descriptions to prevent false positives
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/langchain/label_matcher.py |
Added _COMMON_STOPWORDS set and refactored _keyword_match_score() to require label name token matches and use name-only for category detection |
tests/scripts/test_label_matcher.py |
Updated test to use type:documentation instead of quality label to align with new name-only matching behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Document critical bug found: keyword matcher applying all labels - Add PR #733 to fix list (open) - Mark conflicted PRs as resolved (all 3 done) - Update Week 2 progress with evening re-testing results - Move Suite C/D fixes from 'needed' to 'applied' section
- Document critical bug found: keyword matcher applying all labels - Add PR #733 to fix list (open) - Mark conflicted PRs as resolved (all 3 done) - Update Week 2 progress with evening re-testing results - Move Suite C/D fixes from 'needed' to 'applied' section
* docs: Update SHORT_TERM_PLAN with label matcher fixes and validation results - Document PRs #733, #735 (deep label matcher fixes) - Record validation test results (issues #265-267) - Mark auto-label validation as complete - Key win: 2FA feature request now gets only 'enhancement' (was 3 labels) * docs: Add LONG_TERM_PLAN for Phases 4-5 - Phase 4: Auto-pilot workflow, user guide, conflict resolution - Phase 5: Learning from feedback, multi-model arbitration - Infrastructure: Performance, monitoring, cost optimization - Risk assessment and success metrics - Prioritized 8-week roadmap
* docs: Update SHORT_TERM_PLAN with label matcher fixes and validation results - Document PRs #733, #735 (deep label matcher fixes) - Record validation test results (issues #265-267) - Mark auto-label validation as complete - Key win: 2FA feature request now gets only 'enhancement' (was 3 labels) * docs: Add LONG_TERM_PLAN for Phases 4-5 - Phase 4: Auto-pilot workflow, user guide, conflict resolution - Phase 5: Learning from feedback, multi-model arbitration - Infrastructure: Performance, monitoring, cost optimization - Risk assessment and success metrics - Prioritized 8-week roadmap * Expand cleanup_labels.py classifications - Add autofix:*, integration-*, agents:keepalive-nudge to functional - Add common component labels (app, engine, ui, backend, cli) - Add tech labels (javascript, python, github:actions) - Add domain labels (metrics, modeling, schema, etc.) - Reduces idiosyncratic labels from 150+ to 24 - Remaining 24 are legitimate project-specific labels
Automated Status Summary
Scope
After merging PR #103 (multi-agent routing infrastructure), we need to:
GITHUB_STEP_SUMMARYoutput so iteration results are visible in the Actions UIContext for Agent
Design Decisions & Constraints
<!-- keepalive-loop-summary -->| github-actions[bot] | NEW: CLI agent iteration tracking | ✅ Keep for CLI agents |<!-- keepalive-state:v1 -->| agents-workflows-bot[bot] | State tracking |<!-- keepalive-round: N -->| stranske | OLD: Instruction comment | ❌ CLI agents dont need this |agent:*label), we should have exactly one updating comment (<!-- keepalive-loop-summary -->) instead of accumulating 10+ comments per PR.Related Issues/PRs
References
Blockers & Dependencies
Tasks
Pipeline Validation
agent:codexlabelGITHUB_STEP_SUMMARY
agents-keepalive-loop.ymlafter agent runConditional Status Summary
buildStatusBlock()inagents_pr_meta_update_body.jsto acceptagentTypeparameteragentTypeis set (CLI agent): hide workflow table, hide head SHA/required checksComment Pattern Cleanup
agent:*label):<!-- gate-summary: -->comment posting (use step summary instead)<!-- keepalive-round: N -->instruction comments (task appendix replaces this)<!-- keepalive-loop-summary -->to be the single source of truthagent:*label):<!-- gate-summary: -->commentagent_typeoutput to detect job so downstream workflows know the modeagents-pr-meta.ymlto conditionally skip gate summary for CLI agent PRsAcceptance criteria
Dependencies
Head SHA: c3e0699
Latest Runs: ✅ success — Gate
Required: gate: ✅ success