Explicitly listed all write tools that require confirmation:
create_order, dispatch_renders, set_material_override, set_render_overrides
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split rules into read-only vs write actions:
- READ (search, list, show images, status): execute immediately
- WRITE (create orders, dispatch, set overrides): ALWAYS ask for
confirmation before executing
Prevents accidental render job creation from casual questions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
System prompt rule 12: always format product mentions as
[ProductName](/products/UUID) and orders as [OrderNumber](/orders/UUID).
ReactMarkdown in ChatPanel already renders these as clickable links
with accent color styling, so users can navigate directly from chat.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added list_materials tool to the chat agent:
- Searches SCHAEFFLER library materials by name, description, or alias
- Returns material name + schaeffler_code + aliases
- Enables: "zeig mir ein Bild mit Durotect-Material" → agent searches
for "durotect" → finds SCHAEFFLER_020101_Durotect-Blue → uses as
material_override
System prompt updated with rules 10-11:
- Explains alias → library material mapping
- Always use full SCHAEFFLER name for material_override
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
System prompt rewritten with explicit RULES:
- Never ask user for info you can query yourself
- "Any product" / "beliebig" → just pick one, don't ask back
- Execute immediately, no confirmation needed
- Be concise, short answers preferred
find_product_renders tool:
- No longer requires product_name or product_id
- Call with empty params → returns any recent renders
- Enables "show me any render with transparent bg"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added find_product_renders tool to the AI agent:
- Searches completed renders by product name/ID
- Returns viewable image URLs (relative paths)
- Supports transparent_only filter
- AI formats results as Markdown images/links in chat
Frontend:
- ChatPanel ReactMarkdown renders <img> and <a> tags
- Images shown inline (max 200px height, rounded, bordered)
- Links open in new tab with accent color
System prompt updated to instruct AI to use Markdown image syntax
when showing renders: 
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- All httpx tool calls use real user_id instead of uuid(int=0) for
service token — fixes 401 Unauthorized on dispatch/override
- create_order auto-submits and auto-dispatches in one step
- System prompt updated: execute immediately without asking for
confirmation, respond in user's language
- Product search returns CAD dimensions (dim_x/y/z_mm)
- query_database tool description includes cad_files schema
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- search_products now returns dim_x_mm, dim_y_mm, dim_z_mm from
cad_files.mesh_attributes->'dimensions_mm'
- query_database tool description updated with cad_files schema
including mesh_attributes->'dimensions_mm' path
- AI can now answer "what's the biggest product?" using real dimensions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Frontend: Layout extracts order/product UUID from URL path and passes
to ChatPanel as contextType/contextId. When on /orders/{uuid}, the
chat knows which order you're viewing.
Backend: System prompt now loads actual entity data for the context:
- Order: order_number, status, line counts (completed/processing/failed)
- Product: name, PIM-ID, category, STEP file status
The AI understands "this order", "current product" etc. Example:
"What's the status of this order?" → agent knows you mean SA-2026-00164
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a tool like query_database fails (e.g., bad column name), the
SQLAlchemy session enters a failed transaction state. Subsequent
operations (like saving the assistant response) then also fail with
InFailedSQLTransactionError.
Fix: rollback the session in the except block of _execute_tool().
Also improved query_database tool description with correct column
names (category_key not category) to help the AI write valid SQL.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Actionable AI assistant that uses per-tenant Azure OpenAI credentials
to execute natural language commands against the render pipeline.
Backend:
- ChatMessage model + migration (session-based conversations)
- Chat service with 10 OpenAI function-calling tools:
list_orders, search_products, create_order, dispatch_renders,
get_order_status, set_material_override, set_render_overrides,
get_render_stats, check_materials, query_database
- All tools tenant-scoped (queries filtered by tenant_id)
- Write operations use httpx to call backend API internally
- Chat API: POST /chat/messages, GET /chat/sessions, DELETE session
- Conversation history preserved in DB (last 50 messages per session)
Frontend:
- Slide-out ChatPanel (right side, w-96, animated)
- User/assistant message styling with avatars and timestamps
- Session management (new chat, session history, delete)
- Typing indicator while waiting for AI response
- Floating chat button in bottom-right corner
- Error state for unconfigured AI tenants
Example: "Render all Kugellager products as WebP at 1024x1024"
→ Agent calls search_products + create_order + dispatch_renders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>