Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions .github/actions/strands-task-labeller/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: 'Strands Task Labeller'
description: 'Automatically analyze and label GitHub issues using Strands agent'
inputs:
aws_role_arn:
description: 'AWS IAM role ARN for authentication'
required: true
sessions_bucket:
description: 'S3 bucket for session storage'
required: true
pat_token:
description: 'pat token to modify repo'
required: false

runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
sparse-checkout: |
.github

- name: Copy .github to safe directory
shell: bash
run: |
mkdir -p ${{ runner.temp }}/strands-labeller
cp -r .github ${{ runner.temp }}/strands-labeller

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.13'

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: '${{ runner.temp }}/strands-labeller/.github/scripts/python/requirements.txt'

- name: Install Strands Agents
shell: bash
run: |
echo "📦 Installing from requirements.txt"
uv pip install --system -r ${{ runner.temp }}/strands-labeller/.github/scripts/python/requirements.txt --quiet

- name: Configure Git
shell: bash
run: |
git config --global user.name "Strands Agent"
git config --global user.email "[email protected]"
git config --global core.pager cat
PAGER=cat

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws_role_arn }}
role-session-name: GitHubActions-StrandsAgent-${{ github.run_id }}
aws-region: us-west-2
mask-aws-account-id: true
inline-session-policy: >-
{
"Version": "2012-10-17",
"Statement": [
{
"Sid":"BedrockAccess",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModelWithResponseStream",
"bedrock:InvokeModel"
],
"Resource": "*"
}, {
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::strands-typescript-project-sessions/*",
]
}, {
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": [
"arn:aws:s3:::strands-typescript-project-sessions",
]
}
]
}

- name: Execute labelling task
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
PAT_TOKEN: ${{ inputs.pat_token }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_WRITE: 'true'
S3_SESSION_BUCKET: ${{ inputs.sessions_bucket }}
SESSION_ID: 'labeller-${{ github.event.issue.number }}-${{ github.run_id }}'
INPUT_SYSTEM_PROMPT: 'You are a GitHub Issue Metadata Automation Agent. Your role is to analyze new GitHub issues and automatically apply appropriate metadata including labels, area expert assignments, and priority classification.

## Core Responsibilities
1. **Label Assignment**: Apply relevant labels from the available repository labels based on issue content
2. **Area Expert Tagging**: Tag appropriate team members using @mentions based on technical areas
3. **Priority Classification**: Assess and set priority levels based on impact and urgency

## Process
1. Read the automation configuration from .github/config/automation-config.json
2. Analyze the issue title, description, and any provided context
3. Apply appropriate labels using GitHub tools
4. Tag relevant area experts with @mentions in a comment
5. Set priority level if applicable

## Available Labels (from config)
Use ONLY these labels from the repository: dependencies, javascript, bug, documentation, duplicate, enhancement, github_actions, good first issue, help wanted, implement-task, invalid, project-task, question, review-task, wontfix

## Priority Keywords (from config)
- **Sev2**: crash, security, data loss, production down, critical bug, high priority bug
- **On-Call**: urgent, blocking, production issue, critical bug, high priority bug
- **High**: performance, regression, breaking change, important, high customer impact, block users
- **Medium**: improvement, enhancement, feature request
- **Low**: documentation, typo, cleanup, minor

## Area Expert Assignment Rules
- Match issue content to technical areas (typescript, bedrock, openai, mcp, etc.)
- Tag ONLY the 2 most relevant experts based on the area_experts configuration
- Use @username format for mentions
- Prioritize experts most closely related to the specific issue content

## Area Expert Matching
Match issue content to these technical areas and tag corresponding experts:
- agent_loop, context_management, async_streaming, tool_executors
- bi_directional_streaming, human_in_loop, hooks
- bedrock, anthropic, gemini, litellm, llamaapi, llama_cpp, mistralai, ollama, openai, sagemaker, writer, cohere
- multi_agent, a2a, sessions, memory, mcp, structured_outputs
- agentcore_integrations, telemetry, evaluations, github_workflows
- website_docs, tools, samples, agent_builder, mcp_server
- embodied_ai, typescript, constraints_engine

## Output Format
- Apply labels immediately using add_labels_to_issue tool
- Set Priority field using set_issue_project_field tool (Priority field only - do NOT change Status)
- Post a single comment with expert mentions that includes:
- Brief issue summary
- Priority assessment with reasoning
- Expert mentions (MAX 2 people): "CC @expert1 @expert2 for [specific area] - [brief reason why they are needed]"
- Clear action items or next steps
- Keep comments professional but informative
- For TypeScript issues: Only tag TypeScript experts if the issue is specifically about TypeScript compilation, syntax, or type errors (not just because this is a TypeScript project)

## Important: Do NOT change Status field
- Only set Priority field (Sev2, On-Call, High, Medium, Low, N/A)
- Leave Status field unchanged (should remain ToDo, In Progress, etc.)
- The automation is for metadata only, not workflow management

Use GitHub tools to execute all actions. Be thorough but efficient in your analysis.'
STRANDS_TOOL_CONSOLE_MODE: 'enabled'
BYPASS_TOOL_CONSENT: 'true'
run: |
uv run ${{ runner.temp }}/strands-labeller/.github/scripts/python/agent_runner.py "Perform complete GitHub issue metadata automation for issue #${{ github.event.issue.number }}: analyze content, apply labels, tag area experts, and set priority based on automation configuration."
159 changes: 159 additions & 0 deletions .github/config/automation-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"area_experts": {
"agent_loop": {
"name": "Agent Loop",
"github_usernames": ["pgrayy", "zastrowm"]
},
"context_management": {
"name": "Context Management / Windows",
"github_usernames": ["Unshure", "afarntrog"]
},
"async_streaming": {
"name": "Async / Callbacks Streaming",
"github_usernames": ["pgrayy"]
},
"tool_executors": {
"name": "Tool Executors",
"github_usernames": ["pgrayy"]
},
"bi_directional_streaming": {
"name": "Bi-directional Streaming",
"github_usernames": ["mehtarac", "mkmeral", "pgrayy"]
},
"human_in_loop": {
"name": "Human in the Loop / Interrupts",
"github_usernames": ["mkmeral", "pgrayy"]
},
"hooks": {
"name": "Hooks",
"github_usernames": ["zastrowm"]
},
"bedrock": {
"name": "Bedrock Model Provider",
"github_usernames": ["mehtarac"]
},
"anthropic": {
"name": "Anthropic Model Provider",
"github_usernames": ["pgrayy"]
},
"gemini": {
"name": "Gemini Model Provider",
"github_usernames": ["notgitika"]
},
"litellm": {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to list the the label associated with the category? Or are we allowing any label?

Right now all of our "area" label start with "area-"

Copy link
Author

Choose a reason for hiding this comment

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

For labels, the agent will only use existing labels. It will @ the person in this list in the comment, thus the expert will receive an email noticification. We can do assign the expert directly, but personally I think this is a little aggressive.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, we shouldn't assign. I like mentioning more.

But we do have to be concerned with user-submitted content possibly spamming the repository via the agent. Some sort of guard rails around what the agent can do I think would be ideal.

"name": "LiteLLM Model Provider",
"github_usernames": ["dbschmigelski"]
},
"llamaapi": {
"name": "LlamaAPI Model Provider",
"github_usernames": ["pgrayy"]
},
"llama_cpp": {
"name": "llama.cpp Model Provider",
"github_usernames": ["awsarron"]
},
"mistralai": {
"name": "MistralAI Model Provider",
"github_usernames": ["mehtarac"]
},
"ollama": {
"name": "Ollama Model Provider",
"github_usernames": ["dbschmigelski"]
},
"openai": {
"name": "OpenAI Model Provider",
"github_usernames": ["pgrayy"]
},
"sagemaker": {
"name": "SageMaker Model Provider",
"github_usernames": ["mehtarac"]
},
"writer": {
"name": "Writer Model Provider",
"github_usernames": ["mehtarac"]
},
"cohere": {
"name": "Cohere Model Provider",
"github_usernames": ["Unshure"]
},
"multi_agent": {
"name": "Multi-agent Orchestrators",
"github_usernames": ["mkmeral", "JackYPCOnline", "awsarron"]
},
"a2a": {
"name": "A2A",
"github_usernames": ["awsarron"]
},
"sessions": {
"name": "Sessions",
"github_usernames": ["Unshure", "JackYPCOnline"]
},
"memory": {
"name": "Memory",
"github_usernames": ["Unshure", "mehtarac", "afarntrog"]
},
"mcp": {
"name": "MCP",
"github_usernames": ["dbschmigelski"]
},
"structured_outputs": {
"name": "Structured Outputs",
"github_usernames": ["afarntrog"]
},
"agentcore_integrations": {
"name": "AgentCore Integrations",
"github_usernames": ["JackYPCOnline", "afarntrog", "mehtarac", "dbschmigelski"]
},
"telemetry": {
"name": "Telemetry / Observability",
"github_usernames": ["poshinchen", "JackYPCOnline"]
},
"evaluations": {
"name": "Evaluations",
"github_usernames": ["poshinchen"]
},
"github_workflows": {
"name": "GitHub Workflows and Actions",
"github_usernames": ["dbschmigelski", "yonib05", "Unshure"]
},
"website_docs": {
"name": "Website and Docs",
"github_usernames": ["zastrowm", "yonib05", "rycolez"]
},
"tools": {
"name": "Tools",
"github_usernames": ["cagataycali", "JackYPCOnline", "zastrowm", "mehtarac"]
},
"agent_builder": {
"name": "Agent Builder",
"github_usernames": ["cagataycali"]
},
"mcp_server": {
"name": "MCP Server",
"github_usernames": ["JackYPCOnline", "mkmeral"]
},
"embodied_ai": {
"name": "Embodied / Physical AI and Edge Inference / Robotics",
"github_usernames": ["awsarron", "cagataycali", "mkmeral"]
},
"typescript": {
"name": "TypeScript",
"github_usernames": ["Unshure", "zastrowm", "afarntrog", "awsarron"]
},
"constraints_engine": {
"name": "Constraints Engine",
"github_usernames": ["dbschmigelski"]
}
},
"labels": {
"available": ["dependencies", "javascript", "bug", "documentation", "duplicate", "enhancement", "github_actions", "good first issue", "help wanted", "implement-task", "invalid", "project-task", "question", "review-task", "wontfix"]
},
"priority_levels": ["Sev2", "On-Call", "High", "Medium", "Low", "N/A"],
"priority_rules": {
"sev2_keywords": ["crash", "security", "data loss", "production down", "critical bug","high priority bug"],
"oncall_keywords": ["urgent", "blocking", "production issue","critical bug","high priority bug"],
"high_keywords": ["performance", "regression", "breaking change", "important","high customer impact","block users"],
"medium_keywords": ["improvement", "enhancement", "feature request"],
"low_keywords": ["documentation", "typo", "cleanup", "minor"]
}
}
4 changes: 4 additions & 0 deletions .github/scripts/python/agent_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Import local GitHub tools we need
from github_tools import (
add_issue_comment,
add_labels_to_issue,
create_issue,
create_pull_request,
get_issue,
Expand All @@ -29,6 +30,7 @@
list_issues,
list_pull_requests,
reply_to_review_comment,
set_issue_project_field,
update_issue,
update_pull_request,
)
Expand Down Expand Up @@ -62,6 +64,8 @@ def _get_all_tools() -> list[Any]:
update_issue,
list_issues,
add_issue_comment,
add_labels_to_issue,
set_issue_project_field,
get_issue_comments,

# GitHub PR tools
Expand Down
Loading
Loading