adk-samples icon indicating copy to clipboard operation
adk-samples copied to clipboard

feat(go/github-bots): add issue-triage bot + reusable workflow

Open karolpiotrowicz opened this issue 5 months ago • 0 comments

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.New agent driven by typed functiontool.New[Args, Result] tools;
  • headless execution via runner.Runner + an in-memory session, consuming the iter.Seq2[*session.Event, error] stream;
  • calling the GitHub REST (go-github) and GraphQL APIs from inside tools;
  • a pure/impure split (triage.go vs github.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: actionlint clean.
  • Manual dry-run against google/adk-go via 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/v66 and github.com/joho/godotenv (this module only).

karolpiotrowicz avatar Jun 12 '26 11:06 karolpiotrowicz