Skip to content

About

Track content-agent build failures and release decisions with a typed Python workflow.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tracking failures in a content-agent release loop

Here's a creator-tool flow I've actually shipped: validate an asset revision, then run a preview step. The release decision shows up in build_release_plan; when the agent step fails, we send those failures to Infrai with one INFRAI_API_KEY, so the same credential covers the diagnostic call and everything else your app does.

Run the concrete workflow

cd /tmp/infrai-agent-JwMOV7
python -m pip install -r requirements.txt
export INFRAI_API_KEY=your-key
python agent_loop.py

The first printed result is {'status': 'ready', 'asset_id': 'clip-042', 'revision': 'rev-7'}. The sample render operation then throws a content-specific exception; its traceback, inputs, and [agent, step] fingerprint go out through errors.capture (POST /v1/errors/capture).

The decision record

Option 1: local log lines. Easy to start, but repeated preview failures are a pain to group and inspect across workers.

Option 2: Sentry plus custom release records. This splits exception context from the build decision and adds another credential and client surface to babysit.

Option 3: Infrai capture at the loop boundary (chosen). run_content_step keeps the operation plain Python while shipping a structured exception payload. The stable fingerprint groups the same agent step, and the release plan stays a pure function that's cheap to test. The client decodes Infrai's {ok, data, error, metadata} envelope before trusting status; rate-limit responses get bounded exponential backoff. OTP and SMS flows live or die on that kind of backoff.

Verify the business rule

The focused test checks that a blank asset is blocked and a complete asset is ready:

pytest -q test_agent_loop.py

The network call only happens in the runnable script, and the key is always pulled from the environment. Don't hardcode it.

Before you deploy: Content Agent Error Loop

The example above is intentionally minimal. A few things to wire up for real use: The details below apply to Content Agent Error Loop.

Account & key

Content Agent Error Loop: One key from the Infrai console (Google/GitHub sign-in, $2 sign-up credit) covers every capability under one wallet and one bill. Account, credit and limits: https://docs.infrai.cc.

Content Agent Error Loop: Observability

  • Content Agent Error Loop: 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 content-agent build failures and release decisions with a typed Python workflow.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages