Portfolio patch 1.2
Released on 7 September 2026, this patch expanded the portfolio with a public activity timeline, AI answers grounded in recent updates, and LangSmith tracing for inspecting chat execution.
Activity Page
- Dated activity entries: Displays titles, descriptions, dates, and optional pictures in a responsive timeline.
- Protected content management: Allows administrators to create, edit, delete, and arrange entries through authenticated Nuxt server APIs.
- Persistent activity records: Introduces D1 tables and Drizzle migrations for activity content, display order, image references, and creation/update timestamps.
- Activity pictures: Adds cropping, resizing, and JPEG compression before storing images in Cloudflare R2. Public image endpoints support ETag-based cache revalidation.
- Loading and recovery states: Includes loading placeholders, an empty-timeline message, and a retry action when activity data cannot be retrieved.
- Direct activity links: Gives entries stable anchors so visitors can navigate to updates referenced by the assistant.
AI Chat tool for Activity
- Dedicated activity search: Introduces the
search_leonardo_activitytool, allowing the model to retrieve updates relevant to a visitor’s question. - Phrase and date filtering: Supports case-insensitive phrase matching across titles and descriptions, plus inclusive date ranges interpreted using Melbourne calendar dates.
- Current database results: Reads activity records directly from the request’s D1 database, making published updates available without generating embeddings or running document ingestion.
- Linked activity citations: Assigns stable citation labels and streams timeline links alongside existing document citations.
- Bounded tool execution: Returns five activities by default, supports up to ten per lookup, and permits at most two activity lookups across three model steps.
- Grounded response handling: Instructs the assistant to distinguish unavailable information, failed searches, and partial result lists. Parameterized queries and Zod validation constrain tool inputs.
- Environment isolation: Uses the application’s development or production database binding for each request.
AI Tracing
- Request-level traces: Creates a
portfolio-chattrace connecting the visitor’s question with document retrieval, model execution, tool calls, and the final answer. - Retrieval inspection: Records the library retrieval operation, including its inputs and returned context.
- Model and tool visibility: Connects AI SDK telemetry with LangChain callbacks to capture model messages, outputs, activity-search arguments, results, timings, and errors.
- Separate tracing environments: Routes development and production traces to
leonardo-chat-devandleonardo-chat-prod, using request-scoped clients and environment-specific credentials. - Streaming lifecycle support: Finalizes traces when streaming completes and registers trace delivery with Cloudflare Worker
waitUntil, flushing pending batches. - Failure reporting: Records cancellations, retrieval failures, and generation errors. Trace-delivery failures produce a diagnostic log while preserving the chat response.
- Controlled telemetry fields: Disables raw HTTP tracing and excludes headers, cookies, client IPs, and credentials from supplied trace metadata. Questions, model messages, and outputs are included for debugging.