Add Self-Patching Agent for the Checkpoint Validation Pipeline - #4729
Open
olufiyin19 wants to merge 8 commits into
Open
Add Self-Patching Agent for the Checkpoint Validation Pipeline#4729olufiyin19 wants to merge 8 commits into
olufiyin19 wants to merge 8 commits into
Conversation
…dation for the Checkpoint Validation Agent
olufiyin19
requested review from
RissyRan,
abhinavclemson,
bvandermoon,
gagika,
gobbleturk,
khatwanimohit,
richjames0 and
vipannalla
as code owners
August 4, 2026 18:19
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
olufiyin19
requested review from
A9isha,
NuojCheng,
SurbhiJainUSC,
aireenmei,
darisoy,
dipannita08,
hengtaoguo,
huytransformer,
igorts-git,
jiangjy1982,
shralex and
xibinliu
as code owners
August 4, 2026 18:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the automated Fixer Agent sidecar (
agent_sidecar/) built natively on the Google GenAI Agent Development Kit (ADK). This is the fifth and final PR in the Checkpoint Validation Agent stack (building upon PR #4462, PR #4726, #4727, and #4728), completing the autonomous self-healing checkpoint conversion and validation loop.When checkpoint conversion or validation pipelines fail in Airflow across varied model architectures (e.g. Gemma, Llama, Deepseek, Mistral, Qwen), failures often stem from diagnosable root causes such as
remat_policyout-of-memory errors during evaluation, tensor shape transpositions, or missing configuration overrides. Previously, engineers had to manually inspect logs, formulate patches, lint code, re-trigger pipelines, and open pull requests by hand.This PR provides a containerized, continuously running sidecar service that monitors Google Cloud Storage for validation failure reports, autonomously diagnoses root causes using specialized inspection tools, applies fixes conforming to domain constraints, verifies code against strict repository linting standards (10.00/10 pylint), triggers Airflow validation DAGs, and opens clean GitHub pull requests without human intervention.
Key Implementation Details
adk_agent.pyusing the native Agent Development Kit (ADK), structured around a multi-stage prompt workflow (01_diagnose.txt,02_patch.txt,03_verify.txt, andmeta_agent.txt).* Distinguishing between evaluation vs. training tasks when configuring
remat_policy.* Using
remat_policy=minimalas the standard fallback for evaluation out-of-memory failures.* Escaping JSON braces in diagnostic prompts to prevent prompt injection or formatting collisions.
agent_sidecar/fixer/tools/)analyze_shapes.py: Compares expected vs. actual checkpoint tensor shapes to isolate parameter dimension mismatches.analyze_layer_activations.py: Integrates withlayer_metrics.pyto localize per-layer numerical drift or NaN/Inf contamination.run_linters.py: Runs automatedpylintandpyinkchecks on AI-generated patches, enforcing a strict 10.00/10 pylint score before committing code.trigger_airflow_dag.py: Programmatically re-triggers Airflow DAG runs to verify that code patches resolve the original failure end-to-end.github_branch_manager.py&create_pull_request.py: Automates branch creation, git staging, and GitHub PR submission with detailed root-cause summaries.gcs_poller.pyto continuously poll GCS buckets forFAILEDvalidation JSON reports, coordinated viastate_manager.pyto prevent duplicate repair attempts.Dockerfile&deploy_to_cloud_run.sh) for deployment to Google Cloud Run.Stack
5th PR in stack. Depends on the preceding upstream PR: #4728
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.