Docs/Testing/Auto-Fix & Pre-Flight Validation

Auto-Fix & Pre-Flight Validation

Updated May 3, 2026Testing

Automated guardrails: build auto-fixer, pre-flight validation before publish, fix-errors button.

Beyond actively requested tests, XAIO has three automatic safety nets that run in the background — you don't have to do anything for them.

Build Auto-Fixer

If `npm run build` fails during publish, a smaller AI model automatically takes over the fix attempt. It gets:

  • The error stack trace
  • The relevant code excerpt
  • The build context (TypeScript version, dependencies, etc.)

It can retry up to 2 times. If the second fix also fails, the publish is aborted and you get a report in chat — with a diff of what was tried, so you don't have to trigger it manually again.

Conversation and diff remain visible in the publish history.

Backend Pre-Flight Validation

Before every publish of a Web App project, XAIO automatically does a smoke check against all backend routes:

1. Backend starts in the publish container

2. One simple GET/POST per route with default payload

3. If a route throws 500 Internal Server Error → publish is blocked

4. In the publish dialog, the failing route + stack trace appears

This prevents you from going live with a broken backend version.

Fix-Errors button

In the workspace Backend tab and Preview tab, there's a Fix Errors button that appears once errors accumulate (red badge with count).

Clicking it:

1. Collects the latest errors (logs, tracebacks, console errors)

2. Sends them as a context-injected message into chat

3. The agent prioritizes them automatically and suggests fixes

You don't have to copy log lines or type stack traces.

When the agent tests on its own

The chat agent runs tests voluntarily, without explicit instruction, in these cases:

  • After larger refactorings (multiple files changed) → short smoke tests
  • After migration changes → up + down test, data roundtrip
  • Before git push if a pre-push hook is configured
  • After auto-fix → renewed build test before returning the result

Manual pre-flight

If you want to run a pre-flight yourself without publishing:

> Run the pre-flight validation manually — I want to know first whether everything's fine before I publish.

The agent does the same smoke check but only returns the report, without actually publishing.