Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
51 changes: 51 additions & 0 deletions .github/workflows/build-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Push Agent Image

on:
push:
tags:
- 'release-*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install Agent Stack CLI
run: pip install agentstack-cli

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
daemon-config: '{"features": {"containerd-snapshotter": true}}'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract version from tag
id: extract_version
run: |
# Extract version from tag (e.g., release-1.2.3 -> 1.2.3)
VERSION=${GITHUB_REF#refs/tags/release-}
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build and Push
run: |
agentstack build ./ --tag ghcr.io/${{ github.repository }}/github-issue-creator:${{ steps.extract_version.outputs.version }} --no-import --multi-platform --push
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.13-slim-trixie
COPY --from=ghcr.io/astral-sh/uv:0.7.15 /uv /bin/

ENV UV_LINK_MODE=copy \
PRODUCTION_MODE=true \
IS_BUILD_PASS=true

ADD . /app
WORKDIR /app

RUN uv sync --no-cache --locked --link-mode copy

ENV PRODUCTION_MODE=True \
PATH="/app/.venv/bin:$PATH" \
HOME=/tmp

CMD ["uv", "run", "--no-sync", "server"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ uv run server

The server will start on `http://127.0.0.1:8000` and register the GitHub Issue Creator agent that coordinates the complete workflow.

### Running in Agent Stack

You can also easily start the agent in [Agent Stack](https://agentstack.beeai.dev/).

```bash
# Install the GH issue creator
agentstack add ghcr.io/i-am-bee/github-issue-creator/github-issue-creator:0.2.0

# Setup the repo
agentstack env add "GitHub Issue Creator" GITHUB_REPOSITORY=username/reponame

# Setup the PAT
agentstack env add "GitHub Issue Creator" GITHUB_PAT=github_pat_XXX
```

## Security Considerations

> [!WARNING]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "github-issue-creator"
version = "0.1.0"
version = "0.2.0"
readme = "README.md"
authors = [
{name = "Matous Havlena", email = "matous.havlena@ibm.com"}
Expand Down
6 changes: 6 additions & 0 deletions src/github_issue_creator/agents/build_mock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from beeai_framework.agents.requirement import RequirementAgent
from github_issue_creator.utils.config import llm


def get_build_mock():
return RequirementAgent(llm=llm)
1 change: 1 addition & 0 deletions src/github_issue_creator/agents/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

async def get_agent_manager():
"""Create and configure the issue workflow management agent."""

tools = await session_manager.get_tools()

try:
Expand Down
22 changes: 18 additions & 4 deletions src/github_issue_creator/server.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import os

import asyncio
from textwrap import dedent

from a2a.types import AgentSkill
from beeai_framework.adapters.beeai_platform.serve.server import BeeAIPlatformServer
from agentstack_sdk.a2a.extensions.ui.agent_detail import AgentDetail
from agentstack_sdk.a2a.extensions.ui.agent_detail import AgentDetail, EnvVar
from openinference.instrumentation.beeai import BeeAIInstrumentor

from github_issue_creator.agents.manager import get_agent_manager
from github_issue_creator.agents.build_mock import get_build_mock

BeeAIInstrumentor().instrument()

async def get_root_agent():
return get_build_mock() if os.getenv("IS_BUILD_PASS") == "true" else await get_agent_manager()

async def run():
manager = await get_agent_manager()
server = BeeAIPlatformServer(config={"configure_telemetry": True})
root_agent = await get_root_agent()

server = BeeAIPlatformServer(config={"configure_telemetry": True, "port": 8000,"host": "0.0.0.0"})
server.register(
manager,
root_agent,
name="GitHub Issue Creator",
description=dedent(
"""\
Expand All @@ -28,6 +34,14 @@ async def run():
detail=AgentDetail(
interaction_mode="multi-turn",
framework="BeeAI",
variables=[
EnvVar(name="GITHUB_REPOSITORY", description="The repository to create the issue in", required=True),
EnvVar(name="GITHUB_PAT", description="The GitHub Personal Access Token to use for the API", required=True),

EnvVar(name="DOCS_URL", description="The URL of the documentation to use for the API", required=False),
EnvVar(name="TEMPLATE_BUG_URL", description="The URL of the bug template to use for the API", required=False),
EnvVar(name="TEMPLATE_FEATURE_URL", description="The URL of the feature template to use for the API", required=False),
],
),
skills=[
AgentSkill(
Expand Down
12 changes: 9 additions & 3 deletions src/github_issue_creator/utils/config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import os

from beeai_framework.backend import ChatModel
from dotenv import load_dotenv

from beeai_framework.adapters.agentstack.backend.chat import AgentStackChatModel

load_dotenv()

model = os.getenv("MODEL", "openai:gpt-5-mini")
llm = ChatModel.from_name(model, {"api_key": os.getenv("API_KEY")})
default_model = "openai:gpt-5-mini"

if os.getenv("API_KEY") is not None:
model = os.getenv("MODEL", default_model)
llm = ChatModel.from_name(model, {"api_key": os.getenv("API_KEY")})
else:
llm = AgentStackChatModel(preferred_models=[default_model])

# Import after load_dotenv to ensure env vars are loaded
from github_issue_creator.tools.session_manager import SessionManager
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.