Diagnostics finds recurring problems in your agent’s turns, the BenchGen agent proposes the fix, and with your harness repository connected the fix arrives as a pull request.
Every turn of a connected agent is traced (see Connect an OpenClaw Agent). The Diagnostics tab reads those traces and turns recurring problems into issues you can act on, without opening a single trace yourself.
Diagnostics scans the last hour of turns every five minutes, plus the whole day once a night, with mechanical rules: a reply that says “shown above” when nothing was shown, a link no tool printed, a tool error the reply hides, the same tool called in a loop, an empty reply, a reply in another alphabet than the question. Each recurring problem is one issue with its severity, how often and when it happened, which users it hit, example turns and the likely cause.The scan is off for a new agent. Switch it on with the Auto pill above the issues; Run diagnostic scans the last day right away. Each new issue is also sent to you in your last chat with the agent.
The Diagnostics tab: open issues on the left, the selected issue on the right with when it was seen, how often, the summary and the agent's fix
Review with the agent goes further than the rules: the BenchGen agent reads up to 20 recent turns and files what only a reader sees, such as a reply that misses the question, a reply in the wrong language, a price or date that appears nowhere in the question or the tool output, or a poor tone. Its note on each example says what is wrong. This is one turn of the BenchGen agent, billed like a chat turn; a turn is reviewed once.
On an issue, Ask the agent for a fix gives the BenchGen agent the example turns and asks for the cause and the fix. The analysis lands on the issue page in a minute or two. Continue in chat puts the issue into your chat with the BenchGen agent when you want to discuss it.Without a repository connected, the fix is text you apply yourself. With one connected, the fix comes as a change to your files.
Your agent’s behaviour lives in its workspace files: AGENTS.md, the skills under skills/, prompts. Keep them in a GitHub repository and connect it, and a fix becomes a pull request there.
1
Make a token for the repository
On GitHub, open Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token. Limit it to the one repository and give it two permissions: Contents: Read and write and Pull requests: Read and write.
The token: one repository, Contents and Pull requests set to read and write
2
Connect it on the agent's Settings tab
Settings → Harness repository: enter the repository as owner/name or its URL, paste the token, and keep or edit the list of harness files. The default, AGENTS.md and skills/**/SKILL.md, matches the OpenClaw workspace layout; ** spans folders.
The card before connecting: repository, token, and the harness files a proposal may change
Connect reads the repository at once and lists the files it found.
A connected repository: the branch and the harness files found
The token is stored encrypted and never shown again. BenchGen uses it to read those files and to open pull requests; it is never handed to an agent.The same works from the chat: tell the BenchGen AI agent “connect Jeka95/northwind-support-agent to my support bot” and paste the token in the message. The platform takes the token out of the message before the agent sees it and keeps it for 15 minutes; the agent connects the repository with a reference to it and reports the branch and the files. Everything on this page (issues, scan, review, fix, pull request, resolve) can be asked of the agent in the same way.
3
Get the fix as a pull request
Now Ask the agent for a fix also returns the change itself, shown on the issue as a diff with the files it touches. Read it, then Open a pull request: BenchGen puts the change on a branch benchgen/diagnostic-<id> and opens the pull request with the analysis and the example turns. The link stays on the issue.
The agent's fix on an issue: the analysis, the proposed change as a diff, and the link to the pull request it became
The same change as a pull request in the owner's repository, one commit per file
Nothing is written to the repository before that click, and nothing is merged: review the pull request on GitHub as you would any change, merge it, and let the agent pick up the new files (for an OpenClaw gateway that clones the workspace at start, a restart).
BenchGen does not measure a change to your own agent before and after: it has no benchmark of it unless you make one. The pull request says so. For an agent you want measured, run a benchmark on it before and after the merge (see Benchmark an OpenClaw Agent).
After the merge, the next scan shows whether the problem is gone: a resolved issue stays resolved for the turns it was about, and only new turns can open it again. Resolve an issue with Resolve once the fix is in; reopen it if the problem returns.