Skip to content

test: add unit tests for skill-dispatcher module#240

Closed
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:test/skill-dispatcher-coverage
Closed

test: add unit tests for skill-dispatcher module#240
nikolasdehor wants to merge 1 commit intoSynkraAI:mainfrom
nikolasdehor:test/skill-dispatcher-coverage

Conversation

@nikolasdehor
Copy link
Contributor

Summary

Closes #239

Add 39 unit tests for the SkillDispatcher class in .aios-core/core/orchestration/skill-dispatcher.js (363 lines, previously 0% coverage).

Test Coverage

Area Tests Key Scenarios
Constructor 4 Options, skill mapping, personas, aliases
getSkillName 3 Known, alias, fallback
getAgentPersona 3 Known, unknown, alias
buildDispatchPayload 8 Full payload, args, array creates, tech stack, defaults
parseSkillOutput 12 null, object, JSON, markdown, text, truncation, types
createSkipResult 1 All fields
formatDispatchLog 3 Persona, N/A, unknown
getAvailableAgents 2 Primary only, count
isValidAgent 3 Known, AIOS prefix, unknown

Testing Approach

  • No mocks needed — pure logic module with no filesystem or external dependencies
  • Covers all output parsing paths: structured objects, JSON in markdown code blocks, plain JSON strings, plain text, unknown types
  • Validates tech stack flag generation for database, frontend, and TypeScript

All 39 tests passing.

Add 39 tests covering SkillDispatcher class:
- Skill mapping for all primary agents and aliases
- Agent persona resolution with fallback
- Dispatch payload construction with tech stack flags
- Skill output parsing: structured, JSON, markdown, plain text
- Skip result creation and dispatch log formatting
- Agent validation and available agents filtering
Copilot AI review requested due to automatic review settings February 18, 2026 19:21
@vercel
Copy link

vercel bot commented Feb 18, 2026

@nikolasdehor is attempting to deploy a commit to the Pedro Valério Lopez's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Warning

Rate limit exceeded

@nikolasdehor has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds comprehensive Jest unit test coverage for the .aios-core/core/orchestration/skill-dispatcher.js module (SkillDispatcher), exercising its agent mapping, dispatch payload construction, output parsing, and validation/log formatting behaviors.

Changes:

  • Introduces a new SkillDispatcher test suite with 39 unit tests across constructor, mapping, payload building, output parsing, logging, and validation paths.
  • Covers multiple parseSkillOutput formats (structured objects, JSON in markdown blocks, plain JSON strings, plain text, truncation, and unknown types).
  • Verifies primary-vs-alias agent handling via getAvailableAgents() and alias resolution for skill/persona lookups.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nikolasdehor
Copy link
Contributor Author

Consolidated into #426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for skill-dispatcher module

2 participants