- Add language column (powershell/bash/python) to script_templates model and schemas
- Seed 'AI Generated' script category via migration 063
- Add mine and shared query params to list_templates endpoint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ScriptCodeBlock: collapsed code preview with syntax highlighting (first 5 lines)
- ScriptBuilderInput: auto-resize chat input with Enter-to-send
- ScriptBuilderChat: message list with markdown rendering and code blocks
- ScriptPreviewModal: fullscreen script viewer with line numbers
- SaveToLibraryDialog: save script with name, description, category, team sharing
- ScriptBuilderPage: language selector, session management, FlowPilot handoff
- Added route, sidebar nav item (fuchsia), and mobile nav entry
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Also fix bug in save_to_library: remove invalid 'language' kwarg
passed to ScriptTemplate constructor (column doesn't exist on model).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Script Builder service with language-specific system prompts (PowerShell, Bash, Python)
- AI-powered script generation with code block extraction and filename detection
- Context window management (last 20 messages) and session message limits
- REST API: CRUD sessions, send messages, save to Script Library
- Rate limiting on message endpoint (10/min), max 5 concurrent sessions per user
- Registered script_build action in AI model tier routing (standard tier)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
README: updated to reflect current product (FlowPilot, PSA integration,
Knowledge Flywheel), fixed stale roadmap references to closed issues,
corrected Tailwind version (v3→v4), added Quick Start section, linked
all documentation.
CHANGELOG: organized by version from v0.1.0 (Jan 2026) through v0.9.0
(current), covering all major features across 9 releases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(landing): design audit fixes — hamburger menu, dead links, branding, spacing
- Add mobile hamburger menu with animated open/close and click-outside dismiss
- Create Privacy and Terms pages (footer links were dead # anchors)
- Change "Decision Tree Platform" to "AI-Powered Troubleshooting for MSPs" on login, register, and HTML title
- Fix register page icon color (was red/coral via CSS invert, now uses BrandLogo directly)
- Replace "0 Ticket Notes Written by Hand" stat with "100% Auto-Generated Documentation"
- Increase nav link touch targets to 44px minimum
- Fix heading hierarchy: section titles are now <h2>, standardize H3 to 1.25rem
- Tighten section spacing (6rem → 4rem padding, remove extra 5rem spacer)
- Add color-scheme: dark to HTML element
- Replace all transition: all with specific properties (10 occurrences)
- Fix loading ellipsis (... → …)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(mobile): responsive modals + landing preview overflow
- PrepareSessionModal: bottom-sheet on mobile, centered on desktop
- IntakeFormModal: bottom-sheet on mobile, responsive padding
- ShareTreeModal: bottom-sheet on mobile, full-width on small screens
- Landing preview: hide URL bar and window controls on mobile (<900px)
to prevent 189px horizontal overflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(mobile): collapse search bar to icon on mobile
On mobile (<640px), the full search bar with placeholder text and ⌘K
badge was taking too much space in the topbar. Now shows just a
magnifying glass icon that opens the same command palette on tap.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: chihlasm <michael@resolutionflow.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added lessons for varchar(30) status column, get_db rollback, action
bar height chain, dashboard prefill auto-submit, navigation guard,
and manual Alembic migration preference. Updated project structure
and frontend patterns for new dashboard cockpit and sidebar sections.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users without team_id (solo accounts, pro plans) couldn't see
escalations because the query filtered by team_id which was NULL.
Now falls back to account_id scoping for both the escalation queue
endpoint and the sidebar badge count.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add escalation_count to sidebar stats (team-wide requesting_escalation)
- Show badge on Escalations nav item in sidebar
- Remove user_id filter from escalation queue — show all team escalations
including your own (needed for solo users and visibility)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
User model has 'name', not 'display_name'. Fixed in flowpilot_engine
(escalate notify + pickup briefing) and psa_documentation_service
(engineer name in exported docs).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
'requesting_escalation' is 23 characters, exceeding the varchar(20)
limit. This caused a StringDataRightTruncationError 500 on escalate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents InFailedSQLTransaction cascade — when a request fails mid-
transaction, the connection is rolled back before being returned to
the pool, so subsequent requests on the same connection don't inherit
a poisoned transaction state.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows a confirmation modal when user tries to navigate away during an
active troubleshooting session. Options: "Stay in Session" or "Pause &
Leave" which auto-pauses the session before navigating.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When user types a problem on the dashboard and hits Enter, skip the
intake form and start the session immediately — no double-enter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace QuickStartPage with FlowPilot-centric dashboard
- Add StartSessionInput with Guided/Chat mode toggle
- Add PendingEscalations, ActiveFlowPilotSessions, PerformanceCards
- Add KnowledgeBaseCards, TeamSummary, RecentFlowPilotSessions
- Every number/card is a portal to its detail page
- Restructure sidebar: Resolve/Knowledge/Insights sections
- Remove redundant nav items (FlowPilot, Flow Editor, Flow Assist, etc.)
- Wire prefill from dashboard input to FlowPilot intake
- Update mobile nav to match new sidebar structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The same model_validate bug existed in link_ticket endpoint (line 467).
Extracted the manual AISessionDetail construction into a shared helper
_build_session_detail() used by both get_session and link_ticket.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: AISessionDetail.model_validate(session) tried to validate the
ORM relationship 'steps' which has field 'id', but AISessionStepResponse
expects 'step_id'. This caused a Pydantic ValidationError on every session
detail load.
Fix: Construct AISessionDetail manually from ORM fields, passing the
already-built step_responses list directly instead of relying on
model_validate to serialize the ORM steps relationship.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Temporary debug commit — surfaces the actual exception when GET /ai-sessions/{id}
fails with 500, instead of generic "Internal server error" from middleware.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: Both RequestLoggingMiddleware and ErrorLoggingMiddleware used
BaseHTTPMiddleware and re-raised exceptions. When an exception (like a 401
from auth) was re-raised, the response never flowed back through
CORSMiddleware, so browsers received error responses without CORS headers.
This made 401 errors appear as CORS errors, breaking session resume and
other operations after token expiry.
Fix: Both middlewares now catch exceptions and return JSONResponse objects
(with correct status codes from HTTPException) instead of re-raising. This
ensures responses always flow through CORSMiddleware and receive proper
Access-Control-Allow-Origin headers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous approach tried to fix the flex height chain, but it proved fragile
across grid → main → outlet → page transitions. New approach: action bar is
position:fixed at the bottom of the viewport, offset by sidebar width via
CSS variable --sidebar-w. Conversation area has pb-20 for clearance.
This works regardless of the height chain, email verification banner,
or any other variable-height elements above the session.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The flex height chain through grid → main → outlet → page doesn't reliably
constrain height, causing the action bar to overflow below viewport. The tree
editor already solves this with h-[calc(100vh-56px)] (subtracting the topbar).
Apply the same proven pattern to FlowPilotSessionPage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause found via DOM inspection: main-content (a CSS grid item) had
default min-height:auto, which prevented the grid from constraining it
below its content height. Content grew to 994px in a 975px viewport,
pushing the FlowPilot action bar (Resolve/Escalate/Pause) 75px below
the visible area. overflow:hidden on the grid clipped it invisibly.
Fix: min-h-0 on main-content allows the grid to shrink it to fit,
completing the height chain all the way down to the action bar.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: ViewTransitionOutlet wrapping <Outlet> had flex-1 min-h-0 but
display:block (no flex flex-col). Child pages using h-full flex-col couldn't
resolve height against a block parent, so content overflowed and the
FlowPilot action bar (Resolve/Escalate/Pause) rendered below the viewport.
Fix: Add flex flex-col to the outlet wrapper so the full flex height chain
works: app-shell grid → main flex-col → outlet flex-col → page flex-col.
Also removed the h-0 workaround from FlowPilotSessionPage since this
addresses the actual root cause.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two issues:
1. AI context messages (teal bubble) rendered raw markdown (**bold** etc.)
instead of parsed markdown — switched from <p> to <MarkdownContent>
2. Action bar still hidden — added h-0 to flex-1 wrapper to force explicit
height allocation so h-full on FlowPilotSession resolves correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The FlowPilotSession component uses h-full flex-col to position the action
bar at the bottom, but its parent div in FlowPilotSessionPage only had
flex-1 min-h-0 without flex flex-col. This broke the height chain, causing
the action bar to render below the visible area.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: embedding generation could break the DB transaction via a failed
SQL statement. The except block caught the Python error but left the transaction
in a failed state. Subsequent queries (_record_usage → subscription lookup)
then failed with InFailedSQLTransactionError.
Fixes:
- session_embedding_service: use begin_nested() savepoint so failures don't
poison the parent transaction
- ai_sessions.py: add db.rollback() before _record_usage in all 3 error
handlers (create, respond, pickup) to recover from broken transactions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix AISession.ticket_id → psa_ticket_id in list_sessions filter query
- Add Gallery nav item (LayoutGrid icon) to AdminSidebar navItems array
- Remove ForeignKey from FileUpload.session_id (Python model) + migration b8d2f4a6c091 to drop DB constraint, allowing column to reference either session type
- Add 400ms debounce on AI session search input in SessionHistoryPage (aiSearchInput state + useRef timeout pattern)
- Show friendly 503 error message in RichTextInput upload error handler (both initial upload and retry paths)
- Add overflow-x-auto to FlowPilotAnalyticsPage tab bar container
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds vector-based similar session discovery using the existing Voyage AI
embedding infrastructure and pgvector cosine similarity search.
- New AISessionEmbedding model with vector(1024) column
- session_embedding_service: generate + upsert embeddings, find similar sessions
- Embeddings generated on session create (from problem_summary/domain) and
updated on resolve (adds resolution_summary)
- GET /ai-sessions/{id}/similar endpoint returns top-N similar sessions
- Migration a7c9e3b1f402 creates ai_session_embeddings table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- FileUploadResponse and PendingUpload types in types/upload.ts
- uploadsApi with upload(), getUrl(), list(), remove() methods
- Exported from types/index.ts and api/index.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- POST /uploads: multipart upload with content-type/size validation, per-session limits, S3 storage
- GET /uploads/{id}/url: presigned download URL with account ownership check
- GET /uploads: list uploads for a session
- DELETE /uploads/{id}: delete with ownership enforcement (403 for non-owners)
- Returns 503 gracefully when STORAGE_ENDPOINT is not configured
- 15 integration tests covering auth, validation, 503 behavior, and ownership
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CoverageHeatmap: add Avg Resolution column with inverse color thresholds (green <10 min, amber 10–20 min, red >20 min); updated colSpan to 7
- FlowPilotAnalyticsPage: show positive empty state when knowledge gaps list is empty instead of rendering nothing
- FlowQualityTable: add tree_type badge next to flow name (Troubleshooting/Project/Maintenance with distinct colors)
- FlowPilotAnalyticsPage: add [&>option] Tailwind classes to period select for improved dark-theme contrast in Chrome/Firefox
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>