Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Dec 7, 2025

Summary

  • Fixed list_tasks MCP tool failing with AttributeError: type object 'WorkflowStep' has no attribute 'tenant_id'
  • Enabled unified mode by default - no reason for it to be opt-in
  • Added 6 behavioral tests for task management tools
  • Simplified test_tool_registration.py (no conditional tool lists)

Root Cause

The query used WorkflowStep.tenant_id which doesn't exist - WorkflowStep links to Context which has tenant_id. A # type: ignore[attr-defined] comment suppressed the type error.

Why Unified Mode Should Be Default

  • Production uses ADCP_UNIFIED_MODE=true (in fly.toml)
  • There's no reason for dev/CI to behave differently from production
  • Task management tools should always be available
  • Set ADCP_UNIFIED_MODE=false to disable if needed

Follow-up Issues Created

Test plan

  • Unit tests pass (1091 passed - 6 more now that task tests don't skip)
  • Task tool tests run by default
  • Pre-commit hooks pass

Fixes #816

🤖 Generated with Claude Code

The list_tasks MCP tool was failing with AttributeError because
WorkflowStep doesn't have a tenant_id column - it links to Context
which has tenant_id.

Root cause: The query used WorkflowStep.tenant_id which doesn't exist.
The # type: ignore[attr-defined] comment suppressed the type error.

Fix: Join DBContext and filter on DBContext.tenant_id, matching the
pattern used by get_task and complete_task.

Why this wasn't caught:
- Task tools only register when ADCP_UNIFIED_MODE is set (production)
- CI runs without ADCP_UNIFIED_MODE, so tools were never tested
- Zero tests existed for list_tasks, get_task, or complete_task

Added:
- tests/unit/test_task_management_tools.py with 6 behavioral tests
- Updated test_tool_registration.py to document unified mode tools

Fixes #816

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley force-pushed the fix-list-tasks-tenant-id branch from 5553a78 to 52137f0 Compare December 7, 2025 12:56
@bokelley bokelley merged commit c17abcb into main Dec 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_tasks MCP tool failure

2 participants