Agent Workflows, In-App Support & Partner OAuth
Mastra-native AI agent with live workflow execution, in-app support powered by Helpway, partner OAuth becomes self-serve, Content CMS gains per-entry analytics, and the dashboard moves from top nav to a collapsible sidebar.
AI Agent v3 — Built on Mastra
Our AI drawer is now a fully Mastra-native agent. The chat surface, the tool execution layer, and the message history all run through Mastra's runtime — replacing the hand-rolled AI SDK plumbing that was getting harder to extend.
Mastra Migration `NEW`
`handleChatStream` is now the canonical chat route. The legacy `/api/chat` AI SDK route has been removed. The agent definition lives in `apps/api/domains/ai/agents/project-agent.ts` and ships with native tool calls, streaming, and step limits.
Cross-thread Semantic Memory `NEW`
`@mastra/memory` is wired into the chat with a postgres.js storage adapter ("Path B") that survives the `prepare:true` mode used by Cloudflare Workers. Embeddings are pinned to 768 dimensions for a 4× storage reduction, and HNSW indexing is re-enabled. Each user has multi-tenant isolation enforced at the `Vector.query` filter layer.
The result: the agent recalls earlier conversations and applies their context to the current thread — even across sessions.
HITL via `useChat` `IMPROVED`
The drawer switched to `@ai-sdk/react` `useChat` with native Human-in-the-Loop. `askQuestion`, `createPlan`, and `proposeTranslations` render inline approval cards that the agent suspends on, then resumes from the user's answer — no custom snapshot endpoints, no D1 round-trips.
Auto-Apply Writes `IMPROVED`
Confidence-gated write tools (`proposeTranslations`, `proposeKeys`, `proposeContentEntries`, `proposePublishEntries`, `proposeTranslationEdits`, language add/edit) now apply on execute and AI-narrate what they did. Approve/Deny cards are reserved for genuinely destructive operations. The agent gets honest counts — partial successes surface as "wrote 38 / requested 40" rather than fake-perfect numbers.
Smarter Tooling
---
- `webSearch` via Exa — project-aware research with a monthly quota
- `getContentEntries` resolves relation field UUIDs to names/titles and supports `focusNamespace` for sub-group expansion
- 70%+ context cut — Memory writes are slim for read/web/edit/workflow tools, full payloads stay out of the LLM context window
- Anti-hallucination — write tools refuse to claim success on empty result sets
Workflow Engine on Cloudflare Workers `NEW`
For multi-step work (bulk translation, content batch creation), the agent now hands off to a real workflow engine instead of looping tool calls.
`createPlan` + `startWorkflow` produce a live, suspendable, per-step pipeline that streams progress directly into the chat UI via SSE. The workflow card renders steps, per-language progress for translation batches, and a phase-by-phase live status pill.
Built on Mastra's default engine with D1 storage. The Cloudflare Workers idle timeout is handled by a low-overhead SSE heartbeat. Workflow snapshots round-trip through `toRawMessages` so a refresh in the middle of a 1,500-key translation batch restores the live card without losing state.
The two workflows shipping this month:
The plan can ask the user one focused question when scope is genuinely ambiguous; otherwise it runs straight through.
---
- `translation-batch` — bulk translation with per-language progress bars
- `content-creation` — DISCOVERY → plan → write → verify, with feedback-driven rejection
Helpway In-App Support `NEW`
Better i18n now ships with Helpway-powered in-app support. The sidebar surfaces an anchored preview for the latest support announcement or unread conversation, with a monochrome avatar treatment that matches the platform.
Clicking an announcement deep-links into the entry detail, not a generic inbox view. Helpway's `@helpway/react` SDK moved from 0.10 → 0.12 over the month, integrating with the dashboard sidebar and tightening the visual treatment.
The bigger story: Helpway itself is now the first external product running on Better i18n's partner OAuth — its production dashboard authenticates against our auth surface via installation tokens.
---
Sidebar Navigation Overhaul `IMPROVED`
The dashboard moved from a top navbar to a collapsible sidebar, modeled on ElevenLabs' navigation pattern.
The content editor also moved to a unified single-header layout with breadcrumb navigation (Content / Model / Title), a flat properties tab, and a redesigned icon-tab sidebar.
---
- Scope-aware settings sidebar — context follows you across org and project boundaries
- Last-context navigation — back-and-forth between settings and main app remembers where you were
- Compact usage card moved into the sidebar footer
- Members and Billing surfaced in the org settings sidebar
- Expandable sub-navigation for nested sections
- User menu with name/email plus a sidebar help button
Partner OAuth 2.0 `STABLE`
Partner OAuth now ships with self-serve onboarding for third-party tools.
Helpway is the first production consumer of installation tokens.
---
- OAuth (no-key) MCP onboarding for Claude Code and Cursor — no copy-paste API keys, the IDE handshakes directly
- RFC 7591 dynamic client registration — with deduplication via a native before-hook
- `GET /v1/installations` — grant discovery endpoint for installed partners
- Consent screen polish — auto-redirect after 3s on success, `IconCode` fallback for clients without `logo_uri`
- Grant revocation reads through `dbDirect` — revokes are reflected immediately, not after cache TTL
Content CMS Analytics `NEW`
Every content entry now ships with view analytics.
`publishEntry` now refuses to mark entries with empty body translations as published — prevents accidental "ghost" entries in the CDN.
---
- Per-entry sparkline in the entry table — gradient fill, hover tooltip with count, 7d/30d period toggle
- Cloudflare-style TimeRangePicker — 10 presets, custom range, timezone awareness, recently-used
- Analytics sidebar with country and referrer breakdowns
- Backend — full stats endpoint on Cloudflare Analytics Engine, KV-cached per period, deterministic cache busting
- In-place CMS enablement from the empty state — no separate setup flow
Onboarding Wizard `IMPROVED`
---
- Inline website analysis with auto background enrichment — runs through OpenRouter (`gpt-4o-mini`) instead of Gemini for the analyzer
- OAuth MCP step for Claude Code and Cursor — no-key handshake
- Chrome-aware skeleton for the setup wizard pending state — page shape matches the real layout
- Setup wizard migrated to canonical `projectId` throughout
Telemetry & Reliability `IMPROVED`
---
- PostHog Managed Reverse Proxy migration — drop the self-hosted proxy, exceptions captured via proxy-rewritten extension chunks
- Sourcemap pipeline wired to PostHog for readable production stack traces
- `no-cache` on index.html — returning users always get current chunks (the root cause of intermittent stale-chunk crashes)
- **`vite: preloadError` recovery** — auto-reload with cache bust plus a session-capped retry budget
- **TanStack Router #7120 workaround** — root route uses `wrapInSuspense: true` to close the first-load race that threw bare `undefined` in `<MatchInnerImpl>`
Security `IMPROVED`
---
- `samlify` >= 2.13.0 — GHSA-34r5-q4jw-r36m (XML injection)
- `dompurify` >= 3.4.0 — editor XSS surface closed
- `next` >= 16.2.6 — 8 high CVEs patched via override
- Release workflow actions pinned to commit SHAs
- `osv-scanner` gate aligned to high+ severity policy
- CODEOWNERS plus an org-level security baseline wired across the workspace
Bug Fixes & Polish
- Stripe sync now uses plugin callbacks (`onSubscriptionCreated` / `onSubscriptionUpdate`) instead of `databaseHooks` — fixes the May 5 incident where subscription state diverged from the billing UI
- Webhook `findFirst` → `findMany` + `deletedAt` filter — fixes silent push drop when a deleted project shared the same repo
- Admin impersonate banner moved from layout to a sidebar card
- Stop button actually halts running workflows, not just the chat fetch
- Session selector redesigned to match the Select component style
- Multiple chat persistence fixes: rich tool parts restore 1:1 with the live stream, interactive parts preserve on same-id stream continuation, terminal workflow snapshots round-trip through restore