Skip to content

bug: Multiple critical bugs found in comprehensive MCP server testing #56

@jerfowler

Description

@jerfowler

🚨 Critical Bugs Found in Comprehensive Testing

Executive Summary

During systematic testing of agent-comm MCP server v0.9.2, 4 critical bugs were discovered that prevent production readiness. This issue documents all findings from comprehensive read/write functionality testing.

🔴 Critical Bugs Discovered

Bug #1: Progress Percentage Calculation Always Returns 0%

  • Issue: track_task_progress always shows 0% regardless of actual progress
  • Evidence: QA task with 4 reported progress updates still shows 0%
  • Impact: Progress monitoring is completely unreliable
  • Root Cause: Checkbox counting logic appears broken
  • Priority: HIGH - Core feature non-functional

Bug #2: Missing Agent Name Validation

  • Issue: System accepts tasks for nonexistent agents without validation
  • Evidence: Successfully created task for "nonexistent-agent"
  • Impact: Tasks assigned to agents that don't exist, data integrity issues
  • Security Concern: No validation against configured agent list
  • Priority: HIGH - Data integrity and security issue

Bug #3: Missing Step Number Validation in Progress Reporting

  • Issue: Progress reporting accepts invalid step numbers without validation
  • Evidence: Successfully reported progress for step 999 on a 5-step plan
  • Impact: Progress data becomes inconsistent and unreliable
  • Priority: MEDIUM - Data quality issue

Bug #4: Error Logging Missing for Validation Failures

  • Issue: MCP validation errors (e.g., "taskName must be a non-empty string") don't appear in logs
  • Evidence: Error thrown but no entry in /comm/.logs/agent-comm.log
  • Impact: Makes debugging and monitoring difficult
  • Priority: MEDIUM - Observability issue

✅ Working Functionality (Tested Successfully)

  • Task Creation & Duplicate Prevention: Perfect duplicate detection
  • Plan Submission & Validation: Strong format enforcement with clear errors
  • TodoWrite Synchronization: Checkbox matching works correctly (1/1 success rate)
  • Archive Operations: Successfully archived 4 completed tasks with timestamps
  • Diagnostic Tools: Full lifecycle visibility from INIT → PLAN → DONE
  • Performance: Excellent response times (<100ms for most operations)

🛡️ Security Findings

Advanced Verification System (Working as Intended)

  • Discovery: Aggressive evidence-based verification blocks task completion
  • Behavior: Requires verification commands and evidence scores before allowing completion
  • Impact: Tasks cannot be completed without sufficient evidence
  • Assessment: This appears to be intentional security feature preventing fake completions
  • Trust Level: "ZERO_TRUST" with comprehensive verification requirements

📊 Test Results Summary

Feature Category Tests Run Pass Fail Success Rate
Task Creation 3 2 1 67%
Plan Validation 2 2 0 100%
Progress Tracking 3 1 2 33%
TodoWrite Sync 1 1 0 100%
Archive/Restore 2 2 0 100%
Error Handling 4 2 2 50%
Security 2 2 0 100%

Overall Score: 66% (12/18 critical tests passed)

🎯 Recommended Fixes

Immediate Actions Required 🔴

  1. Fix Progress Calculation: Implement proper checkbox counting for percentage tracking in TaskProgressTracker
  2. Add Agent Validation: Validate agent names against configured agent list in create_task tool
  3. Add Step Validation: Verify progress step numbers against plan structure in report_progress tool
  4. Fix Error Logging: Ensure validation errors are logged to agent-comm.log

🧪 Test Environment

  • Version: agent-comm MCP server v0.9.2
  • Node.js: Compatible version
  • Test Scope: Complete read/write functionality testing
  • Test Duration: Comprehensive systematic testing
  • Tasks Created: 6 test tasks across multiple agents

📋 Reproduction Steps

Bug #1 (Progress Calculation)

  1. Create task with create_task
  2. Submit plan with submit_plan (with checkboxes)
  3. Report progress with report_progress
  4. Call track_task_progress
  5. Expected: Non-zero percentage based on completed steps
  6. Actual: Always returns 0%

Bug #2 (Agent Validation)

  1. Call create_task with agent: "nonexistent-agent"
  2. Expected: Validation error about invalid agent
  3. Actual: Task created successfully

Bug #3 (Step Validation)

  1. Create task with 5-step plan
  2. Call report_progress with step: 999
  3. Expected: Validation error about invalid step number
  4. Actual: Progress update accepted

Bug #4 (Error Logging)

  1. Call create_task with empty taskName: ""
  2. Check /comm/.logs/agent-comm.log
  3. Expected: Error logged with timestamp
  4. Actual: No log entry created

🔧 Priority Assessment

Production Readiness: 6.5/10 ⚠️

The system has excellent architecture and most features work well, but these critical bugs prevent production deployment without fixes. The advanced security verification system is working correctly and provides good protection.

💭 Additional Notes

  • Archive functionality works perfectly
  • Performance is excellent across all operations
  • Security verification system appears to be working as intended
  • File system abstraction is solid
  • Documentation and error messages are generally clear

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions