Class AdkStaleAgent
java.lang.Object
com.example.adkstale.AdkStaleAgent
ADK Stale Issue Auditor for
google/adk-java.
This is the Java port of the Python adk_stale_agent/agent.py. Unlike a timestamp-only
"stale bot", it reconstructs each issue's Unified History Trace from a single GraphQL
query (comments, body edits, title renames, reopens, label events) and uses Gemini to reason
about the intent of the last action:
- If the author/user acted last → the issue is ACTIVE: the
stalelabel is removed (and, for a silent description edit GitHub does not notify on, maintainers are alerted). - If a maintainer asked a question and the inactivity threshold has passed → the issue
is marked
stale; after a further threshold it is closed. - If a maintainer gave a status update (or is talking to another maintainer) → no action.
Reads (the GraphQL history, maintainer list) go through GitHubStaleClient; writes
(comments, labels, closing) go through the shared GitHubTools so the dry-run and
target-repository guards are applied uniformly. Tool methods are exposed as FunctionTools
using snake_case via Annotations.Schema so the function declarations seen by the model match
the Python implementation, and each returns a {"status": "success" | "error", ...}
envelope.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LlmAgentExposed foradk web/ dev-UI agent loaders that look up apublic static final BaseAgent ROOT_AGENTfield on the class. -
Method Summary
Modifier and TypeMethodDescriptionaddLabelToIssue(int itemNumber, String labelName) addStaleLabelAndComment(int itemNumber) alertMaintainerOfEdit(int itemNumber) closeAsStale(int itemNumber) getIssueState(int itemNumber) removeLabelFromIssue(int itemNumber, String labelName) static LlmAgentBuilds theLlmAgent.
-
Field Details
-
ROOT_AGENT
Exposed foradk web/ dev-UI agent loaders that look up apublic static final BaseAgent ROOT_AGENTfield on the class.
-
-
Method Details
-
rootAgent
Builds theLlmAgent. Safe to call at class-init time: it only readsSettingsaccessors that never throw (noGITHUB_TOKENis required to construct the agent), so theROOT_AGENTfield andadk webagent loaders work without a token configured. -
getIssueState
-
addLabelToIssue
-
removeLabelFromIssue
-
addStaleLabelAndComment
-
alertMaintainerOfEdit
-
closeAsStale
-