# Get an AI coding agent to fix a game bug without guessing

> Describe the smallest sequence that reproduces the problem, what you expected and what actually happened. Give the agent logs and project context, ask it to identify the cause, and repeat the failing sequence after the fix.

Source: https://envyui.com/blog/vibe-coded-game-bug-reports
Editorial date: 2026-11-12

“The game is broken. Fix everything” gives an agent too many possible targets. A useful report lets it reproduce one failure and distinguish a real fix from a change that only hides the symptom.

## Capture the smallest failing sequence

Write down the build or commit, platform, input device, starting state and exact steps. Add the expected and observed results:

```text
Build: local Windows test build, 1280x720, keyboard
Start: new game, player is standing in the first room
Steps: press Escape; choose Resume; press the move-right key
Expected: the menu closes and the player moves right
Observed: the menu closes, but the player remains still
Reproducible: 3 of 3 attempts in this build
```

Those numbers are an example. Use your real observations. If it happened once, say once. Include the relevant error text or a short recording when available, and remove credentials or personal information before sharing logs.

## Preserve the starting point

Save your project and use your normal version-control workflow before the agent edits files. Note any existing uncommitted work. This gives you a way to inspect the change and avoid overwriting unrelated work.

Ask the agent to inspect the relevant game and UI code, trace the state and present the cause supported by evidence. For the pause example, that may involve the pause controller, overlay stack and input handling. A screenshot of a closed menu cannot establish which state is still active.

## Ask for a focused repair

```text
Reproduce the pause/resume failure using the report above.
Inspect the existing pause and input systems before editing.
Identify the cause and make the smallest change that fixes it.
Preserve unrelated work and the existing menu design.
Run the relevant automated checks if available, then repeat the
reported sequence. List files changed, results and anything
you could not verify on this machine.
```

For a UI built with Envy, include the document and its [event and data contract](/blog/game-ui-contract-ai-agents). The contract helps the agent locate the boundary; it does not prove that the game handles each event correctly.

## Review the evidence

Read the diff for unrelated changes and placeholders. Confirm that any test asserts the behavior that failed, not merely that the scene loaded. Repeat the original sequence and one nearby case, such as opening Pause twice or using the supported cancel action.

If the bug depends on a controller, network connection or hardware the agent cannot access, record that limit and test on the real target. A report saying “not tested” is more useful than a confident but unsupported pass.

## Questions people ask

### What should I include in a game bug report for an AI agent?

Include the build and environment, starting state, reproduction steps, expected and observed behavior, and any relevant logs. Say what the agent can run and which files it may change.

### Why should the agent explain a cause before changing code?

A plausible fix can mask the symptom or break another path. Evidence about the cause makes the proposed change easier to review and test.

### Is a passing automated test enough to close a game bug?

It depends on what the test covers. Repeat the original failure path and run the relevant automated checks; input, rendering and device-specific cases may also need manual testing.
