Fix a bug and check the fix

Hand a bug to your coding agent or fix it yourself, then have Rehearsal check the fix.

Once Rehearsal finds a bug, you decide what happens to it. You can hand it to your coding agent with one prompt or fix it yourself, and then Rehearsal writes a test from the bug's steps to check that the fix holds. If the bug is not a bug after all, you say so, and it leaves the list.

Everything here happens in the card under a bug's report. It opens with Copy prompt for your coding agent, and under a rule come Mark as fixed, Mark as not a bug and Same as another bug. Anyone who can read the bug can copy the prompt. The other three need the Manage projects and Use Re:agent permissions, which members have by default.

Hand it to your coding agent Link to Hand it to your coding agent

  1. Step 1: Copy the prompt

    Press Copy prompt for your coding agent. The button says Copied, and the card shows what it copied under Paste it into your coding agent, so you can read what your agent will be given. Copying starts nothing: no test and no check.

  2. Step 2: Paste it into your agent

    When Rehearsal sees your CLI signed in, the prompt is short and your agent reads the steps, the expected result and what happened with Rehearsal's tools. Otherwise the prompt carries the whole bug, so it works in any agent. Hand over one bug shows both.

  3. Step 3: Review the change

    Read what your agent changed and get it running where the bug was seen, then mark the bug fixed as the next section shows.

If your coding agent is not connected to Rehearsal yet, the Bugs page shows Connect your coding agent above the list. It copies one prompt that sets your agent up, and Find and fix bugs with your coding agent explains what the agent can do once it is.

Mark it fixed and check it Link to Mark it fixed and check it

Whether your agent fixed the bug or you did, you tell Rehearsal, and then Rehearsal checks it with a test.

  1. Step 1: Mark it fixed

    Press Mark as fixed. The card now reads Bug #5 is fixed and the bug's row shows Fixed. Undo puts the bug back where it was.

  2. Step 2: Create the test

    Under "Turn this into a test so it never happens again.", press Create test. Rehearsal writes a test from the bug's steps that checks the bug's Expected line, then runs it twice against the address where the bug was seen. The card says Making the test while it works.

  3. Step 3: Read the result

    When both runs pass, the card adds Rehearsal checked the fix. and Test created, with Open the test. The test now runs with your other tests, marked Regression in Tests, so a run catches the bug if it ever comes back. If the test sees the bug, the bug is open again and the card says The bug is still there.

Read the Expected line before you press Create test, because the test holds your app to it from then on. If it describes the wrong behaviour, the bug is not a bug, so say so instead. A bug seen in a phone app offers no test, because tests do not run on a phone yet.

Good to know

The test runs against the address where the bug was seen. If that was https://parcel.example and your fix runs only on http://localhost:3000, deploy the fix first, or the test finds the old code and the card says The bug is still there.

Check it with your coding agent Link to Check it with your coding agent

A coding agent connected to Rehearsal works in a different order, and the order matters. First, before any code changes, the agent asks Rehearsal to reproduce the bug: Rehearsal writes a test from the bug's steps and keeps it once the test has seen the bug happen. After the fix, the agent asks Rehearsal to run that same test again. Rehearsal checks a fix only for a bug that was reproduced, so the steps are always reproduce, fix, then check.

Until the fix is checked, the kept test is in Tests marked Reproduction, and it runs with your other tests only once Rehearsal has verified the fix. When the check passes, the bug shows Fixed with Rehearsal checked the fix., and the test becomes a regression test. Find and fix bugs with your coding agent follows that loop step by step, and rehearsal bugs verify is the command behind the last step.

The two ways prove different things. A test your agent reproduced has seen the bug fail before the fix, so it shows the test can catch it. Create test in the app writes its test after the fix, so it shows the fix works, but it has never seen the bug happen.

Say it is not a bug Link to Say it is not a bug

Sometimes a subagent is wrong: the app works that way on purpose, or the steps make no sense. Press Mark as not a bug and answer Why isn't this a bug? with It works this way on purpose, Steps are wrong, Not important or Other. Add a few words if you like, then press Mark as not a bug again. Rehearsal keeps your answer as the reason.

The bug folds to one line, Not a bug, and moves to Dismissed on the Bugs page. Undo on that line brings it back as it was. Not a real bug under Was this a good find? sets a bug aside the same way.

This is a person's call, so Rehearsal's MCP tools give a coding agent no way to make it. In a terminal, rehearsal bugs dismiss 5 does it for anyone signed in with the Manage projects and Use Re:agent permissions, so a coding agent that runs the CLI could do it too. The prompt in Hand the loop to your agent tells the agent to leave that decision to you.

When two bugs are the same Link to When two bugs are the same

Two subagents can run into one problem from different pages. Press Same as another bug and pick the other one from the list, where the bugs on the same page come first. This bug then folds under the one you picked as Same as Bug #19, every count holds the two as one, and you fix it once. Undo separates them again.

Next steps Link to Next steps