Skip to content

Fix Celery task registration + add observability channel tracking#12

Open
coder-contrib-bot wants to merge 3 commits into
mainfrom
claude-code/celery-fix-observability-layer/k7m2p9x4
Open

Fix Celery task registration + add observability channel tracking#12
coder-contrib-bot wants to merge 3 commits into
mainfrom
claude-code/celery-fix-observability-layer/k7m2p9x4

Conversation

@coder-contrib-bot
Copy link
Copy Markdown
Collaborator

Summary

  • Celery fix: Workers were failing with KeyError: 'app.tasks.notifications.check_all_alerts' (and 3 other tasks) because autodiscover_tasks(["app.tasks"]) looks for app/tasks/tasks.py which doesn't exist. Replaced with explicit conf.include listing all 5 task modules.

  • Observability Layer: Added channel field (voice_ws, chat, chat_stream) through the full execution chain — from entry points (ClaudeClient, VoiceOrchestrator) → ManagerAgentToolExecutorAIObserver → Redis audit entries. Added 4 new analytics endpoints:

    • GET /analytics/latency — per-tool p50/p75/p95/p99 latency, filterable by channel/role
    • GET /analytics/success-rates — success/failure/blocked rates overall and per-tool
    • GET /analytics/role-usage — per-role usage with top tools, categories, channels
    • GET /analytics/channel-comparison — voice vs chat performance side-by-side

Files Changed

File Change
backend/app/celery_app.py Replace autodiscover_tasks with conf.include
backend/app/ai/observability.py Add channel to AIAuditEntry and AIObserver
backend/app/ai/executor.py Accept and pass channel parameter
backend/app/ai/agents/manager_agent.py Accept channel, pass to ToolExecutor
backend/app/ai/claude_client.py Pass channel="chat" / "chat_stream"
backend/app/ai/voice_orchestrator.py Pass channel="voice_ws"
backend/app/routers/ai_audit.py Add 4 analytics endpoints + channel filter on /feed

Author

This PR was authored by Claude Code (AI Agent).

🤖 Generated with Claude Code

coder-contrib-bot and others added 3 commits May 27, 2026 17:54
1. Celery: Replace broken autodiscover_tasks (which looked for
   app/tasks/tasks.py that doesn't exist) with explicit include list
   of all task modules.

2. Observability: Add 'channel' field (voice_ws, chat, chat_stream)
   through the full execution chain so audit entries track how users
   interact. Add 4 new analytics endpoints:
   - /analytics/latency - per-tool latency percentiles
   - /analytics/success-rates - success/failure/blocked rates
   - /analytics/role-usage - per-role detailed usage
   - /analytics/channel-comparison - voice vs chat performance

GIT_AUTHOR_NAME: Claude Code (AI Agent)
GIT_AUTHOR_EMAIL: noreply@anthropic.com
This commit was authored by the Claude Code AI Agent.

Co-Authored-By: Claude Code <noreply@anthropic.com>
New page: AIAnalyticsPage with 4 tabs:
- Latency: global P50/P95/AVG cards + per-tool percentile breakdown
- Success Rates: overall gauges + stacked bar per tool
- Role Usage: per-role cards with channels, top tools, block rates
- Channel Comparison: voice vs chat table + detail cards

Also updates repository and providers to support:
- channel field on AuditFeedItem, AuditSession, BlockedAction
- 4 new analytics models (LatencyAnalytics, SuccessRates, RoleUsage, ChannelStats)
- 4 new API methods + Riverpod providers with AnalyticsParams

GIT_AUTHOR_NAME: Claude Code (AI Agent)
GIT_AUTHOR_EMAIL: noreply@anthropic.com

Co-Authored-By: Claude Code <noreply@anthropic.com>
- Add /ai-analytics route to GoRouter
- Add 'AI Analytics' nav item in sidebar (admin only, with insights icon)
- Import AIAnalyticsPage in app_router.dart

GIT_AUTHOR_NAME: Claude Code (AI Agent)
GIT_AUTHOR_EMAIL: noreply@anthropic.com

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

1 participant