feat(go/github-bots): add issue-triage bot + reusable workflow
Draft for review. First bot in a new
go/github-bots/category. A companion adk-go PR (a thin caller workflow) will reference the reusable workflow added here.
Summary
Adds go/github-bots/ — a category for GitHub-automation bots built with ADK Go — and its first bot, issue-triage.
The bot triages open GitHub issues by setting the issue type (Bug/Feature/Task) and applying one categorization label (bug/enhancement/documentation/question) from a configurable allowlist. An issue is "untriaged" when it has no type and/or none of the allowlisted labels.
It's a standalone Go module pinning the released google.golang.org/adk v1.4.0, and demonstrates:
- an
llmagent.Newagent driven by typedfunctiontool.New[Args, Result]tools; - headless execution via
runner.Runner+ an in-memory session, consuming theiter.Seq2[*session.Event, error]stream; - calling the GitHub REST (
go-github) and GraphQL APIs from inside tools; - a pure/impure split (
triage.govsgithub.go): deterministic facts in code, fuzzy classification in the model.
Safety: Go-side allowlist validation + per-issue authorization (the agent may only mutate issues it legitimately targeted — defense against prompt injection in issue bodies), untrusted-content fencing, -dry-run chokepoint, and an OnToolError callback; the run fails loudly so CI surfaces errors.
Run it on any repo (no code copy)
Adds a reusable workflow .github/workflows/go-issue-triage.yml (on: workflow_call). A target repo adds a thin caller workflow and the bot writes using the caller's own GITHUB_TOKEN (a reusable workflow runs in the caller's context) — no PAT/App needed. Caller snippet is in the bot's README.
Testing
go build+go test -race ./...against released v1.4.0 — pass.gofumpt -extra,golangci-lint(default config),go vet,go mod tidy -diff— clean.- Reusable workflow:
actionlintclean. - Manual dry-run against
google/adk-govia Vertex AI: correctly types/labels real issues (e.g. sweep → #1001/#965 Feature, #948 Bug), skips already-triaged issues and PR numbers, performs zero writes.
Notes
- Org-level issue types must be enabled (they are for
google: Bug/Feature/Task). - Ported and hardened from the Python
adk_triaging_agent; owner assignment and component labels are intentionally omitted (natural extensions). - Adds deps
github.com/google/go-github/v66andgithub.com/joho/godotenv(this module only).