Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
869d505
Updated agent.py and triage workflow for auto assignment.
llalitkumarrr Mar 20, 2026
e3df1dc
Fix print statement syntax in main.py
llalitkumarrr Mar 23, 2026
bb3b19f
Change REPO environment variable to use secrets
llalitkumarrr Mar 23, 2026
546043c
Fix print statement syntax in main.py
llalitkumarrr Mar 23, 2026
2bf4fe6
Update GitHub token in triage workflow
llalitkumarrr Mar 23, 2026
6319fba
Updated main.py for need owner.
llalitkumarrr Mar 23, 2026
9cc129c
Change owner assignment function in agent.py
llalitkumarrr Mar 23, 2026
adf0ee0
Reorder GTech owners and update variable names
llalitkumarrr Mar 23, 2026
a0ca790
Simplify owner assignment instruction in agent.py
llalitkumarrr Mar 23, 2026
cd2b981
Refactor triaging agent comments for clarity
llalitkumarrr Mar 23, 2026
2b57be8
Update agent.py
llalitkumarrr Mar 23, 2026
b329156
Fix print statement formatting for assignee message
llalitkumarrr Mar 23, 2026
9e11f00
Update agent.py
llalitkumarrr Mar 23, 2026
dda6949
Clean up debug prints in agent.py
llalitkumarrr Mar 23, 2026
3299761
Remove print statement from main.py
llalitkumarrr Mar 23, 2026
7caa8af
Update triage workflow
llalitkumarrr Mar 23, 2026
2a54461
Remove commented out needs_owner assignment
llalitkumarrr Mar 23, 2026
655e813
Refactor print statements and clean up code
llalitkumarrr Mar 23, 2026
bb12582
Update repository condition in triage workflow
llalitkumarrr Mar 23, 2026
bf2af49
Clean up formatting in add_label_to_issue function
llalitkumarrr Mar 23, 2026
9922b60
Upgrade mcp minimum version requirement from version 1.23.0 to versio…
llalitkumarrr Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
if: >-
github.repository == 'google/adk-python' && (
github.event_name == 'schedule' ||
github.event.action == 'opened' ||
github.event.label.name == 'planned'
github.event.action == 'opened'
)
permissions:
issues: write
Expand Down
58 changes: 47 additions & 11 deletions contributing/samples/adk_triaging_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"workflow": "DeanChensj",
}


LABEL_TO_GTECH = ["klateefa", "llalitkumarrr", "surajksharma07"]

LABEL_GUIDELINES = """
Label rubric and disambiguation rules:
- "documentation": Tutorials, README content, reference docs, or samples.
Expand Down Expand Up @@ -121,15 +124,16 @@ def list_untriaged_issues(issue_count: int) -> dict[str, Any]:

existing_component_labels = issue_labels & component_labels
has_component = bool(existing_component_labels)
has_planned = "planned" in issue_labels
# has_planned = "planned" in issue_labels

# Determine what actions are needed
needs_component_label = not has_component
needs_owner = has_planned and not assignees
# needs_owner = has_planned and not assignees
needs_owner = not assignees

# Include issue if it needs any action
if needs_component_label or needs_owner:
issue["has_planned_label"] = has_planned
# issue["has_planned_label"] = has_planned
issue["has_component_label"] = has_component
issue["existing_component_label"] = (
list(existing_component_labels)[0]
Expand All @@ -146,7 +150,6 @@ def list_untriaged_issues(issue_count: int) -> dict[str, Any]:

def add_label_to_issue(issue_number: int, label: str) -> dict[str, Any]:
"""Add the specified component label to the given issue number.

Args:
issue_number: issue number of the GitHub issue.
label: label to assign
Expand Down Expand Up @@ -177,6 +180,40 @@ def add_label_to_issue(issue_number: int, label: str) -> dict[str, Any]:
}


def assign_gtech_owner_to_issue(issue_number: int) -> dict[str, Any]:
"""Assign an owner from the GTech team to the given issue number.
This is go to option irrespective of component label or planned label, as long as the issue needs an owner.

All unassigned issues will be considered for GTech ownership. Unassigned issues will seperated in two categories: issues with type "Bug" and issues with type "Feature". Then bug issues and feature issues will be equally assigned to the Gtech members in such a way that every day all members get equal number of bug and feature issues.

Args:
issue_number: issue number of the GitHub issue.

Returns:
The status of this request, with the assigned owner when successful.
"""
print(f"Attempting to assign GTech owner to issue #{issue_number}")
gtech_assignee = LABEL_TO_GTECH[issue_number % len(LABEL_TO_GTECH)]
if not gtech_assignee:
return {
"status": "warning",
"message": f"No gtech_assignee found, will add any assignee",
}
assignee_url = (
f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/assignees"
)
try:
response = post_request(assignee_url, assignee_payload)
except requests.exceptions.RequestException as e:
return error_response(f"Error: {e}")

return {
"status": "success",
"message": response,
"assigned_owner": gtech_assignee,
}


def add_owner_to_issue(issue_number: int, label: str) -> dict[str, Any]:
"""Assign an owner to the issue based on the component label.

Expand Down Expand Up @@ -259,7 +296,7 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:

Each issue will have flags indicating what actions are needed:
- `needs_component_label`: true if the issue needs a component label
- `needs_owner`: true if the issue needs an owner assigned (has 'planned' label but no assignee)
- `needs_owner`: true if the issue needs an owner assigned

For each issue, perform ONLY the required actions based on the flags:

Expand All @@ -271,8 +308,8 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
- Otherwise → do not change the issue type

2. **If `needs_owner` is true**:
- Use `add_owner_to_issue` to assign an owner based on the component label
- Note: If the issue already has a component label (`has_component_label: true`), use that existing label to determine the owner
- Use `assign_gtech_owner_to_issue` to assign an owner.


Do NOT add a component label if `needs_component_label` is false.
Do NOT assign an owner if `needs_owner` is false.
Expand All @@ -282,19 +319,18 @@ def change_issue_type(issue_number: int, issue_type: str) -> dict[str, Any]:
placeholders (never output text like "[fill in later]").
- Justify the chosen label with a short explanation referencing the issue
details.
- Mention the assigned owner only when you actually assign one (i.e., when
the issue has the 'planned' label).
- Mention the assigned owner only when you actually assign one.
- If no label is applied, clearly state why.

Present the following in an easy to read format highlighting issue number and your label.
- the issue summary in a few sentence
- your label recommendation and justification
- the owner of the label if you assign the issue to an owner (only for planned issues)
- the owner, if you assign the issue to an owner
""",
tools=[
list_untriaged_issues,
add_label_to_issue,
add_owner_to_issue,
assign_gtech_owner_to_issue,
change_issue_type,
],
)
2 changes: 1 addition & 1 deletion contributing/samples/adk_triaging_agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def fetch_specific_issue_details(issue_number: int):

# Determine what actions are needed
needs_component_label = not has_component
needs_owner = has_planned and not has_assignee
needs_owner = not has_assignee

if needs_component_label or needs_owner:
print(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies = [
"graphviz>=0.20.2, <1.0.0", # Graphviz for graph rendering
"httpx>=0.27.0, <1.0.0", # HTTP client library
"jsonschema>=4.23.0, <5.0.0", # Agent Builder config validation
"mcp>=1.23.0, <2.0.0", # For MCP Toolset
"mcp>=1.24.0, <2.0.0", # For MCP Toolset
"opentelemetry-api>=1.36.0, <1.39.0", # OpenTelemetry - keep below 1.39.0 due to current agent_engines exporter constraints.
"opentelemetry-exporter-gcp-logging>=1.9.0a0, <2.0.0",
"opentelemetry-exporter-gcp-monitoring>=1.9.0a0, <2.0.0",
Expand Down
Loading