Skip to content

feat(caretaker-triage): implement LLM triage orchestrator, GCS debug logger, and container build - #28307

Closed
chadd28 wants to merge 4 commits into
google-gemini:mainfrom
chadd28:feat/triage-orchestrator
Closed

feat(caretaker-triage): implement LLM triage orchestrator, GCS debug logger, and container build#28307
chadd28 wants to merge 4 commits into
google-gemini:mainfrom
chadd28:feat/triage-orchestrator

Conversation

@chadd28

@chadd28 chadd28 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements LLM inference orchestration (triage_orchestrator.py) using Antigravity SDK, structured GCS debug logging (utils/agent_logger.py), and the Cloud Run Job container build definition (Dockerfile / requirements.txt).

Includes a comprehensive end-to-end integration test suite (tests/test_integration_main.py).

Note on PR Size: Actual production code is ~160 lines total; 216 lines are in the integration test file.

Details

  • triage_orchestrator.py: Invokes the Antigravity Agent with read-only tool policies (allow/deny), system instructions, and triage skill prompts.
  • utils/agent_logger.py: Serializes Antigravity Agent resolved stream chunks to JSON and uploads debug logs to GCS.
  • tests/test_integration_main.py: End-to-end integration test suite verifying the worker execution loop across main.py and IssuesStore.

Related Issues

How to Validate

  1. Run unit and integration test suite:
cd tools/caretaker-agent/cloudrun/triage-worker
PYTHONPATH=. venv/bin/python3 -m unittest discover -s tests -t .

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@chadd28
chadd28 requested a review from a team as a code owner July 8, 2026 00:45
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational infrastructure for the Caretaker Triage Cloud Run worker. It introduces the orchestration layer for LLM-based issue triage, integrates Firestore for distributed locking to prevent race conditions, and implements a Pub/Sub-based egress mechanism for performing GitHub actions like labeling and commenting. These changes provide the necessary plumbing to automate issue triage workflows within the Cloud Run environment.

Highlights

  • LLM Triage Orchestration: Implemented the core triage orchestrator logic to handle issue processing via LLM inference.
  • Cloud Run Worker Implementation: Added the main entrypoint for the Cloud Run Job worker, including environment variable parsing and Firestore lock management.
  • Pub/Sub Egress Integration: Introduced utility functions to publish label and comment actions to Google Cloud Pub/Sub.
  • Dependency Updates: Added google-cloud-pubsub to requirements.txt to support asynchronous egress actions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the size/m A medium sized PR label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 596
  • Additions: +596
  • Deletions: -0
  • Files changed: 8

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a Cloud Run Job worker for issue triage, including the main execution loop in main.py, a stubbed triage orchestrator, and Pub/Sub egress utilities for sending label and comment actions. Feedback on the changes highlights a potential vulnerability to unhandled AttributeError exceptions during payload parsing and validation if the decoded JSON is not a dictionary or if expected fields are missing.

Comment thread tools/caretaker-agent/cloudrun/triage-worker/main.py
@github-actions github-actions Bot added the size/l A large sized PR label Jul 8, 2026
@chadd28 chadd28 closed this Jul 8, 2026
@chadd28

chadd28 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Will re-open this PR after previous #28306 is merged and this branch is rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant