Skip to content

Testing issue #48Β #49

@jgwill

Description

@jgwill

βœ… coaiapy-mcp v0.1.4 - Ready for Testing

Status: READY βœ…

Version: 0.1.4
Date: 2025-10-30
Branch: copilot/update-files-in-coaiapy-mcp


What's New in v0.1.4

πŸŽ‰ Comment Support (3 New Tools)

  1. coaia_fuse_comments_list - List/filter comments
  2. coaia_fuse_comments_get - Get comment by ID
  3. coaia_fuse_comments_create - Create comments

πŸ”§ Version Management Fix

  • Server now reports correct version (was 0.1.0, now 0.1.4)
  • Enhanced bump.py to sync all 3 version files
  • Single source of truth for version

Files Modified in This PR

Core Implementation

  1. /src/coaiapy/coaiapy/cofuse.py (lines 289-362)

    • Enhanced get_comments() with filtering
    • New get_comment_by_id() function
    • Enhanced post_comment() with object attachment
  2. /src/coaiapy/coaiapy-mcp/coaiapy_mcp/tools.py (lines 20-32, 521-741)

    • Added 3 new comment tool functions
    • Updated imports and exports
  3. /src/coaiapy/coaiapy-mcp/coaiapy_mcp/server.py (lines 223-263)

    • Registered 3 new MCP tools
    • Dynamic version import

Build & Release

  1. /src/coaiapy/bump.py - Enhanced version bumping
  2. /src/coaiapy/coaiapy-mcp/release.sh - Updated git commit
  3. /src/coaiapy/coaiapy-mcp/__init__.py (line 15) - Version 0.1.4

Documentation

  1. /src/coaiapy/COMMENT_SUPPORT_SUMMARY.md - Implementation details
  2. /src/coaiapy/coaiapy-mcp/CHANGELOG.md - Version history
  3. /src/coaiapy/coaiapy-mcp/TEST_PLAN_v0.1.4.md - Test scenarios

Testing Checklist

Before Testing

  • Verify MCP server installed: pip show coaiapy-mcp
  • Check version: python -c "from coaiapy_mcp import __version__; print(__version__)"
  • Ensure Langfuse credentials configured in ~/.coaia
  • Restart Claude Code to pick up new MCP tools

Core Tests

  • List all comments
  • Create comment on trace
  • Create comment on observation
  • Get comment by ID
  • Filter comments by object type
  • Filter comments by object ID
  • Test pagination (page, limit)

Regression Tests

  • Existing trace tools still work
  • Existing prompts tools still work
  • Redis tash/fetch still works
  • Server reports v0.1.4

Error Handling

  • Non-existent comment ID returns error
  • Invalid parameters handled gracefully

Quick Test Command

# In new Claude Code session with MCP access:
await mcp__coaiapy__coaia_fuse_comments_list({})

Expected output: JSON with comments list or {"success": true, "comments": ...}


Available MCP Tools (Total: 14)

Redis (2)

  • coaia_tash
  • coaia_fetch

Traces (3)

  • coaia_fuse_trace_create
  • coaia_fuse_add_observation
  • coaia_fuse_trace_view

Prompts (2)

  • coaia_fuse_prompts_list
  • coaia_fuse_prompts_get

Datasets (2)

  • coaia_fuse_datasets_list
  • coaia_fuse_datasets_get

Score Configs (2)

  • coaia_fuse_score_configs_list
  • coaia_fuse_score_configs_get

Comments (3) ✨ NEW

  • coaia_fuse_comments_list
  • coaia_fuse_comments_get
  • coaia_fuse_comments_create

Installation for Testing

Option 1: Editable Install (Recommended for Testing)

cd /src/coaiapy/coaiapy-mcp
pip install -e .

Option 2: Build and Install

cd /src/coaiapy/coaiapy-mcp
make clean && make build
pip install dist/coaiapy_mcp-0.1.4-py3-none-any.whl

Option 3: From PyPI (after release)

pip install --upgrade coaiapy-mcp

Expected Server Output on Start

INFO - Starting coaiapy-mcp server...
INFO - MCP Server created: coaiapy-mcp v0.1.4

Known Working Configuration

  • Python: 3.10+
  • Dependencies:
    • mcp>=1.0.0
    • coaiapy>=0.2.54
    • langfuse>=2.0.0
    • redis>=5.0.0

Test Data Examples

Sample Trace ID

"test-trace-2025-10-30-001"

Sample Comment Text

"Test comment for v0.1.4 validation"

Sample Filters

{
    "object_type": "trace",
    "object_id": "your-trace-id",
    "page": 1,
    "limit": 10
}

Success Indicators

βœ… Version 0.1.4 reported in logs
βœ… 14 MCP tools available (list_tools)
βœ… Comment creation returns comment ID
βœ… Comment retrieval returns full data
βœ… Filtering returns correct subset
βœ… No errors in server logs


Support Files

  • Test Plan: TEST_PLAN_v0.1.4.md
  • Implementation: COMMENT_SUPPORT_SUMMARY.md
  • Changelog: CHANGELOG.md
  • OpenAPI Spec: /src/coaiapy/references/openapi.yml (lines 517-693)

If Issues Arise

  1. Check server logs for errors
  2. Verify Langfuse API credentials
  3. Ensure coaiapy package is up to date: pip install --upgrade coaiapy
  4. Test direct Python access: from coaiapy.cofuse import get_comments
  5. Review TEST_PLAN_v0.1.4.md for detailed test scenarios

Ready to test! πŸš€

Just reboot session with MCP access and start testing the new comment functionality.

coaiapy-mcp v0.1.4 Testing Plan

Pre-Testing Setup

1. Install/Reinstall Package

cd /src/coaiapy/coaiapy-mcp
pip install -e .

2. Verify Version

python -c "from coaiapy_mcp import __version__; print(__version__)"
# Expected: 0.1.4

3. Start MCP Server (if needed manually)

python -m coaiapy_mcp.server

Test Cases for Comment Support

Test 1: List All Comments

Tool: mcp__coaiapy__coaia_fuse_comments_list

# No filters - list all comments
await mcp__coaiapy__coaia_fuse_comments_list({})

# Expected: JSON with list of comments or empty list

Test 2: Create Comment on Trace

Tool: mcp__coaiapy__coaia_fuse_comments_create

Prerequisites: Need a valid trace_id (create one first if needed)

# First create a trace
trace_id = "test-trace-" + str(uuid.uuid4())
await mcp__coaiapy__coaia_fuse_trace_create({
    "trace_id": trace_id,
    "name": "Test Trace for Comments"
})

# Then add comment
await mcp__coaiapy__coaia_fuse_comments_create({
    "text": "This is a test comment on a trace",
    "object_type": "trace",
    "object_id": trace_id
})

# Expected: Success response with comment data including ID

Test 3: List Comments for Specific Trace

Tool: mcp__coaiapy__coaia_fuse_comments_list

# Using trace_id from Test 2
await mcp__coaiapy__coaia_fuse_comments_list({
    "object_type": "trace",
    "object_id": trace_id
})

# Expected: List containing the comment we just created

Test 4: Get Comment by ID

Tool: mcp__coaiapy__coaia_fuse_comments_get

Prerequisites: Get comment_id from Test 2 or Test 3 response

await mcp__coaiapy__coaia_fuse_comments_get({
    "comment_id": "<comment_id_from_previous_test>"
})

# Expected: Single comment object with all details

Test 5: Create Comment on Observation

Tool: mcp__coaiapy__coaia_fuse_comments_create

# First create observation
obs_id = "test-obs-" + str(uuid.uuid4())
await mcp__coaiapy__coaia_fuse_add_observation({
    "observation_id": obs_id,
    "trace_id": trace_id,
    "name": "Test Observation for Comments"
})

# Add comment to observation
await mcp__coaiapy__coaia_fuse_comments_create({
    "text": "Great observation! Performance looks good.",
    "object_type": "observation",
    "object_id": obs_id
})

# Expected: Success with comment data

Test 6: Filter Comments by Author

Tool: mcp__coaiapy__coaia_fuse_comments_list

await mcp__coaiapy__coaia_fuse_comments_list({
    "author_user_id": "your-user-id"
})

# Expected: Comments filtered by author

Test 7: Pagination Test

Tool: mcp__coaiapy__coaia_fuse_comments_list

# First page, limit 2
await mcp__coaiapy__coaia_fuse_comments_list({
    "page": 1,
    "limit": 2
})

# Second page, limit 2
await mcp__coaiapy__coaia_fuse_comments_list({
    "page": 2,
    "limit": 2
})

# Expected: Paginated results

Test 8: Create Comment without Object Attachment

Tool: mcp__coaiapy__coaia_fuse_comments_create

# Generic comment (not attached to any object)
await mcp__coaiapy__coaia_fuse_comments_create({
    "text": "This is a standalone comment"
})

# Expected: Success - comment created without object linkage

Regression Tests (Verify Existing Features Still Work)

Test 9: Verify Trace Creation

await mcp__coaiapy__coaia_fuse_trace_create({
    "trace_id": "regression-test-trace",
    "name": "Regression Test"
})

Test 10: Verify Prompts List

await mcp__coaiapy__coaia_fuse_prompts_list({})

Test 11: Verify Redis Tash/Fetch

await mcp__coaiapy__coaia_tash({
    "key": "test-key",
    "value": "test-value"
})

await mcp__coaiapy__coaia_fetch({
    "key": "test-key"
})

Version Verification Test

Test 12: Check Server Version

Expected: Server should report version 0.1.4 when starting

Look for log output:

MCP Server created: coaiapy-mcp v0.1.4

Error Handling Tests

Test 13: Get Non-Existent Comment

await mcp__coaiapy__coaia_fuse_comments_get({
    "comment_id": "non-existent-id-12345"
})

# Expected: Error response with appropriate message

Test 14: Invalid Object Type

await mcp__coaiapy__coaia_fuse_comments_list({
    "object_type": "invalid_type"
})

# Expected: Error or empty list

Success Criteria

βœ… All 14 tests pass without errors
βœ… Server reports version 0.1.4
βœ… Comment CRUD operations work correctly
βœ… Filtering and pagination work as expected
βœ… Existing features remain functional
βœ… Error handling is graceful


Quick Test Script

import uuid

# Quick end-to-end test
trace_id = f"test-{uuid.uuid4()}"

# 1. Create trace
await mcp__coaiapy__coaia_fuse_trace_create({
    "trace_id": trace_id,
    "name": "Quick Test"
})

# 2. Add comment
result = await mcp__coaiapy__coaia_fuse_comments_create({
    "text": "Quick test comment",
    "object_type": "trace",
    "object_id": trace_id
})

# 3. List comments for this trace
comments = await mcp__coaiapy__coaia_fuse_comments_list({
    "object_type": "trace",
    "object_id": trace_id
})

print("βœ… Quick test passed!" if comments else "❌ Test failed")

Notes for Testing Session

  1. Langfuse Credentials: Ensure .coaia config has valid credentials
  2. Redis: Ensure Redis is running if testing tash/fetch
  3. Clean State: May want to test with a fresh Langfuse project
  4. Observation: Watch for any deprecation warnings or errors in logs

Test Plan Version: 1.0
Package Version: 0.1.4
Date: 2025-10-30

issue #48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions