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

feat(go/github-bots): add stale-issues bot + reusable workflow

Open karolpiotrowicz opened this issue 5 months ago • 0 comments

Draft, stacked on #2079. This branch builds on the issue-triage PR (#2079), so until that merges this diff also shows #2079's files. Review/merge #2079 first; afterward this PR's diff reduces to just go/github-bots/stale-issues/ + .github/workflows/go-stale-issues.yml (plus a one-line entry in go/github-bots/README.md and go/README.md).

Summary

Adds the second bot in the go/github-bots/ category: stale-issues, an autonomous stale-issue auditor.

Unlike a timestamp-only "stale bot", it reconstructs each issue's conversation history (one GraphQL query) and uses an LLM to distinguish a maintainer asking the author a question (a stale candidate) from a status update (still active). It warns, then closes issues left waiting on the author.

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 (iter.Seq2 stream);
  • GitHub REST (go-github) + GraphQL from inside tools;
  • bounded concurrency with errgroup, Temperature: 0, and a pure/impure split (state.go vs github.go);
  • safe re-runs (ordered mutations) and self-recognition (ignores its own prior comments to avoid spam).

It also supports Vertex AI (ADC) in addition to a Gemini API key, for parity with the issue-triage bot.

Run it on any repo (no code copy)

Adds a reusable workflow .github/workflows/go-stale-issues.yml (on: workflow_call). A target repo adds a thin caller workflow; the bot writes with the caller's own GITHUB_TOKEN (reusable workflows run in the caller's context). Maintainer logins are passed as an input (the repo-scoped token can't list collaborators).

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: reconstructs history, resolves bot identity, and decides correctly (e.g. #948 → "ACTIVE, last action by author, no action"); zero writes.

Notes

  • Ported and hardened from the Python ADK stale-issue agent.
  • Adds deps github.com/google/go-github/v66, github.com/joho/godotenv, golang.org/x/sync (this module only).

karolpiotrowicz avatar Jun 12 '26 11:06 karolpiotrowicz