Commit Graph

63 Commits

Author SHA1 Message Date
southseact-3d
35b8084032 Hide external WP tests UI elements from builder page 2026-02-10 10:04:59 +00:00
southseact-3d
a6ba703fd8 Fix three plan message issues:
1. Fix Ollama 504 Gateway Timeout - add 30s timeout to prevent long hangs
2. Add Ollama to provider error classification for proper fallback handling
3. Show model selector when proceed with build modal opens

These fixes ensure Ollama failures are handled gracefully with proper fallback
to Groq, and users can select their model before starting the build.
2026-02-10 10:00:38 +00:00
southseact-3d
b904e35528 Fix: Handle null el.limitBackup in admin.js to prevent TypeError when adding limits 2026-02-10 09:27:06 +00:00
OpenCode Dev
960ccb5742 Add hourly rate limits (tokens/hour, requests/hour) and missing providers (chutes, cerebras, ollama) 2026-02-10 09:04:44 +00:00
southseact-3d
58bab1c5d8 Add PluginCompass Provider System documentation
This document describes the architecture and functionality of the PluginCompass AI provider management system, including:
- Admin panel structure and authentication
- Provider management with supported providers (OpenRouter, Mistral, Google, Groq, NVIDIA, Chutes, Ollama)
- Rate limiting system with per-provider and per-model limits
- Fallback system architecture with multi-level fallback chains
- Usage tracking and monitoring capabilities

The documentation covers both technical implementation details and operational guidance for managing the provider infrastructure.
2026-02-09 18:23:55 +00:00
southseact-3d
91308fd061 implementation of db 2026-02-09 18:18:39 +00:00
southseact-3d
a546eafc0b updt=ate ollama indocker and add plugins 2026-02-09 18:09:12 +00:00
southseact-3d
a52572ede1 Hide Proceed with Build button when AI needs clarification
- Add pattern matching to detect clarification requests in plan responses
- Hide Proceed with Build button when AI asks questions about missing details
- Button will still show for complete plans that are ready to build
2026-02-09 18:05:59 +00:00
southseact-3d
f9dc1a6920 Fix provider limits to only use configured providers and support OpenRouter model formats 2026-02-09 18:03:08 +00:00
southseact-3d
e9c5200e7c Fix admin authentication for contact messages API
- Changed getUserSession to getAdminSession for all contact message endpoints
- Admin panel now properly authenticates and displays contact messages
- Fixed list, mark-read, and delete operations
2026-02-09 17:58:22 +00:00
southseact-3d
74871ae05c Update contact page header to match home.html design
- Added Tailwind CSS and matching navigation from home.html
- Implemented glass-morphism navigation with mobile menu
- Added navbar scroll effects and responsive design
- Verified backend contact form functionality exists and works correctly
2026-02-09 17:54:49 +00:00
Liam Hetherington
5cbdeeed35 Merge pull request #13 from southseact-3d/cto-task-ok-so-when-starting-this-app-i-get-these-errors-i-get-these-e01
Clean up entrypoint startup logs and remove GitHub auth handling
2026-02-09 16:28:07 +00:00
cto-new[bot]
8d4cae9707 Clean up entrypoint startup logs and remove GitHub auth handling 2026-02-09 16:13:58 +00:00
cto-new[bot]
3fb5bd1094 Replace python dependency in entrypoint and quiet repo credential logs 2026-02-09 16:09:03 +00:00
southseact-3d
df58e4b239 fix opsm 2026-02-09 15:39:28 +00:00
southseact-3d
d5065b117f add provs to docker compose 2026-02-09 15:21:15 +00:00
southseact-3d
f3af567aea Fix Chutes models not loading in admin page - Add missing fetchChutesModels() function and include it in external provider fetches 2026-02-09 14:50:54 +00:00
Liam Hetherington
aaf06a4a54 Merge pull request #12 from southseact-3d/cto-task-ok-so-for-the-opensmtpd-i-get-this-error-please-fix-and-star-e02
Ensure OpenSMTPD symlink setup at runtime
2026-02-09 14:07:43 +00:00
cto-new[bot]
6c12d282cd Ensure OpenSMTPD symlink setup at runtime 2026-02-09 13:44:48 +00:00
Liam Hetherington
4cd57bc012 Merge pull request #11 from southseact-3d/cto-task-ok-so-for-the-opensmtpd-i-get-this-error-please-fix-and-star-e01
Fix OpenSMTPD binary path detection with fallback to system installation
2026-02-09 13:33:52 +00:00
cto-new[bot]
ee4e630b45 fix(scripts): add fallback logic for OpenSMTPD binary detection
The scripts were hardcoded to look for OpenSMTPD at a custom workspace
path, but the Dockerfile installs it via apt to /usr/sbin/smtpd. This
change adds fallback logic to check multiple locations:

1. Custom workspace path (for backward compatibility)
2. System path /usr/sbin/smtpd
3. Anywhere in PATH

Also adds graceful handling when OpenSMTPD is not installed, logging
an informative message instead of failing with "No such file or directory".
2026-02-09 12:51:31 +00:00
Liam Hetherington
0d17918cad Merge pull request #10 from southseact-3d/cto-task-can-you-fix-the-opensmtpd-server-so-it-is-completely-set-up
Add OpenSMTPD support for email server functionality
2026-02-09 12:32:13 +00:00
cto-new[bot]
6bb30a6de2 Add OpenSMTPD support for email server functionality 2026-02-09 12:28:30 +00:00
southseact-3d
b95efaebea complered tools 2 and guide 2026-02-08 20:15:38 +00:00
southseact-3d
bd6817f697 completed tools and setup 2026-02-08 20:02:30 +00:00
southseact-3d
39136e863f implement wp testing 2026-02-08 19:27:26 +00:00
southseact-3d
541b6bc946 fix: pony-alpha model status and SSE stream heartbeat issue
- Change openrouter/pony-alpha model status from 'alpha' to 'beta' to prevent deletion
- Fix ReferenceError where heartbeat was used before initialization in cleanupStream
- Declare heartbeat and streamTimeout with let before cleanupStream function
- Change const assignments to let assignments for timer variables
2026-02-08 19:20:23 +00:00
southseact-3d
eb7aa29c0c fix quedued issue with repull container 2026-02-08 17:43:00 +00:00
southseact-3d
1e0168b301 rem last build change 2026-02-08 17:38:43 +00:00
southseact-3d
c30d2ba715 Fix scroll-to-bottom in builder page
- Simplified scrollChatToBottom() with more reliable techniques
- Added scrollIntoView on last message as fallback
- Added additional scroll with direct scrollTop assignment after delay
- Added CSS optimizations for scrolling behavior (-webkit-overflow-scrolling, transform, will-change)
- Added more robust scroll attempts in renderMessages after DOM updates
2026-02-08 17:16:07 +00:00
southseact-3d
55bada9ee2 Fix scroll-to-bottom on page load/refresh in builder page
The scroll-to-bottom functionality wasn't working properly on page load because
messages take time to load and render. This fix adds:

- Enhanced scrollChatToBottom() with image load detection
- ResizeObserver to detect content height changes
- Multiple scroll attempts with increasing delays (up to 2s)
- Additional scroll calls in selectSessionById with proper delays
- Scroll calls at end of initBuilder initialization

This ensures the chat area properly scrolls to the bottom even when content
loads asynchronously or images take time to render.
2026-02-08 16:51:06 +00:00
southseact-3d
dacde39400 debug: Add logging to help diagnose provider loading issues
Add detailed logging to provider initialization to help debug why Chutes
and other providers aren't loading:
- Log all providers found in database
- Log API key env vars detected
- Log custom loader results with autoload status
- Log final loaded providers count

This will help identify if the issue is:
1. Database not loading correctly
2. Missing env vars
3. Custom loaders not being called
4. Providers being filtered out
2026-02-08 16:23:51 +00:00
southseact-3d
26c6f5f6c7 fix: Add pony-alpha model and fix model lookup for prefixed model IDs
- Add openrouter/pony-alpha model to models-api.json fixture
- Fix getModel() to lookup models with provider prefix (e.g., openrouter/pony-alpha)
  When user specifies openrouter/pony-alpha, the code now correctly looks for
  the full model ID including prefix in the provider's models object

This fixes the 'ModelNotFoundError' when using OpenRouter models that have
prefixed IDs in the database.
2026-02-08 16:21:21 +00:00
southseact-3d
1fbf5abce6 feat: Add support for multiple AI providers (bytez, llm7.io, aimlapi.com, routeway.ai, g4f.dev) and fix Chutes loader
- Add custom loaders for bytez, llm7, aimlapi, routeway, and g4f providers
- Add provider definitions to models-api.json with sample models
- Add provider icon names to types.ts
- Chutes loader already exists and should work with CHUTES_API_KEY env var

Providers added:
- bytez: Uses BYTEZ_API_KEY, OpenAI-compatible
- llm7: Uses LLM7_API_KEY (optional), OpenAI-compatible
- aimlapi: Uses AIMLAPI_API_KEY, OpenAI-compatible
- routeway: Uses ROUTEWAY_API_KEY, OpenAI-compatible
- g4f: Uses G4F_API_KEY (optional), free tier available
2026-02-08 16:07:02 +00:00
southseact-3d
fccfd80b10 feat: Add custom loader for Chutes provider 2026-02-08 15:55:33 +00:00
southseact-3d
50fda4000c fix: Improve text line separation in builder response
- Update regex to handle both periods and colons as sentence separators
- Properly separate sentences followed by uppercase letters with double newlines
- Fixes issue where OpenCode response text wasn't properly line-separated
2026-02-08 15:15:34 +00:00
southseact-3d
d796e5034d fix: Fix syntax error and add PLUGIN_COMPASS_CHUTES_API_KEY env var support 2026-02-08 14:50:55 +00:00
southseact-3d
ab7799ca58 feat: Add rate limiting and automatic provider switching
- Add rate limit detection and parsing from HTTP 429 responses
- Implement automatic retry with exponential backoff for short-term rate limits
- Implement automatic provider switching for long-term rate limits
- Add circuit breaker pattern for failing providers
- Integrate with existing admin panel rate limit configuration
- Add allProviders parameter to LLM.stream calls to enable provider fallback

Rate limit behavior:
- Short-term (< 5 min): Retry with configured backoff strategy
- Long-term (≥ 5 min): Switch to next available provider
- Max retries: 3 (configurable via admin panel)
- Max wait time: 5 minutes (configurable via admin panel)
- Provider switching: Enabled by default (configurable via admin panel)

Provider priority:
1. Anthropic
2. OpenAI
3. Google
4. OpenRouter
5. Groq
6. xAI
7. Together AI
8. Perplexity
9. DeepInfra
10. Cerebras
11. Mistral
12. Cohere
13. Amazon Bedrock
14. Azure
15. GitHub Copilot
16. GitHub Copilot Enterprise
17. OpenCode
18. ZenMux
19. Google Vertex
20. GitLab
2026-02-08 14:37:02 +00:00
southseact-3d
2dc94310a6 Add comprehensive model fallback improvement plan
- Detailed error classification system for tool errors, early termination, and provider errors
- Provider-specific error mappings for 11 LLM providers (OpenAI, Anthropic, OpenRouter, Chutes, NVIDIA, Together, Fireworks, Mistral, Groq, Google)
- Continue message system with 3-attempt limit before model switch
- 30-second wait for transient/rate limit errors before switching
- Distinguishes tool errors (return to user) from provider errors (switch model)
- Implementation plan with code examples for server.js and processor.ts
2026-02-08 14:16:32 +00:00
southseact-3d
9ef54cf6ee feat: display OpenCode todos with status on builder page
- Capture todowrite tool events and store todos on messages
- Add API endpoint GET /api/sessions/:sessionId/todos
- Clear todos on message finish, undo, and redo
- Create renderStructuredTodos function with status icons
- Integrate todo display into message rendering
- Add CSS styling for todo items by status and priority
2026-02-08 14:00:29 +00:00
southseact-3d
638f9ae5d2 Add WordPress and WooCommerce validation tools for PluginCompass
- Create wordpress-validate.cjs tool for WordPress plugin validation
- Create woocommerce-validate.cjs tool for WooCommerce-specific checks
- Create agent/wordpress.md system prompt for PluginCompass branding
- Update opencode.jsonc to enable new tools and agent configuration

Both tools are token-efficient:
- Success: minimal JSON output (~50 tokens)
- Failure: detailed issues with file paths, line numbers, and suggestions

wordpress-validate checks:
- Forbidden functions (eval, exec, shell_exec, etc.)
- SQL injection vulnerabilities
- XSS vulnerabilities (direct superglobal echo)
- CSRF protection (nonces)
- Capability checks
- Direct file access protection
- Deprecated WordPress functions
- AJAX security
- REST API security
- CSS overlap issues

woocommerce-validate checks:
- HPOS compatibility declaration
- Legacy database access patterns
- Deprecated WooCommerce code
- Version headers (WC tested up to, WC requires at least)
- Database safety (dbDelta usage)
- Blocks compatibility
- Payment gateway implementation
- Shipping method implementation
- AJAX security

All tools follow opencode AGENTS.md coding standards
2026-02-08 13:40:56 +00:00
southseact-3d
42be1781e0 chore: reduce token limits for Professional and Enterprise plans
- Professional plan: reduced from 10M to 5M tokens per month
- Enterprise plan: reduced from 50M to 20M tokens per month
- Hobby (50k) and Starter (100k) remain unchanged

These limits align with the updated pricing structure from shopify-ai.
2026-02-08 13:33:32 +00:00
southseact-3d
0f631dc99a feat: implement prompt injection protection and OpenRouter paid API key support
- Add comprehensive prompt injection security module with 160+ attack pattern detection
- Implement security checks in message handling with proper blocking and user feedback
- Add OpenRouter paid API key support (OPENROUTER_PAID_API_KEY) for premium models
- Update model discovery and chat functions to use paid API key for premium models
- Add comprehensive test suite with 434 test cases (98.39% accuracy)
- Tests cover legitimate WordPress development queries, injection attacks, obfuscated attempts
- Improve builder loading indicators with text-based progress (building/planning)
- Replace spinning animations with 'Starting build/planning process' messages
2026-02-08 13:23:59 +00:00
Liam Hetherington
6e0d039d7c Merge pull request #9 from southseact-3d/cto-task-ok-so-for-chutes-ai-you-need-to-make-it-a-provider-in-the-ad-e01
Add Chutes AI as a proper provider in admin limits section
2026-02-08 11:42:48 +00:00
cto-new[bot]
33e32b62b3 Add Chutes AI as a proper provider in admin limits section 2026-02-08 10:13:35 +00:00
Liam Hetherington
8197b07a1d Merge pull request #8 from southseact-3d/cto-task-ok-so-for-this-the-only-models-that-show-up-are-the-opencode
Add automatic model discovery from configured external providers
2026-02-08 10:08:55 +00:00
cto-new[bot]
078ff433da Add automatic model discovery from configured external providers 2026-02-08 10:03:29 +00:00
Liam Hetherington
f5e4d273da Merge pull request #7 from southseact-3d/cto-task-ok-so-for-this-can-you-remove-the-stuff-from-port-4501-and-u
Remove port 4501 and update health check to not require ttyd service
2026-02-08 09:58:43 +00:00
cto-new[bot]
ce8a0cdf15 Remove port 4501 and update health check to not require ttyd service 2026-02-08 09:57:38 +00:00
Liam Hetherington
9889a6e4fd Merge pull request #5 from southseact-3d/cto-task-ok-so-for-this-app-can-you-change-how-the-prompt-works-by-mo
Refactor WordPress prompt system and add completion signal
2026-02-08 09:45:24 +00:00