# Turn a gap into a fix

import { Steps } from '@astrojs/starlight/components';

Take a gap a Journeys report found, such as a buyer question you lose or a run that fails a check, and hand it to the Docs Agent or the Marketing Agent to fix. Then approve the change and run the journey again to see whether the answers move.

## Before you begin

- A journey or collection report with at least one cause under **What went wrong**, or a card under **Fix these first**.
- For a docs pull request, your documentation repository connected through [GitHub](/agent/github-app-setup/) or [GitLab](/agent/gitlab-setup/).

## Where the fix buttons are

| Where | Button | After you click |
| --- | --- | --- |
| A journey report, under **What went wrong** | **Fix in docs** or **Draft in Marketing** on each cause | The new session opens. |
| A collection report: open a question under **Every buyer question**, then **What went wrong** | **Fix in docs** or **Draft in Marketing** | You stay on the report; the button becomes **View in Docs Agent** or **View in Marketing Agent**. |
| A collection report, under **Fix these first** | **Start the fix** | You stay on the report; the button becomes **View in Docs Agent** or **View in Marketing Agent**. |

The report decides which agent gets each fix. It labels each cause as a problem in your docs (**Fix in docs**) or in other content such as a blog post, comparison page or pricing page (**Draft in Marketing**). A **Fix these first** card names its agent, for example "The Marketing Agent can draft this".

## Steps

<Steps>
1. Open the report and find the gap. In a collection report, start with **Fix these first**; each card says how many buyer questions it affects. In a journey report, causes are ranked by how many runs they explain.

2. Click **Fix in docs**, **Draft in Marketing** or **Start the fix**.

3. Open the session. Its first message names the gap and links back to the report. The agent also gets the details behind the gap:
   - **Fix in docs** or **Draft in Marketing**: quotes from the answers that failed, the pages the assistants cited, and the report's suggested fix. The agent reads your content first to check that the problem is real and not already fixed. The Docs Agent improves an existing page where it can, rather than adding one. The Marketing Agent picks a format (a page, blog post, FAQ entry or comparison) and says why. If your pages already cover the gap, it tells you instead of drafting.
   - **Start the fix**: the suggested action, the page to change or a note that no page covers it yet, and the buyer questions it would improve, with how many answers passed. If the agent finds an existing page on the topic, it changes that page instead of writing a second one.

4. Review the result and approve it:
   - **Docs Agent:** accept or reject its changes in the editor, then click **Raise PR**. Review and merge the pull request in GitHub or GitLab. See [Work in the editor](/agent/editor/) and [How EkLine opens pull requests](/agent/how-ekline-opens-pull-requests/).
   - **Marketing Agent:** edit the draft in the editor, then copy or download it and publish it yourself. See [Write a post that answers a buyer question](/marketing-agent/buyer-question-post/).

5. Once the change is published on your public site, run the journey again: **Run now** on its row in the Journeys list, or **Run N times** on its **Reports** tab. For a collection, click **Run collection**. Journeys reach your content only through the public web, so a change that is merged but not yet published cannot move the answers.
</Steps>

## Check it worked

- A session is open in the Docs Agent or the Marketing Agent. On a collection report, the button you clicked now reads **View in Docs Agent** or **View in Marketing Agent**.
- For the Docs Agent, the editor toolbar shows **View PR #N** once the pull request is open.
- After the next run, compare the reports. In a collection report, a question whose outcome changed shows what it was, such as **Was a loss**. See [Track results over time](/journeys/track-results/).

## Troubleshooting

| What you see | What to do |
| --- | --- |
| A cause shows **Fix in docs** when you expected **Draft in Marketing** | The report labeled it a docs problem. Start a Marketing Agent session yourself if you want a draft. |

## Next

- [Track results over time](/journeys/track-results/)
- [Write a post that answers a buyer question](/marketing-agent/buyer-question-post/)
- [How EkLine opens pull requests](/agent/how-ekline-opens-pull-requests/)