Skip to content

Write custom CoordinatorStrategy for code review routing #16

@sunilp

Description

@sunilp

What

Create a custom CoordinatorStrategy that routes code review tasks to the most appropriate reviewer agent based on programming language, diff complexity, and reviewer expertise.

Why

The examples/custom-coordinator-strategy/ currently has a healthcare example. A code review routing strategy would be relatable to most developers and demonstrate the Coordinator pattern in a familiar domain.

How

  1. Subclass DefaultCoordinatorStrategy (see sdk/python/jamjet/coordinator/default_strategy.py)
  2. Override score() to weight language expertise and diff complexity
  3. Create mock agents (e.g., python-reviewer, rust-reviewer, frontend-reviewer)
  4. Add as examples/code-review-routing/main.py

Key Concepts

from jamjet.coordinator import DefaultCoordinatorStrategy, DimensionScores

class CodeReviewStrategy(DefaultCoordinatorStrategy):
    async def score(self, task, candidates, weights, context):
        # Weight language match heavily
        # Consider diff size for latency estimation
        ...

Resources

  • examples/custom-coordinator-strategy/main.py — healthcare strategy example
  • sdk/python/jamjet/coordinator/strategy.py — base class and types

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions