Spaces:
Running
Running
Commit History
-
Mission M-E β Observability & Testsβ
Ashraf Al-Kassem +1: Claude Sonnet 4.6- ADK callback handler (callbacks.py): logs all lifecycle events to RuntimeEventLog - agent.{name}.started/completed, agent.llm_request/response, agent.error - tool.{name}.started/completed, tool error events - _redact_sensitive() strips access_token, api_key, password, token fields - runner.py: attaches LeadPilotCallbackHandler to agent after build_orchestrator() - tracks turn duration + records agent.turns_processed / avg_turn_duration_ms metrics - metrics_service.py: adds gauge() method (overwrites, not additive) - admin.py: GET /executions/{instance_id}/trace β returns chronological event timeline - 8 new tests: test_callbacks.py (5 unit), test_e2e_agent_flow.py (3 E2E) - Frontend: execution trace timeline page at /admin/executions/[executionId] - Frontend: monitoring/page.tsx β Agent Metrics tab + View Trace links in Executions tab - docs/missions/event-types.md: full event taxonomy reference Total tests: 360 (all passing) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthrβ¦87e5ad2 -
Mission M-C β Session & Memoryβ
Ashraf Al-Kassem +1: Claude Sonnet 4.6Replace InMemorySessionService with LeadPilotSessionService backed by a new AgentSession DB table. ADK sessions now persist across webhook events and server restarts β agents resume mid-qualification without re-asking answered questions. - Add AgentSession model (state+events JSON, soft-delete) - Alembic migration r8s9t0u1v2w3 creates agent_session table - LeadPilotSessionService: in-memory cache + DB persistence, 50-event cap - runner.py: get-or-create pattern, one-time history seeding, update_session after turn - Admin endpoint: GET /api/v1/admin/contacts/{contact_id}/session - 6 new tests (344 total, all passing) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>98b27e0
-
feat: Mission 32 β Template Catalog Expansion + 12 Pre-Made Automation Templatesβ
Ashraf Al-Kassem +1: Claude Opus 4.6Template Variables System: {{key}} placeholders in builder graphs replaced during clone with user-supplied values. Supports text, phone, url, number, textarea types with required/optional + defaults. Version Locking: Cloned flows track source_template_id and version_id. GET /automations/{id} returns latest_template_version info for "update available" badge. POST rebase-to-template endpoint re-applies stored variable values to newer template version. Analytics: TemplateUsageStat tracks clone_count, publish_count, active_flows_count. clone_count shown in catalog, sort=popular support. 12 Production Templates seeded at startup (idempotent by slug): - 6 WhatsApp: lead qualifier, appointment booking, FAQ responder, pricing gatekeeper, reactivation campaign, sales concierge - 4 Meta: Instagram DM responder, Messenger support intake, Lead Ads intake, Instagram appointment booking - 2 Omnichannel: lead qualifier, inbound-to-CRM pipeline Frontend: variable form on template detail, platfβ¦740c3bd -
feat: Mission 30 β WhatsApp Cloud Production Hardeningβ
Ashraf Al-Kassem +1: Claude Opus 4.6- Webhook signature enforcement (HMAC SHA-256) + payload size guard (1MB) - Delivery status lifecycle: DELIVERED/READ/DEAD_LETTER statuses with forward-only progression - Phone number normalization (digits-only) to prevent duplicate contacts - Media message handling: inbound image/audio/video/document parsing + local storage - Dead-letter queue: endpoints for listing and retrying permanently failed messages - Adapter abstraction: MessagingAdapter ABC for WhatsApp and Meta adapters - Observability: in-memory metrics service + admin metrics endpoint - Celery worker fix: expire_on_commit=False prevents MissingGreenlet errors - Catalog registry updated with new delivery statuses - 21 new tests (267 total), all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>f187462
-
fix: resolve 149 ruff lint violations for CI pipelineβ
Ashraf Al-Kassem +1: Claude Opus 4.6- Auto-fix 104 unused imports (F401) across 40 files - Fix F821: add missing `wrap_error` import in diagnostics.py - Fix F841: remove unused `now` variables in auth.py - Fix E722: replace bare `except` with `except Exception` in dispatch - Fix re-exports: explicit `as` syntax for meta/whatsapp __init__.py - Update pyproject.toml ruff config: - Ignore E711/E712 (SQLAlchemy needs `== None`/`== False`) - Ignore E402/E701 (intentional patterns in workers/tests) - Add per-file ignores for alembic/ and tests/ All 197 tests pass. Ruff checks clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b1aa633 -
feat: Mission 27 β Automation Builder v2 + Template Catalog Foundationβ
Ashraf Al-Kassem +1: Claude Sonnet 4.6- Visual canvas editor (ReactFlow @xyflow/react v12) with TriggerNode, ActionNode, NodePalette, NodeConfigPanel - FlowDraft model: per-flow mutable builder graph, separate from immutable FlowVersion - Builder v2 endpoints: GET/PUT draft, validate, publish, simulate, rollback, versions - builder_translator.py: validate_graph, translate, simulate β 21 unit tests passing - AutomationTemplate + AutomationTemplateVersion with admin CRUD + workspace clone - GET/POST /templates/ workspace catalog; POST /templates/:slug/clone - Admin: GET/POST /admin/templates, versions, publish endpoints - Alembic migration g7h8i9j0k1l2 + merge migration 2163b9b16da8 (M20+M27) - Frontend: automations-api.ts, templates-api.ts; admin/templates pages - All 57 tests passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d4d1956
-
feat: Mission 19+20 β Catalog Standardization + Prompt Studio Knowledge Base v2 + Dynamic Lead Qualificationβ
Ashraf Al-Kassem +1: Claude Opus 4.6Mission 19: Catalog registry with standardized provider/trigger/action metadata, validation, and frontend catalog client. Mission 20: Single source-of-truth prompt compiler replacing two divergent AI context paths. Knowledge files now injected into AI context. Automation AI steps use goal/tasks/extra_instructions. Dynamic lead qualification with workspace-level questions/statuses and admin defaults. - 118 tests passing (was 57), frontend build clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9d062e9 -
feat: Mission 18 β High-Volume Runtime Event Trailβ
Ashraf Al-Kassem +1: Claude Opus 4.6Unified runtime event logging across all subsystems (webhooks, runtime execution, dispatch, email, inbox, Zoho sync) with retention policies, correlation IDs, and support replay capabilities. - RuntimeEventLog model with 4 composite indexes + JSON related_ids - Non-throwing log_event() service with payload redaction (SG.*, Bearer, truncation) - Instrumented ~30 flows: webhook (5), runtime (8), dispatch (6), inbox (2), email (3) - Support Timeline API: workspace-scoped with JSON path filters - Admin Runtime Events: cross-workspace list/detail with full filter set - Frontend: TimelinePanel in inbox + admin runtime-events page - Celery beat daily purge (03:00 UTC, batch 1000) - Alembic migration e5f6g7h8i9j0 - 8 unit tests + 98 E2E tests passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>eab9f11
-
feat: Mission 17 β Enterprise Audit Logging Frameworkβ
Ashraf Al-Kassem +1: Claude Opus 4.6- Extend AdminAuditLog with 9 new columns (actor_type, outcome, ip_address, user_agent, request_path, request_method, error_code, error_message, agency_id) - Make actor_user_id nullable for failed login attempts on unknown users - Create audit_event() service with auto IP/UA/path extraction, metadata redaction, field truncation, and non-throwing error handling - Instrument 29 handlers across 8 files: auth (5), workspaces (4), integrations (3), automations (2), dispatch (1), inbox (2), admin (6), agency (6) - Add workspace-scoped GET /audit-logs endpoint with 7 filters + detail - Enhance admin GET /admin/audit-log with workspace_id, agency_id, actor_type, outcome, date range, and correlation_id filters + detail endpoint - Build dashboard Activity Log page with action/outcome badges, filters, expandable rows, and pagination - Enhance admin audit log page with actor type badges, correlation ID copy, request/IP/error detail view - Add 20 new tests (85 total pass, 0 fail) Co-β¦6d44285 -
Ready for deployment to HF and GitHub
Ashraf Al-Kassema3ba894 -
feat: Mission 14+15 β commercial entitlements + agency reseller modelβ
Ashraf Al-Kassem +1: Claude Opus 4.6Mission 14: Plan-based entitlements with per-module hard limits, usage metering, and admin plan management UI. Adds Plan, PlanEntitlement, WorkspacePlan, and UsageMeter models. Entitlement enforcement service with check_and_increment/batch helpers. Admin /plans CRUD page. Mission 15: Agency reseller model enabling multi-workspace management. Adds AgencyAccount, AgencyMember, WorkspaceOwnership models with RBAC (owner/admin/operator/viewer roles). Agency router with 9 endpoints for lifecycle, member management, and workspace provisioning. Lazy WorkspaceMember provisioning via extended get_active_workspace(). max_workspaces limit enforcement via plan entitlements. Admin agency management (list/detail/suspend/plan-assign). Frontend agency console and workspace switcher replacing hardcoded placeholder. All 56 unit tests pass. 55/55 E2E checks verified on localhost. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>2bb79a1
-
fix: comprehensive production bug fix β admin auth, endpoints, seedingβ
Ashraf Al-Kassem +1: Claude Opus 4.6- Create admin_auth.py with POST /login and GET /me endpoints - Register admin_auth_router in main.py - Implement ~20 missing admin endpoints in admin.py (users, workspaces, webhooks, dispatch, automations, prompt-configs, zoho-health, integrations, executions, email retry, impersonation) - Fix wrap_error() calls with invalid code= kwarg (8 call sites across auth.py, admin.py, integrations.py) - Fix SQLAlchemy == None to .is_(None) in auth.py (2 places) - Seed admin@leadpilot.io / LeadPilot@password123 in create_test_user.py - Delete broken seed_admin.py and seed_rbac.py scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>15d9ad6 -
fix: add missing backend application code (app/, migrations, tests, templates)β
Ashraf Al-Kassem +1: Claude Opus 4.6The initial full project commit omitted the core backend directories. This adds the complete backend application package including all API routes, models, services, workers, 10 Alembic migrations, 13 test files (57 tests), and email templates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8ca4657