> For the complete documentation index, see [llms.txt](https://docs.testvibe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testvibe.com/troubleshooting/generation-failed.md).

# Generation Failed

AI generation runs as a cloud agent. It can fail because the agent cannot reach the target site, your workspace is out of credits, a referenced secret is missing, or the feature instructions do not give the agent enough context.

## First Checks

1. Open the failed generation in TestVibe.
2. Read the visible failure message and any completed sections.
3. Confirm the target site URL is correct and reachable.
4. Confirm your workspace has enough credits in **Settings → Billing**.
5. Confirm any `{{secret:NAME}}` or `{{var:NAME}}` tokens in the feature match entries in **Settings → Variables & Secrets**.
6. For private apps, confirm the project's tunnel device is online.

## Common Causes

| Cause                        | What to check                                                            |
| ---------------------------- | ------------------------------------------------------------------------ |
| Insufficient credits         | Check your balance in Settings → Billing and top up if needed.           |
| Site unreachable             | Confirm the URL; for private apps, check the tunnel device.              |
| Secret token not found       | Add the named entry in Settings → Variables & Secrets.                   |
| Login or test data missing   | Add secrets and prerequisite steps.                                      |
| Vague feature instructions   | Improve the Gherkin scenario with visible actions and expected outcomes. |
| Agent or model misconfigured | Review the agent, model, and reasoning effort in Settings → AI Model.    |

## When Output Is Partial

Sometimes generation fails after producing useful notes, a feature draft, or a partial test file. Review the output before retrying. It may tell you exactly which selector, page, credential, or requirement was unclear.

## Retry Or Edit First

| Situation                              | Best next action                                          |
| -------------------------------------- | --------------------------------------------------------- |
| Temporary network or environment issue | Retry after the environment is healthy.                   |
| Missing secret or credit               | Fix setup, then regenerate.                               |
| Feature is too broad                   | Split it into smaller scenarios, then regenerate.         |
| Test intent is unclear                 | Edit the Gherkin, then regenerate.                        |
| Generated code is close but wrong      | Edit the test or refine instructions before regenerating. |

## Related Help

* [Troubleshoot failed generation](/ai-generation/troubleshoot-failed-generation.md)
* [Write good test instructions](/create-tests/write-good-test-instructions.md)
* [Missing secrets](/troubleshooting/missing-secrets.md)
* [Tunnel devices](/account-settings/tunnel-devices.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.testvibe.com/troubleshooting/generation-failed.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
