Feature/fix migrations - #10
Merged
Merged
Conversation
…and improved error handling Updated migration logic to support slug-based function names (e.g., `up_<slug>`) for better organization and future-proofing. Introduced dynamic callable detection, fallback logic for legacy methods, and robust error reporting with early failure handling. Standardized naming for migration scripts to ensure consistency.
… handling Introduced optional filtering to execute specific migrations via the `?only=<slug[,slug2,...]>` parameter. Enhanced input sanitization and validation, standardized output, and improved legacy compatibility messaging. Updated migration list UI with filter results.
…t features Refactored the Classifier to include OpenAI-compatible functionality with enhanced HTTP request handling, exponential backoff, and detailed JSON processing for vision-classification workflows. Added support for runtime options, fallback logic, moderation passes, and dynamic schema normalization. Improved error handling, configuration flexibility, and retry mechanisms for API interactions. Enforced strict typing and project alignment with extended extensibility.
…control Introduced a `/wp-json/psai/v1/debug-log` API endpoint for admins to inspect the debug log. Includes customizable line limit control (default 200, min 10, max 2000) and ensures proper permissions (`manage_options`). Implemented safe file handling, robust parameter validation, and efficient log reading with reverse tailing logic.
Adjusted the `/psai/v1/debug-log` API endpoint permissions to require logged-in users with `edit_posts` capability instead of `manage_options` for broader yet controlled accessibility.
…lid values Enforced allowed `detail` values and set a fallback to `high` when an invalid value is provided in `buildVisionContent`.
…image processing flow Implemented `psai_set_last_error` and `psai_clear_last_error` functions for streamlined error management on attachment metadata. Enhanced image processing logic with global transient error storage, clearer error feedback, and robust precondition checks.
…ved feedback Added specific error messages and transient storage for embedding failures, including API call, input validation, and database errors. Introduced automatic transient error clearing on success. Improved admin messaging with partial error states and debug log links for troubleshooting. Refined Qdrant logging for non-fatal upserts.
… model options Enhanced error reporting by combining transient and metadata storage for embedding failures. Added `EMBEDDING_MODEL` to schema config for flexible embedding model selection. Improved admin UI with additional error detail display.
…handling Introduced `build_embedding_input()` for constructing detailed embedding input from payloads. Updated `qdrant_upsert()` to return success status, improving feedback mechanisms for upsert operations.
…dling Added `input_hash` column to `ps_text_embeddings` via migration to optimize storage by avoiding redundant embedding generations. Improved `EmbeddingService` error handling with detailed database error messages and persistent error storage using `psai_set_last_error`.
Introduced a new REST API endpoint (`/psai/v1/qdrant-status`) for Qdrant configuration diagnostics. Improved error handling for vector search with detailed debug logs, including Qdrant availability status and configuration details. Updated temp file handling for more robust image processing and clarified Qdrant schema configuration documentation.
Improved Qdrant diagnostic endpoint (`/psai/v1/qdrant-status`) with additional database insights, including table structure validation and embedding count. Enhanced `EmbeddingService` with persistent error storage (`psai_set_last_error`) for Qdrant sync failures and cleared transient errors on success. Updated admin UI with detailed Qdrant sync warnings and troubleshooting tools.
Introduced `/psai/v1/my-ip` API endpoint for logged-in users to retrieve server, external, and forwarded IP details. Improved `/psai/v1/qdrant-status` diagnostics with API key header support and detailed error handling for unsuccessful responses.
Added `/psai/v1/qdrant-init` endpoint for initializing Qdrant collections with public method invocation and transient clearing. Enhanced admin UI with "Initialize Qdrant Collection" button, including inline JavaScript for interactive initialization status and error feedback. Improved `EmbeddingService` logs for collection existence and creation.
…ccessibility updates Enhanced semantic search styling by introducing dark mode compatibility, modernized hover/transition effects, improved responsiveness, and polished placeholder design. Added support for reduced motion preferences, streamlined card layouts, and refined accessibility elements for search interactions.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a complete semantic search feature for PostSecret by adding Qdrant vector database integration and creating a new search interface. The changes enable AI-powered semantic similarity search by:
- Adding Qdrant configuration settings and vector database operations
- Creating a new semantic search API endpoint with advanced caching
- Implementing a JavaScript-based search interface with infinite scrolling
- Replacing the old WordPress search template with a modern semantic search experience
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wp-content/themes/postsecret/search.php | Complete rewrite to support semantic search with JavaScript-based result loading and Mustache templating |
| wp-content/themes/postsecret/parts/header.html | Replaced default WordPress search widget with custom semantic search form |
| wp-content/themes/postsecret/functions.php | Added semantic search CSS/JS assets and removed old search enhancement script |
| wp-content/themes/postsecret/assets/js/semantic-search.js | New comprehensive search client with caching, infinite scroll, and error handling |
| wp-content/themes/postsecret/assets/css/semantic-search.css | Responsive styling for search interface with dark mode support |
| wp-content/plugins/postsecret-search/ | New plugin providing Qdrant integration and REST API endpoints |
| wp-content/plugins/postsecret-feed/postsecret-feed.php | Skip loading stream assets on search pages |
| wp-content/plugins/postsecret-ai/src/ | Enhanced Settings, Schema, EmbeddingService, and Classifier with Qdrant support |
| wp-content/plugins/postsecret-admin/run-migrations.php | Improved migration runner with filtering and better error handling |
| wp-content/plugins/postsecret-admin/migrations/ | Updated migration functions and added new embedding input hash migration |
| docker-compose.yml | Added Qdrant service configuration for local development |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.