Class AdkTriagingAgent
google/adk-java.
This is the Java port of the Python adk_triaging_agent/agent.py, adapted to the actual
label taxonomy of google/adk-java (which, unlike adk-python, does not use per-component
labels). The agent uses Gemini to:
- recommend a topic/kind label for each open issue (e.g.
bug,enhancement,documentation,question), - round-robin assign owners from a configurable triager rotation.
All GitHub access goes through the shared GitHubTools (backed by the
org.kohsuke:github-api client) that this sample reuses with the ADK Docs Release Analyzer. Tool
methods are exposed as FunctionTools and use snake_case via Annotations.Schema so the
function declarations seen by the model match the Python implementation. Each tool returns an
ImmutableMap envelope — {"status": "success", ...} on success,
{"status": "error", "message": "..."} on failure — matching the Python contract.
NOTE: COMPONENT_LABELS contains labels that actually exist in google/adk-java
as of this writing. gtechRotation() cannot be derived from any public source (adk-java
has no CODEOWNERS file), so it defaults to an obvious placeholder and must be supplied at
runtime via the GTECH_ASSIGNEES environment variable (a comma-separated list of GitHub
handles). Real triager handles never need to live in source.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.collect.ImmutableSet<String> The set of labels the agent is allowed to apply.static final StringLabel rubric used in the agent's system instruction.static 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 issueNumber, String label) Adds the specified label to a GitHub issue, validating it is on the allowlist.assignGtechOwnerToIssue(int issueNumber) Round-robin assigns a gTech triager to the issue usingissue_number % N.static com.google.common.collect.ImmutableList<String> Round-robin rotation of triagers.listUntriagedIssues(int issueCount) Lists open issues that still need triaging.static LlmAgentBuilds theLlmAgent.
-
Field Details
-
COMPONENT_LABELS
The set of labels the agent is allowed to apply. These are real labels ingoogle/adk-java. Unlike adk-python, adk-java has no per-component labels, so this is a flat allowlist of topic/kind labels rather than a label→owner map.Insertion order is preserved (via
ImmutableSet) for deterministic enumeration. -
LABEL_GUIDELINES
Label rubric used in the agent's system instruction. Describes the realgoogle/adk-javalabels so the model classifies issues using labels that exist in the repo.- See Also:
-
ROOT_AGENT
Exposed foradk web/ dev-UI agent loaders that look up apublic static final BaseAgent ROOT_AGENTfield on the class.
-
-
Method Details
-
gtechRotation
Round-robin rotation of triagers. Issues are assigned viaissue_number % N. Sourced from theGTECH_ASSIGNEESenvironment variable (comma-separated GitHub handles); falls back toPLACEHOLDER_ROTATIONwhen unset.Read lazily (per call) rather than at class load, matching the lazy-accessor pattern in
Settings: this keeps the class loadable in tests/agent loaders and lets the environment be overridden before the rotation is first consulted. -
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. -
listUntriagedIssues
public static com.google.common.collect.ImmutableMap<String,Object> listUntriagedIssues(int issueCount) Lists open issues that still need triaging. An issue is considered untriaged if it is missing a recognized label OR it has no assignee. Each returned entry is a compact map (number, title, body, url, labels, plus the triage flags) rather than the full GitHub issue payload, to keep the model's context small. -
addLabelToIssue
-
assignGtechOwnerToIssue
-