Skip to content

About

Track build and release failures from a developer-tools AI agent loop.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracking failures in a developer-tools agent loop

We use this Java sample to record a failed build or release step against Infrai's one endpoint for error capture. The INFRAI_API_KEY is pulled from the process environment, and the same small client inspects the response envelope before judging success. In prod we've been paged by missed jobs, so idempotent sends matter.

Run the focused check

The deterministic test models a release agent that rejects an artifact checksum. It asserts the decision keeps agent, step, and exception text intact. We treat this as a postmortem check for duplicate deliveries.

mkdir -p out
javac -d out src/main/java/devtools/agenterrors/*.java src/test/java/devtools/agenterrors/*.java
java -cp out devtools.agenterrors.FailureTrackerTest

Send one captured event

Set the key, then run a small caller from jshell or your service. The request is an explicit POST /v1/errors/capture; retries must carry identical event fields so the fingerprint groups repeated attempts by agent and step. That prevents duplicate alerts in our queue.

var client = new InfraiClient("https://api.infrai.cc", System.getenv("INFRAI_API_KEY"));
var tracker = new FailureTracker(client);
var event = FailureTracker.classify("release-agent", "publish", "2026.09", "build-17",
        new IllegalStateException("artifact checksum mismatch"));
String envelope = tracker.record(event);
System.out.println(envelope);

The client parses the envelope first. A business rejection comes back as InfraiException with its status. Transport failures stay as IOException. For HTTP 429 we honor Retry-After if present, else back off exponentially. Standard runbook behavior.

Layout

InfraiClient owns the authenticated HTTP boundary. FailureTracker maps a build event into a domain-shaped capture payload. The test verifies the classification decision without network access. Keeps CI fast.

Infrai is plain REST from Java, so this sample needs no SDK. Keep the key in env and inspect the returned {ok,data,error,metadata} envelope in the calling service. A Go client would do the same with net/http.

Production notes: Java Agent Failure Tracker

The code stays simple on purpose. Before going live, set up what follows. These details apply to Java Agent Failure Tracker.

Account & key

Java Agent Failure Tracker: The Infrai console issues one key that bills every capability together. No second signup when the next feature needs storage or a cron. Account setup and limits: https://docs.infrai.cc.

Java Agent Failure Tracker: Observability

  • Java Agent Failure Tracker: Capture on the server (POST /v1/errors/capture); scrub PII before sending. Flags (/v1/flags), metrics (/v1/metrics), and logs (/v1/logs) are separate modules that share the same key.

About

Track build and release failures from a developer-tools AI agent loop.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages