|
| 1 | +# Release Notes: v0.4.0 |
| 2 | + |
| 3 | +**Release Date:** 2026-03-22 |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +AgentComms v0.4.0 adds PostgreSQL support with Row-Level Security for multi-tenancy, SMS as a chat transport, and a webhook server for inbound Twilio/Telnyx callbacks. |
| 8 | + |
| 9 | +## Highlights |
| 10 | + |
| 11 | +- **PostgreSQL with Multi-Tenancy**: Database abstraction supporting both SQLite and PostgreSQL with RLS-based tenant isolation |
| 12 | +- **SMS Chat Provider**: Send and receive SMS messages through Twilio or Telnyx |
| 13 | +- **Webhook Server**: HTTP server for receiving inbound SMS and voice status callbacks |
| 14 | +- **Updated Dependencies**: omnichat v0.4.0 (Slack, Gmail) and omnivoice v0.7.0 |
| 15 | + |
| 16 | +## New Features |
| 17 | + |
| 18 | +### PostgreSQL + Row-Level Security |
| 19 | + |
| 20 | +Multi-tenant deployments can now use PostgreSQL with Row-Level Security for database-level isolation: |
| 21 | + |
| 22 | +```json |
| 23 | +{ |
| 24 | + "database": { |
| 25 | + "driver": "postgres", |
| 26 | + "dsn": "postgres://user:pass@localhost:5432/agentcomms?sslmode=disable", |
| 27 | + "multi_tenant": true, |
| 28 | + "use_rls": true |
| 29 | + } |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +Two-layer isolation: |
| 34 | + |
| 35 | +1. **Application-level** - Ent privacy rules filter all queries by `tenant_id` |
| 36 | +2. **Database-level** - PostgreSQL RLS policies enforce isolation at the database |
| 37 | + |
| 38 | +### SMS Chat Provider |
| 39 | + |
| 40 | +SMS is now available as a chat transport alongside Discord, Slack, Telegram, WhatsApp, and Gmail: |
| 41 | + |
| 42 | +```json |
| 43 | +{ |
| 44 | + "chat": { |
| 45 | + "sms": { |
| 46 | + "enabled": true |
| 47 | + } |
| 48 | + } |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +SMS uses your configured phone provider (Twilio or Telnyx) and integrates with the existing channel mapping system. |
| 53 | + |
| 54 | +### Webhook Server |
| 55 | + |
| 56 | +A dedicated webhook server receives callbacks from Twilio and Telnyx: |
| 57 | + |
| 58 | +```json |
| 59 | +{ |
| 60 | + "webhook": { |
| 61 | + "enabled": true, |
| 62 | + "port": 3334 |
| 63 | + } |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +| Endpoint | Description | |
| 68 | +|----------|-------------| |
| 69 | +| `/webhook/twilio/sms` | Incoming SMS from Twilio | |
| 70 | +| `/webhook/twilio/voice` | Voice status callbacks | |
| 71 | +| `/webhook/telnyx/sms` | Incoming SMS from Telnyx | |
| 72 | +| `/webhook/telnyx/voice` | Voice status callbacks | |
| 73 | +| `/health` | Health check | |
| 74 | + |
| 75 | +## Architecture Changes |
| 76 | + |
| 77 | +### Tenant Context |
| 78 | + |
| 79 | +New `internal/tenant` package manages tenant context propagation: |
| 80 | + |
| 81 | +```go |
| 82 | +ctx = tenant.WithTenantID(ctx, "tenant-123") |
| 83 | +tenantID := tenant.FromContext(ctx) // Returns "local" if not set |
| 84 | +``` |
| 85 | + |
| 86 | +### Database Abstraction |
| 87 | + |
| 88 | +The `internal/database` package provides driver-agnostic database operations: |
| 89 | + |
| 90 | +- `database.Open(cfg)` - Opens SQLite or PostgreSQL based on config |
| 91 | +- `ApplyRLSPolicies(db)` - Creates RLS policies for PostgreSQL |
| 92 | +- PostgreSQL driver wrapper sets `app.current_tenant` per transaction |
| 93 | + |
| 94 | +### Ent Privacy Policies |
| 95 | + |
| 96 | +Agent and Event schemas now include privacy policies for tenant filtering: |
| 97 | + |
| 98 | +```go |
| 99 | +func (Agent) Policy() ent.Policy { |
| 100 | + return privacy.Policy{ |
| 101 | + Query: privacy.QueryPolicy{rule.FilterTenantRule()}, |
| 102 | + Mutation: privacy.MutationPolicy{rule.FilterTenantRule()}, |
| 103 | + } |
| 104 | +} |
| 105 | +``` |
| 106 | + |
| 107 | +## Documentation |
| 108 | + |
| 109 | +- [Configuration Guide](../configuration.md) - Database and webhook configuration |
| 110 | +- [Slack Setup](../slack-setup.md) - Slack integration guide |
| 111 | +- [Gmail Setup](../gmail-setup.md) - Gmail integration guide |
| 112 | + |
| 113 | +## Dependencies |
| 114 | + |
| 115 | +| Package | Version | Change | |
| 116 | +|---------|---------|--------| |
| 117 | +| omnichat | v0.4.0 | Slack, Gmail providers | |
| 118 | +| omnivoice | v0.7.0 | Updated voice stack | |
| 119 | +| lib/pq | v1.12.0 | PostgreSQL driver | |
| 120 | +| modernc.org/sqlite | v1.47.0 | Updated SQLite driver | |
| 121 | + |
| 122 | +## Upgrade Guide |
| 123 | + |
| 124 | +This release is backwards compatible. Existing SQLite deployments continue to work without changes. |
| 125 | + |
| 126 | +### For PostgreSQL Migration |
| 127 | + |
| 128 | +1. Create a PostgreSQL database |
| 129 | +2. Update `config.json` with database settings: |
| 130 | + ```json |
| 131 | + { |
| 132 | + "database": { |
| 133 | + "driver": "postgres", |
| 134 | + "dsn": "postgres://user:pass@localhost:5432/agentcomms?sslmode=require", |
| 135 | + "multi_tenant": true, |
| 136 | + "use_rls": true |
| 137 | + } |
| 138 | + } |
| 139 | + ``` |
| 140 | +3. Start the daemon - schema migrations run automatically |
| 141 | +4. RLS policies are applied after schema creation |
| 142 | + |
| 143 | +### For SMS Integration |
| 144 | + |
| 145 | +1. Ensure webhook server is enabled |
| 146 | +2. Configure your Twilio/Telnyx number to send SMS webhooks to your server |
| 147 | +3. Enable SMS in chat config |
| 148 | + |
| 149 | +## Full Changelog |
| 150 | + |
| 151 | +See [CHANGELOG.md](../../CHANGELOG.md) for the complete list of changes. |
0 commit comments