Skip to content

Latest commit

Β 

History

History
497 lines (378 loc) Β· 11.7 KB

File metadata and controls

497 lines (378 loc) Β· 11.7 KB

Manual Testing Guide for Mehaisi CodeSwarm on Terab Project

Prerequisites Check

Before starting, verify you have:

# 1. Check Node.js version
node --version  # Should be v24.13.0 or higher

# 2. Check Git
git --version

# 3. Check current directory
pwd  # Should be in ~/projects/terab or navigate there
cd ~/projects/terab

# 4. Verify terab is a git repository
git status  # Should show repo status, not "not a git repository"

Step-by-Step Testing Guide

Phase 1: Fresh Installation & Setup

1.1 Pull Latest Mehaisi CodeSwarm Changes

cd ~/codeswarm
git pull origin main
npm install  # Install any new dependencies (boxen)

1.2 Verify Link

which mehaisi
# Should show: /usr/local/bin/codeswarm or similar

codeswarm --version
# Should show version number

1.3 Initialize Terab Project

cd ~/projects/terab

# If already initialized, remove old config to test fresh
rm -rf .mehaisi

# Initialize with Ollama Cloud model
codeswarm init --model kimi-k2.5:cloud

Expected Output:

πŸš€ INITIALIZING MEHAISI
────────────────────────────────────────────────────────────
βœ” Initialization complete

Configuration
  β€’ 19 agents configured
  β€’ Workflows & pipelines ready
  β€’ Model: kimi-k2.5:cloud
  β€’ Provider: ollama-cloud

🎯 Get Started
  1. codeswarm credentials Β· Setup API keys
  2. codeswarm agents --list Β· View available agents
  3. codeswarm pipeline cautious Β· Run full pipeline

What to Check:

  • βœ“ Clean, modern formatting
  • βœ“ No emoji overload
  • βœ“ Point-based lists with bullets
  • βœ“ Proper spacing (no gaps)
  • βœ“ Shows correct model and provider

Phase 2: Credential Manager Testing

2.1 Test Interactive Credential Setup

cd ~/projects/terab

# Run credential setup (the new interactive feature!)
codeswarm credentials

Expected Prompt:

πŸ” SETTING UP CREDENTIALS
────────────────────────────────────────────────────────────

Provider: ollama-cloud

⚠ Ollama Cloud API key not found
β„Ή Get your API key from: https://ollama.com

? Enter your Ollama Cloud API key: [type here]

When Prompted:

  1. Enter your API key: 59064537a0604b5fa23d0f2c9a4cd0a2.OS7nVy9sUJAYhlLOwpOBWgM6
  2. When asked "Save to config?": Choose Yes

Expected Result:

βœ“ API key saved to config

βœ“ Credential setup complete

What to Check:

  • βœ“ Modern header with divider
  • βœ“ Clean warning/info messages
  • βœ“ Password is hidden as you type
  • βœ“ Confirms save to config
  • βœ“ No ugly gaps or spacing issues

2.2 Verify Credentials Were Saved

cat .mehaisi/config.json | grep api_key

Expected Output:

        "api_key": "59064537a0604b5fa23d0f2c9a4cd0a2.OS7nVy9sUJAYhlLOwpOBWgM6",

Phase 3: UI Enhancement Testing

3.1 Test Status Command

codeswarm status

Expected Output:

βš™ SYSTEM STATUS
────────────────────────────────────────────────────────────

Configuration
  Model: kimi-k2.5:cloud
  Provider: ollama-cloud
  Safety Mode: Manual approval
  Agents: 19
  Sessions: 0

What to Check:

  • βœ“ Professional header
  • βœ“ Key-value pairs properly aligned
  • βœ“ Clean divider line
  • βœ“ No extra newlines or gaps

3.2 Test Agents List Command

codeswarm agents --list

Expected Output:

βš™ AVAILABLE AGENTS
────────────────────────────────────────────────────────────

INVESTIGATOR
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Agent                 β”‚ Risk β”‚ Capabilities               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Accessibility Auditor β”‚ low  β”‚ accessibility, a11y-c...   β”‚
β”‚ API Detective         β”‚ low  β”‚ api-integration, endpo...  β”‚
...
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

FIXER
...

────────────────────────────────
Total: 19 agents configured

What to Check:

  • βœ“ Beautiful Unicode box-drawing (β”Œβ”€β” not ugly ASCII)
  • βœ“ Color-coded risk levels (green for low, yellow for medium, red for high)
  • βœ“ Grouped by agent type
  • βœ“ Clean table formatting
  • βœ“ Professional appearance

Phase 4: Model Selection Testing

4.1 Verify Model Configuration

cat .mehaisi/config.json | head -30

What to Check:

  • βœ“ "model": "kimi-k2.5:cloud" at the top
  • βœ“ "default_provider": "ollama-cloud"
  • βœ“ Provider configs have the model set correctly

4.2 Test Model Override (Optional)

# This tests that your global model overrides agent defaults
codeswarm run api-detective --dry-run 2>&1 | grep -i model

Expected Behavior:

  • Should use kimi-k2.5:cloud (your global model)
  • NOT qwen3-coder (the old agent default)

Phase 5: Full Pipeline Test

5.1 Run a Real Pipeline

cd ~/projects/terab

# Run the cautious pipeline (safest, read-only investigations)
codeswarm pipeline cautious

Expected Output:

πŸš€ INITIALIZING MEHAISI SESSION
────────────────────────────────────────────────────────────
βœ” Pre-flight checks passed
βœ“ Session ID: [uuid]

πŸš€ PIPELINE: CAUTIOUS
────────────────────────────────────────────────────────────

 Investigation 

Workflow: investigate
────────────────────────────────────────────────────────────
  β€’ API Analysis

β–Ά API Detective
  β€’ Executing...
βœ” Agent completed

  β€’ UI Analysis

β–Ά UI Inspector
  β€’ Executing...
βœ” Agent completed

...

What to Check:

  • βœ“ Clean headers with icons
  • βœ“ Phase banners with inverse background
  • βœ“ Point-based workflow steps
  • βœ“ Agent execution shows progress
  • βœ“ No credential prompts (already saved!)
  • βœ“ Professional, modern output throughout
  • βœ“ No ugly gaps or formatting issues

This Will:

  1. Scan your terab codebase
  2. Find API issues, UI problems, security vulnerabilities
  3. Create a session report
  4. NOT modify any code (cautious pipeline is read-only)

5.2 Check Results

# View the most recent session report
codeswarm report --last

Expected Output:

  • Session summary with findings
  • List of issues discovered
  • Agent performance metrics

Phase 6: Credential Persistence Testing

6.1 Test That You're NOT Prompted Again

cd ~/projects/terab

# Run another command - should NOT ask for credentials
codeswarm run security-scanner

Expected Behavior:

  • βœ“ Runs immediately without prompting
  • βœ“ Uses saved credentials from config
  • βœ“ Smooth, uninterrupted execution

6.2 Test Credential Removal & Re-prompt

# Remove saved credentials
cat .mehaisi/config.json | grep -v "api_key" > /tmp/config-temp.json
mv /tmp/config-temp.json .mehaisi/config.json

# Run again - should prompt this time
codeswarm run api-detective

Expected Behavior:

  • βœ“ Detects missing credentials
  • βœ“ Prompts you interactively
  • βœ“ Gives you option to save again

After Testing:

# Save credentials again when prompted
# Or restore manually:
codeswarm credentials

Phase 7: Edge Case Testing

7.1 Test Invalid Credentials

# Temporarily set wrong API key
export OLLAMA_CLOUD_API_KEY="invalid-key-12345"

codeswarm run api-detective

Expected Output:

  • βœ“ Clear error message about authentication failure
  • βœ“ Suggests checking your API key
  • βœ“ Doesn't crash or hang

Clean up:

unset OLLAMA_CLOUD_API_KEY

7.2 Test Without Network (Optional)

# This tests graceful failure
# Temporarily block network or disconnect

codeswarm run api-detective

Expected Behavior:

  • βœ“ Times out gracefully
  • βœ“ Shows clear error message
  • βœ“ Doesn't hang indefinitely

What Success Looks Like

After completing all tests, you should have:

βœ… Clean Installation

  • Fresh .mehaisi directory in terab project
  • Config file with kimi-k2.5:cloud model
  • Ollama Cloud provider selected

βœ… Working Credentials

  • API key saved in config
  • Never prompted multiple times
  • Smooth execution without manual exports

βœ… Modern UX

  • Beautiful Unicode tables
  • Clean headers with dividers
  • Point-based lists
  • No formatting gaps
  • Color-coded output
  • Professional appearance

βœ… Functional Pipeline

  • Runs investigations on terab codebase
  • Agents execute successfully
  • Session reports generated
  • No crashes or hangs

βœ… Smart Model Selection

  • Your chosen model used everywhere
  • Agent defaults overridden correctly
  • Provider auto-selected based on model

Troubleshooting

Issue: "mehaisi: command not found"

cd ~/codeswarm
sudo npm link

Issue: "Cannot find module 'boxen'"

cd ~/codeswarm
npm install boxen --save

Issue: Credentials not being saved

# Check file permissions
ls -la .mehaisi/config.json
# Should be writable

# Manually verify save
cat .mehaisi/config.json | grep api_key

Issue: Agent fails with model error

# Check your model is set correctly
cat .mehaisi/config.json | grep model

# Verify provider
cat .mehaisi/config.json | grep default_provider

Issue: Old formatting still showing

# Make sure you have latest code
cd ~/codeswarm
git pull origin main
npm install
sudo npm link

Quick Smoke Test (2 Minutes)

If you just want to quickly verify everything works:

# 1. Navigate to terab
cd ~/projects/terab

# 2. Initialize
rm -rf .codeswarm && codeswarm init --model kimi-k2.5:cloud

# 3. Setup credentials
codeswarm credentials
# Enter: 59064537a0604b5fa23d0f2c9a4cd0a2.OS7nVy9sUJAYhlLOwpOBWgM6
# Choose: Yes (save to config)

# 4. Check status
codeswarm status

# 5. List agents
codeswarm agents --list

# 6. Run one agent
codeswarm run api-detective

# Done! If these all work with clean output, you're good!

Summary Checklist

Use this to track your testing progress:

  • Pulled latest code from GitHub
  • Installed dependencies (boxen)
  • Initialized terab project
  • Tested interactive credential prompt
  • Verified credentials saved to config
  • Checked status command (modern UI)
  • Checked agents list (Unicode tables)
  • Verified model selection (global overrides)
  • Ran full cautious pipeline
  • Verified no re-prompting for credentials
  • Tested credential removal and re-prompt
  • All output is clean, modern, professional

Need Help?

If you encounter any issues:

  1. Check ~/.mehaisi/temp/ for error logs
  2. Run with verbose mode: MEHAISI_VERBOSE=1 codeswarm [command]
  3. Check the guides:

Good luck with your testing! πŸš€