Add missing REST endpoint POST /api/v1/issues/respond to the AI service, completing the REST API coverage for Tier 1 operations. The endpoint wraps the existing gRPC IssueService.GenerateResponseAsync method, accepting issue metadata (title, body, comments) and returning an AI-generated response with follow-up questions. This enables the Go server's AI client (modules/ai/client.go) to call the issue response operation via REST, matching the pattern used by other Tier 1 operations (triage, review, explain).
8 lines
9.7 KiB
JSON
8 lines
9.7 KiB
JSON
{
|
|
"id": "note-1770873136752-o4746ed40",
|
|
"title": "AI Activation",
|
|
"content": " ---\n 1. How Activation Works (Current State)\n\n The API layer is complete — all activation can happen via the v2 API right now:\n\n System Admin (app.ini):\n [ai]\n ENABLED = true\n DEFAULT_PROVIDER = claude\n DEFAULT_MODEL = claude-sonnet-4-20250514\n CLAUDE_API_KEY = sk-ant-...\n ALLOW_AUTO_RESPOND = true\n ALLOW_AUTO_REVIEW = true\n ALLOW_AGENT_MODE = false\n\n Org Admin (API):\n PUT /api/v2/orgs/{org}/ai/settings\n { \"provider\": \"claude\", \"model\": \"claude-sonnet-4-20250514\", \"api_key\": \"sk-ant-...\" }\n\n Repo Admin (API):\n PUT /api/v2/repos/{owner}/{repo}/ai/settings\n { \"auto_respond_issues\": true, \"auto_review_prs\": true, \"auto_triage_issues\": true }\n\n What's missing: There's no web UI for any of this. No repo settings page, no org settings page. The\n admin panel has an AI Learning page for CI/CD error patterns, but nothing for the AI operations\n system. We need:\n\n - templates/repo/settings/ai.tmpl — repo AI settings page (toggles for each operation)\n - routers/web/repo/setting/ai.go — web handler (following the Actions settings pattern)\n - Org-level AI settings page\n - Nav entries in the settings sidebar\n\n ---\n 2. gitcaddy-ai Service Gaps\n\n The .NET service needs one key addition. The Go client calls POST /api/v1/issues/respond (in\n modules/ai/client.go), but that REST endpoint doesn't exist in gitcaddy-ai — it's only available via\n gRPC.\n\n Existing REST endpoints in gitcaddy-ai:\n ┌────────────────────────────────────┬─────────┐\n │ Endpoint │ Status │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/review/pull-request │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/issues/triage │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/issues/suggest-labels │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/code/explain │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/code/summarize │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/docs/generate │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/docs/commit-message │ Exists │\n ├────────────────────────────────────┼─────────┤\n │ POST /api/v1/issues/respond │ MISSING │\n └────────────────────────────────────┴─────────┘\n The business logic for issue response exists in the .NET service layer — it just needs the REST\n controller endpoint added.\n\n ---\n 3. Testable AI Processes by Tier\n\n Tier 1 — Light Operations (gRPC/REST, seconds)\n\n These can be tested end-to-end once the missing REST endpoint is added:\n ┌───────────────┬─────────────────────┬───────────────────────┬─────────────────────────────────────┐\n │ Operation │ Trigger │ What it does │ Test scenario │\n ├───────────────┼─────────────────────┼───────────────────────┼─────────────────────────────────────┤\n │ Issue Triage │ New issue created │ AI suggests labels + │ Create issue → verify labels │\n │ │ │ priority │ applied │\n ├───────────────┼─────────────────────┼───────────────────────┼─────────────────────────────────────┤\n │ Issue │ New issue or │ AI posts helpful │ Create issue → verify bot comment │\n │ Response │ @mention │ reply │ appears │\n ├───────────────┼─────────────────────┼───────────────────────┼─────────────────────────────────────┤\n │ PR Review │ PR opened or pushed │ AI reviews code diff │ Open PR → verify review comment │\n │ │ │ │ posted │\n ├───────────────┼─────────────────────┼───────────────────────┼─────────────────────────────────────┤\n │ Code Explain │ Manual API call │ AI explains code │ POST /ai/explain with file path + │\n │ │ │ selection │ line range │\n ├───────────────┼─────────────────────┼───────────────────────┼─────────────────────────────────────┤\n │ Workflow │ Push with workflow │ AI checks workflow │ Push modified │\n │ Inspect │ changes │ for issues │ .gitea/workflows/*.yml │\n └───────────────┴─────────────────────┴───────────────────────┴─────────────────────────────────────┘\n Simplest to test first: Issue Triage — it's the most self-contained (calls /issues/triage, applies\n labels, done).\n\n Second: PR Review — already has the REST endpoint and produces a visible result (review comment).\n\n Third: Issue Response — needs the missing REST endpoint added to gitcaddy-ai first.\n\n Tier 2 — Agent Operations (Actions runners, minutes)\n ┌───────────┬───────────────────┬──────────────────────────────────┬────────────────────────────────┐\n │ Operation │ Trigger │ What it does │ Test scenario │\n ├───────────┼───────────────────┼──────────────────────────────────┼────────────────────────────────┤\n │ Agent Fix │ ai-fix label │ Claude Code clones repo, │ Add label → verify Actions run │\n │ │ added to issue │ investigates, creates PR │ → verify PR created │\n └───────────┴───────────────────┴──────────────────────────────────┴────────────────────────────────┘\n This needs:\n - A runner labeled ai-runner with Claude Code CLI installed\n - services/ai/agent.go fleshed out to actually dispatch the Actions workflow (currently a\n placeholder)\n - The workflow template that runs Claude Code headless\n\n ---\n Recommended Next Steps (in order)\n\n 1. Add the missing REST endpoint in gitcaddy-ai (POST /api/v1/issues/respond) — quick, the logic\n exists\n 2. Build the repo AI settings web UI — following the Actions settings pattern so repo admins can\n toggle features in the browser\n 3. End-to-end test Issue Triage — simplest Tier 1 operation to validate the full pipeline (notifier →\n queue → AI service → label applied)\n 4. End-to-end test PR Review — validates the review comment posting path\n 5. Flesh out agent.go for Tier 2 — generate and dispatch the Actions workflow\n 6. Build org AI settings UI\n\n Which would you like to tackle first?",
|
|
"createdAt": 1770873136750,
|
|
"updatedAt": 1770873196027,
|
|
"tags": []
|
|
} |