# AI Actor Auto Healer & Issue Resolver (`madeingermany/auto-issue-healer`) Actor

Autonomous cloud agent that continuously monitors all your Apify actors for open user issues, investigates root causes using Gemini LLM inference, reproduces errors, generates code fixes, and automatically builds & publishes updated versions to Apify.

- **URL**: https://apify.com/madeingermany/auto-issue-healer.md
- **Developed by:** [Made In Germany](https://apify.com/madeingermany) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Actor Auto Healer & Issue Resolver

An autonomous cloud agent built for Apify that continuously monitors all live actors in your account for open user issues, diagnoses root causes using Gemini LLM reasoning, reproduces errors, synthesizes clean code fixes, and automatically builds and publishes updated versions directly on Apify Cloud.

### Features

- **Continuous Issue Monitoring**: Scans live store actors for new open issues reported by users.
- **Agentic Code Diagnosis**: Uses Google Gemini to perform root cause analysis on scraper crashes, HTML selector changes, pagination limits, and rate limits.
- **Automated Cloud Rebuilds**: Patches actor source files, increments versions, and triggers official Apify builds (`tag=latest`).
- **Autonomous Schedule**: Designed to run automatically via Apify Cloud Scheduler (e.g. every 30 minutes) for round-the-clock healing.
- **Fail-Safe Fallbacks**: Handles quota limits and platform constraints gracefully with comprehensive audit reports in the Apify Dataset.

### Configuration

- `geminiApiKey`: Your Google Gemini API Key.
- `apifyToken`: Apify API token with permissions to manage actors and builds.
- `targetActorId`: (Optional) Limit inspection to a single actor.
- `targetIssueId`: (Optional) Target a specific issue ID directly.
- `autoPublish`: Set to `true` to deploy and publish fixes automatically.
- `dryRun`: Set to `true` to test diagnosis without modifying live actors.

# Actor input Schema

## `geminiApiKey` (type: `string`):

Google Gemini API Key for LLM agentic reasoning and code synthesis. Defaults to pre-configured environment variable.

## `apifyToken` (type: `string`):

Optional token override. If omitted, uses APIFY_TOKEN environment variable from container context.

## `targetActorId` (type: `string`):

Specific Actor to inspect and heal. If left empty, scans all live published actors for open issues.

## `targetIssueId` (type: `string`):

Specific issue ID to resolve immediately (e.g. fvE5Xe1MRZgLGGCFo). If left empty, inspects all open issues found.

## `includeReviews` (type: `boolean`):

When enabled, monitors all customer reviews (from 1-star to 5-star). Any review stating an issue, bug, limitation, or friction triggers automatic issue detection and solution implementation.

## `targetReviewId` (type: `string`):

Specific review ID to inspect and heal immediately (e.g. amyteBcPWqEBCQ1dU).

## `forceReheal` (type: `boolean`):

When enabled, re-evaluates all reviews and issues even if previously resolved in past cycles.

## `modelName` (type: `string`):

Gemini model to use for agentic code generation and diagnosis.

## `autoPublish` (type: `boolean`):

When true, automatically updates the actor's version files and triggers a new cloud build on Apify.

## `dryRun` (type: `boolean`):

If enabled, performs diagnosis and generates the code fix without modifying or building the live actor.

## Actor input object example

```json
{
  "geminiApiKey": "AQ.Ab8RN6JslRhBpMstsxgAVTTKYHfi4JubX9Zw6EEfL6dgn0jZHA",
  "includeReviews": true,
  "forceReheal": false,
  "modelName": "gemini-3.5-flash",
  "autoPublish": true,
  "dryRun": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "geminiApiKey": "AQ.Ab8RN6JslRhBpMstsxgAVTTKYHfi4JubX9Zw6EEfL6dgn0jZHA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("madeingermany/auto-issue-healer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "geminiApiKey": "AQ.Ab8RN6JslRhBpMstsxgAVTTKYHfi4JubX9Zw6EEfL6dgn0jZHA" }

# Run the Actor and wait for it to finish
run = client.actor("madeingermany/auto-issue-healer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "geminiApiKey": "AQ.Ab8RN6JslRhBpMstsxgAVTTKYHfi4JubX9Zw6EEfL6dgn0jZHA"
}' |
apify call madeingermany/auto-issue-healer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,madeingermany/auto-issue-healer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Xk53M5sXBjFbeGt4l/builds/Ru4o1NoTNPMqe3Bat/openapi.json
