ML.ai

Hand it the error and ML.ai finds the real cause first

A stack trace points at the line that threw, but the bug is usually somewhere else. ML.ai reads the execution path, finds the actual root cause, and writes a fix you can review before it lands.

Who uses ML.ai for debugging

Developers chasing a bug that keeps coming back, or an error that surfaces far from its cause.

  • Developers fighting flaky tests

    Setup-order and state bugs that pass on one run and fail on the next.

  • Anyone stuck on a cryptic error

    Errors that surface far from the code that caused them.

  • Teams with layered code

    Bugs that pass through middleware and state before they show up.

The line the trace points at is rarely the line that is wrong

A stack trace tells you where the error surfaced, not where the bug lives. These four things are what ML.ai does differently from reading the trace yourself.

A prompt-and-paste chat window has no memory of your repo

A generic chat model answers from the snippet you pasted in, not the actual codebase. It cannot follow the import chain from the test into the auth middleware into the session store.

Cross-file tracing is where the actual root cause hides

The session store returns null on an expired token and the middleware treats null as missing. The token expired between setup and assertion, so the failure is a race in the test setup.

A diff is checkable. A description of a change is not

Being told "we fixed the expiry check" is not the same as seeing the exact line that changed. Every edit here is a real diff you review before it lands.

The agent reads the execution path before proposing a fix

@explore traces the failing path through the codebase before suggesting what to change, and finds the root cause in the session store returning null.

Debugging by hand versus handing it off

By hand

You read the trace, grep the error, add console.logs and re-run until the real cause turns up somewhere else.

With ML.ai

Paste the error or failing test. ML.ai reads the execution path, finds the race in the session store and writes the fix.

Which agent actually does this

general · Read · Diagnose · Propose fix

Traces the cause and writes the fix

Reads the function that failed and its callers, states what is actually wrong, then proposes a fix as a diff behind the same approval gate as any other edit.

@explore · Read · Search · Edit

Optional, to map the area first

Read-only search across the codebase, useful when the failing code touches an unfamiliar part of the system before a fix is attempted.

How ML.ai traces a bug to its cause

Most debugging comes down to the chain of calls that led to the error and the state that was wrong three files upstream.

1Paste the error or the failing testCopy the stack trace, the error message, or the test name. general, the default agent, reads the error and starts tracing the execution path.
2It reads the execution pathThe agent follows the call chain from the error back through imports, middleware and state, and builds a picture of what happened before it settles on a cause.
3Review the root-cause analysis and fixML.ai explains where the bug is and why, then writes a diff that addresses the root cause. Every edit is held behind an approval prompt before it lands.
4Approve, or redirectIf the fix is right, allow it. If you disagree with the diagnosis, say what you think is wrong and the agent re-traces with your input.

Common debugging traps and fixes

Where debugging usually goes wrong, and how ML.ai closes each gap.

You trace the symptom, not the cause

The stack trace points at the middleware returning 401, so you patch the middleware. The test passes until the session store hits the same race again next week.

How ML.ai handles it

The agent traces the full execution path before writing anything. It finds the session store returning null and fixes the root cause instead of the symptom.

The console.log spiral

You add logging to the middleware and re-run, then add logging to the session store and re-run again, and forty minutes go by before the timing issue shows up.

How ML.ai handles it

The agent reads the files in one pass and identifies the timing issue without needing console.logs. What took forty minutes of re-running takes one read of the call chain.

The fix that masks the bug

You catch the null in the middleware and return a fresh session. The test passes. But the session store still silently drops expired sessions, and any other caller hits the same issue.

How ML.ai handles it

The agent sees the session store as the origin of the null and fixes the throw behavior there, so every caller gets an explicit error instead of a silent null.

Where this stops

The real edges of what general can do here, stated plainly instead of left for you to discover.

01
01

It sees the repo, not your servers

If the 401 only happens in production, paste the log line or the config value. It traces from what you give it.

02
02

Flaky bugs need one real failure

Run the test until it fails once and paste that output. A real failure gives it something to trace, a description of one doesn’t.

03
03

The test runs, the fix waits

Running auth.test.ts doesn’t prompt, because test runners are trusted by name. The edit to session.ts still waits for your Allow.

Apply edits to 3 files?

One diff across the schema, the API route and the task card.

route.tsschema.prismaTaskCard.tsx+2 −1
20export async function POST(req) {
21- const { title } = await req.json()
21+ const { title, dueDate } = await req.json()
22+ return createTask({ title, dueDate })
AllowAlwaysDeny

Build

Give general a feature description and it reads the relevant files, plans the edit across every layer, and writes it as one reviewable diff.

Plan · session store migration

  1. 1Update middleware to read both formats
  2. 2Add the server store behind a flag
  3. 3Swap the store
  4. 4Remove direct cookie reads in the auth flow

Open question: hard cutover or dual write

Hand to generalRevise

Planning

architect reads the code and returns the critical files, the trade-offs and a step-by-step plan before a single file changes.

FAQs

Can it debug a flaky test that only fails sometimes?

Yes. The agent reads the test, the code under test, and the surrounding state to find race conditions or timing issues. It cannot reproduce load-dependent flakiness, but it catches setup-order and state-management bugs.

Can it debug bugs that only show up in production?

It can only read what is in the workspace. Paste the relevant external detail (a config value, a log line) into the request and it factors that in.

Does it attach a debugger?

No. It reads the code, follows the execution path, and runs the failing test to see the real error (test runners run without a prompt). It does not attach to a running process or set breakpoints, and any edit it proposes still waits for your approval.

What if the bug spans several services?

If the services are in the workspace, it follows the call chain across them the same way it follows one through files. For any part of the path outside the repo, paste the log line or config value and it factors that in.

Try ML.ai today, or talk to us about what is next

Install the editor agent on your own machine, or book a call to talk through your team’s workloads and see where ML.ai fits.