Spaces:
Running
Running
metadata
title: A2A-SIN-Code-backend Agent
sdk: docker
app_port: 7860
pinned: false
A2A-SIN-Code-backend Agent
Status: π Production Ready
Version: 1.0.0
Team: Team - Coder
Manager: SIN-Zeus
π― Overview
A2A-SIN-Code-backend is an autonomous cloud coder that receives tasks via A2A protocol and executes them using the opencode CLI. It runs on Hugging Face Spaces (CPU-Basic) and works exclusively on the OpenSIN-Code repository.
π Features
- A2A Protocol: Full JSON-RPC 2.0 compliance
- opencode CLI: Uses Antigravity-powered opencode for all code generation
- GitHub Integration: Automatic commits to assigned branches
- Gradio UI: Operator dashboard for manual task submission and monitoring
- Health Checks:
/healthendpoint for fleet monitoring - Type-Specific: Specialized prompts for backend tasks
ποΈ Architecture
Request Flow
SIN-Zeus β A2A JSON-RPC β Gradio/FastAPI β opencode CLI β GitHub Commit
Components
- FastAPI Backend:
/a2a/v1endpoint, health checks, agent-card - Gradio Frontend: Manual task submission, status, logs
- Coder Agent: Task queue, opencode integration, GitHub ops
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENCODE_API_KEY |
Yes | OpenCode API key |
GITHUB_TOKEN |
Yes | GitHub PAT with repo access |
HF_TOKEN |
No | Hugging Face token (for deployment) |
TELEGRAM_TOKEN |
No | Telegram notifications |
π‘ Interfaces
| Interface | URL | Protocol |
|---|---|---|
| Gradio UI | Space URL | HTTP |
| A2A API | /a2a/v1 |
JSON-RPC 2.0 |
| Health | /health |
HTTP JSON |
| Agent Card | /.well-known/agent-card.json |
JSON |
| Dashboard | https://a2a.delqhi.com/agents/sin-code-backend | Web |
π§ Usage
Via A2A (Standard)
curl -X POST https://delqhi-a2a-sin-code-backend.hf.space/a2a/v1 \
-H 'content-type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [
{
"type": "data",
"data": {
"description": "Fix the plugin manifest schema validation",
"type": "plugin",
"issue_number": 1065
}
}
]
}
}
}'
Via Gradio UI
- Open the Space URL
- Fill in task description, select type, enter branch name
- Click "π Submit Task"
- View status and logs
π Sample Task Flow
- Receive Task: A2A message with description "Create a new MCP for WhatsApp"
- Generate Code: Call
opencode runwith specialized prompt - Create Files: Agent writes files to repository (through opencode)
- Commit: Automatic commit to target branch with issue reference
- Report: Status updated in task store, can create PR via separate step
π οΈ Supported Task Types
| Type | Description |
|---|---|
plugin |
OpenCode plugins (MCP servers) |
command |
CLI commands (sin-* binaries) |
tool |
Reusable utility functions |
backend |
API, database, business logic |
frontend |
UI components, Next.js, React |
fullstack |
Both frontend + backend |
π Development
Local Testing
# Prepare environment
export OPENCODE_API_KEY="your-key"
export GITHUB_TOKEN="your-token"
export REPO_DIR="/path/to/OpenSIN-Code"
# Run locally
python app.py
# Access at http://localhost:7860
Building Docker Image
docker build -t delqhi/a2a-sin-code-backend:latest .
docker run -p 7860:7860 -e OPENCODE_API_KEY -e GITHUB_TOKEN delqhi/a2a-sin-code-backend
π Security
- API Keys: Use Hugging Face Space secrets, never hardcoded
- GitHub Token: Scoped to specific repository (OpenSIN-Code)
- Network: Outbound only to opencode API and GitHub
- No Persistent Storage: Ephemeral filesystem (HF Space default)
π Monitoring
- Gradio UI: Real-time task status and logs
- HF Space: Logs via HF dashboard
- Dashboard: https://a2a.delqhi.com/agents/sin-code-backend
- Telegram: Optional notifications
π Deployment
To Hugging Face Spaces
# Create Space (CPU-Basic required)
huggingface-cli repo create delqhi-a2a-sin-code-backend --type space --space-sdk docker
# Set secrets
huggingface-cli variable set OPENCODE_API_KEY "$OPENCODE_API_KEY" --repo delqhi-a2a-sin-code-backend --type space
huggingface-cli variable set GITHUB_TOKEN "$GITHUB_TOKEN" --repo delqhi-a2a-sin-code-backend --type space
# Push code
git init
git remote add origin https://huggingface.co/spaces/delqhi/delqhi-a2a-sin-code-backend
git add .
git commit -m "Deploy A2A-SIN-Code-backend v1.0.0"
git push --force origin main
# Set hardware to CPU-Basic (via HF UI or API)
IMPORTANT: Set hardware to cpu-basic in Space settings. Never use GPU/ZeroGPU for coding agents.
π Support
- Dashboard: https://a2a.delqhi.com/agents/sin-code-backend
- Docs Tab: Google Docs
- Team Manager: SIN-Zeus
Last Updated: 2026-04-07
Agent: A2A-SIN-Code-backend v1.0.0
Owner: Team - Coder / SIN-Zeus