Docs/Testing/Debug Assistant

Debug Assistant

AI-Powered

AI-powered debugging that analyzes errors, suggests fixes, and helps you understand what went wrong.

Features

Error Analysis

AI analyzes stack traces and error messages

Root Cause Detection

Identifies the underlying issue

Fix Suggestions

Provides actionable fix recommendations

Context Awareness

Understands your codebase context

How It Works

1

Capture Error

When a test fails or error occurs, QODRYX captures the full context including stack trace, variables, and code.

2

Analyze with AI

AI examines the error, relevant code, and execution flow to understand what went wrong.

3

Suggest Fixes

Provides specific, actionable suggestions with code examples to fix the issue.

Example Debug Session

Failing Test
TypeError: Cannot read property 'id' of undefined
    at getUserById (src/services/user.ts:15:18)
    at Object.<anonymous> (src/services/user.test.ts:23:20)
AI Analysis

Root Cause: The function is accessing the id property before checking if the user exists.

Suggestion: Add a null check before accessing user properties:

function getUserById(id: string) {
  const user = users.find(u => u.id === id);
  if (!user) {
    throw new Error(`User ${id} not found`);
  }
  return user;
}

CLI Usage

# Analyze a failing test
qodryx debug test src/services/user.test.ts

# Debug specific error
qodryx debug error --file src/services/user.ts --line 15

# Interactive debug mode
qodryx debug --interactive

# Get fix suggestions for last failure
qodryx debug fix --last