Skip to content

feat(keyword): add pattern-based primary agent resolution via explicit_patterns#920

Merged
JeremyDev87 merged 1 commit intomasterfrom
feat/explicit-patterns-agent-resolution-791
Mar 24, 2026
Merged

feat(keyword): add pattern-based primary agent resolution via explicit_patterns#920
JeremyDev87 merged 1 commit intomasterfrom
feat/explicit-patterns-agent-resolution-791

Conversation

@JeremyDev87
Copy link
Owner

Summary

  • Add automatic primary agent selection by matching user prompt keywords against agents' activation.explicit_patterns field
  • Create pure matchExplicitPatterns() function with case-insensitive substring matching and longest-match-wins tie-breaking
  • New resolution priority: explicit request > explicit_patterns > recommended > config > intent > context > default
  • Add 'explicit_patterns' to PrimaryAgentSource type (backward-compatible)
  • Cache loaded patterns in PrimaryAgentResolver to avoid repeated agent JSON loading
  • 20 new tests (15 unit + 5 integration), all 4972 tests passing

Test plan

  • Unit tests for matchExplicitPatterns() — basic matching, longest match wins, availability filtering, edge cases
  • Integration tests for ActAgentStrategy — explicit_patterns priority over recommended agent, fallthrough on no match
  • All existing 4952 tests still pass (no regressions)
  • Lint: 0 errors, Typecheck: clean, Build: success, Circular: none

Closes #791

…t_patterns

- Create explicit-pattern-matcher.ts with case-insensitive substring matching
- Add 'explicit_patterns' to PrimaryAgentSource type
- Add LoadExplicitPatternsFn and explicitPatternsMap to StrategyContext
- Update PrimaryAgentResolver with optional pattern loader and caching
- Inject explicit_patterns matching in ActAgentStrategy (priority: explicit > explicit_patterns > recommended)
- Wire loadExplicitPatterns in keyword.module.ts from agent JSON activation fields
- Add 20 new tests (15 unit + 5 integration)

Closes #791
@JeremyDev87 JeremyDev87 added feat mcp-server apps/mcp-server labels Mar 24, 2026
@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Mar 24, 2026 3:28pm

@JeremyDev87 JeremyDev87 self-assigned this Mar 24, 2026
@JeremyDev87 JeremyDev87 merged commit ef2e12f into master Mar 24, 2026
47 of 48 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/explicit-patterns-agent-resolution-791 branch March 24, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat mcp-server apps/mcp-server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add pattern-based primary agent resolution via explicit_patterns

1 participant