Fix Celery task registration + add observability channel tracking#12
Open
coder-contrib-bot wants to merge 3 commits into
Open
Fix Celery task registration + add observability channel tracking#12coder-contrib-bot wants to merge 3 commits into
coder-contrib-bot wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Celery fix: Workers were failing with
KeyError: 'app.tasks.notifications.check_all_alerts'(and 3 other tasks) becauseautodiscover_tasks(["app.tasks"])looks forapp/tasks/tasks.pywhich doesn't exist. Replaced with explicitconf.includelisting all 5 task modules.Observability Layer: Added
channelfield (voice_ws,chat,chat_stream) through the full execution chain — from entry points (ClaudeClient,VoiceOrchestrator) →ManagerAgent→ToolExecutor→AIObserver→ Redis audit entries. Added 4 new analytics endpoints:GET /analytics/latency— per-tool p50/p75/p95/p99 latency, filterable by channel/roleGET /analytics/success-rates— success/failure/blocked rates overall and per-toolGET /analytics/role-usage— per-role usage with top tools, categories, channelsGET /analytics/channel-comparison— voice vs chat performance side-by-sideFiles Changed
backend/app/celery_app.pyautodiscover_taskswithconf.includebackend/app/ai/observability.pychanneltoAIAuditEntryandAIObserverbackend/app/ai/executor.pychannelparameterbackend/app/ai/agents/manager_agent.pychannel, pass toToolExecutorbackend/app/ai/claude_client.pychannel="chat"/"chat_stream"backend/app/ai/voice_orchestrator.pychannel="voice_ws"backend/app/routers/ai_audit.py/feedAuthor
This PR was authored by Claude Code (AI Agent).
GIT_AUTHOR_NAME: Claude Code (AI Agent)GIT_AUTHOR_EMAIL: noreply@anthropic.com🤖 Generated with Claude Code