Troubleshooting AgentFi Cloudflare Worker Integration
Common technical issues with AgentFi integration usually stem from Cloudflare Worker misconfigurations, DNS changes, or API token permission errors. Most issues are resolved by verifying that the Worker route is set to yourdomain.com/* and ensuring the API token uses the "Edit Cloudflare Workers" template. If discovery files like llms.txt display incorrect data, verify the management mode is set to "Managed" and allow 10 minutes for cache expiration.
How to fix a failing AgentFi health check?
The health check fails when the periodic request to /agentfi/health does not return the expected status. This indicates the Cloudflare Worker is not correctly intercepting or processing traffic for your domain.
* Verify the Worker exists in the Cloudflare "Workers & Pages" dashboard.
Ensure yourdomain.com/ is bound under Settings > Triggers > Routes.
* Confirm the domain uses Cloudflare DNS to allow Worker interception.
* Check cloudflarestatus.com for active service outages.
* Redeploy the Worker via the AgentFi Integration page "Redeploy" button.
Why is AgentFi verification failing?
Verification fails when the dashboard cannot receive a valid JSON response from https://yourdomain.com/agentfi/verify. The endpoint must return a status of "ok" along with a valid accountId and timestamp.
* Match the Client Domain in settings exactly to your site URL.
* Ensure the Base Path matches the Worker script (default is /agentfi).
* Confirm the Worker is deployed and the route is active.
* Visit https://yourdomain.com/agentfi/verify manually to check for JSON output.
How to resolve Cloudflare API token errors?
API token issues occur if the token lacks specific write permissions for Workers or is scoped to the incorrect Cloudflare account.
| Error Message | Likely Cause | Recommended Action |
|---|---|---|
| "Token is invalid or inactive" | Token revoked or expired | Create a new token in Cloudflare dashboard |
| "Failed to deploy" | Insufficient permissions | Use the "Edit Cloudflare Workers" template |
| "Wrong zones listed" | Incorrect account scope | Scope token to the account managing the domain |
To switch tokens, click Disconnect on the AgentFi Integration page and reconnect with the new credentials.
Why is the Worker not intercepting requests?
If paths like /llms.txt or /sitemap.xml show original site content instead of AgentFi content, the Worker route is likely misconfigured.
Set the Worker route pattern to yourdomain.com/ including the wildcard.
* Ensure the route is on the same zone/domain as the site.
Configure separate routes for subdomains, such as www.yourdomain.com/.
* Check real-time logs in the Cloudflare Worker dashboard for incoming traffic.
Why does llms.txt return incorrect content?
Incorrect content in discovery files is typically due to configuration settings or active edge caching.
* Change Discovery Files management mode from "Original" to "Managed."
* Allow 10 minutes for the standard cache TTL to expire.
* Use a cache-busting query parameter to bypass the current cache.
How to contact AgentFi support?
If the troubleshooting steps above do not resolve the issue, contact the technical support team for further assistance.
* Email: support@agentfi.com
* Required info: Your AgentFi account ID.
* Required info: Description of the problem and error messages.
Source: https://agentfi.tech/docs/troubleshooting