Commit Graph

39 Commits

Author SHA1 Message Date
southseact-3d
5d91c86f90 Add Cohere as a provider for build messages in admin panel
- Add 'cohere' to DEFAULT_PROVIDERS and PLANNING_PROVIDERS arrays in admin.js
- Add Cohere option to provider limits dropdown in admin.html
- Add 'cohere' to DEFAULT_PROVIDER_SEEDS, PLANNING_PROVIDERS, and KNOWN_USAGE_PROVIDERS in server.js

Cohere was already integrated in the opencode backend (SDK installed, provider registered, icons defined). These changes make it available in the admin panel for build message configuration.
2026-02-11 13:25:16 +00:00
southseact-3d
71c1677932 chore: remove excessive debug logging from ensureOpencodeConfig 2026-02-11 12:03:16 +00:00
southseact-3d
d2640eee5d fix: extract provider from model name (e.g., chutes/model-name)
- Parse model names like 'chutes/deepseek-ai/DeepSeek-V3.2-TEE'
- Extract provider prefix before '/' to detect chutes, cerebras, etc.
- This fixes provider detection when admin panel sets wrong provider
2026-02-11 11:49:43 +00:00
southseact-3d
f1fb336f4d debug: log all models and filter for chutes models 2026-02-11 11:44:48 +00:00
southseact-3d
b85cc73a4d fix: handle both string and object formats in providers array
- Support providers as array of strings: [opencode, chutes]
- Support providers as array of objects: [{provider: opencode}]
- This fixes provider detection for Chutes and other providers
2026-02-11 11:41:22 +00:00
southseact-3d
bddc710a90 debug: add detailed logging for adminModels and provider detection
- Log adminModels count and sample data
- Log CHUTES_API_KEY status and prefix
- Log detected providers from adminModels
2026-02-11 11:37:06 +00:00
southseact-3d
3ec9177082 fix: load adminModels before sessions in bootstrap sequence
- Move loadAdminModelStore() before loadState() in bootstrap()
- This ensures adminModels is available when ensureOpencodeConfig is called
- Fixes issue where Chutes provider was not being configured
2026-02-11 11:27:43 +00:00
southseact-3d
18d9e18978 debug: add detailed logging for Chutes API calls
- Log API key prefix to verify key is loaded
- Log full error response from Chutes API
- Log success count when models are fetched
2026-02-11 11:20:04 +00:00
southseact-3d
49092c3229 fix: ensure adminModels is loaded before checking providers in ensureOpencodeConfig
- Add check to load adminModels if not already loaded
- Add error handling for models.dev fetch failures
- Log provider source (models.dev vs built-in) for debugging
2026-02-11 11:18:56 +00:00
southseact-3d
17792d39a0 feat: dynamic provider model loading from models.dev
- Add fetchModelsDevProviderModels() function with 1-hour caching
- Update ensureOpencodeConfig() to dynamically load all models for configured providers
- Support Chutes, Cerebras, Groq, Google, and Nvidia providers
- Only fetch models for providers actually used in adminModels
- Cache models.dev data to reduce API calls and improve performance

This allows any model from models.dev to work when added in the admin panel,
instead of requiring hardcoded model definitions.
2026-02-11 10:53:37 +00:00
southseact-3d
d0105ff967 fix: add DeepSeek V3.2 TEE model to Chutes provider config with baseURL 2026-02-11 10:44:48 +00:00
southseact-3d
1ce02060e8 fix: pass provider API keys (CHUTES, GROQ, GOOGLE, NVIDIA) to OpenCode CLI execution environment 2026-02-11 09:04:15 +00:00
southseact-3d
566442327a Fix: Add Chutes and Cerebras provider config to opencode.json
When models from providers like Chutes or Cerebras were added via the admin panel,
they didn't work in the builder page because the opencode.json config file only
included the Ollama provider configuration.

This fix adds Chutes and Cerebras provider configurations to the opencode.json
file when their respective API keys are available in environment variables
(CHUTES_API_KEY and CEREBRAS_API_KEY).

Fixes the issue where chutes/deepseek-ai/DeepSeek-V3.2-TEE and similar models
would fail to load from the builder page.
2026-02-10 19:51:39 +00:00
southseact-3d
8b96273f47 builder: skip OpenCode verification when OPENCODE_REQUIRE_REPO=false 2026-02-10 19:09:22 +00:00
southseact-3d
bc45e3f964 builder: adapt OpenCode integration for Docker deployment; disable repo verification, remove JSON flag usage, parse text models, fix redo flow and session listing 2026-02-10 18:58:14 +00:00
southseact-3d
1af1f7b266 try again 2026-02-10 18:43:41 +00:00
southseact-3d
f1d3dce73c fix opencode error 2026-02-10 18:32:41 +00:00
southseact-3d
25d23d8dd1 Add comprehensive feature request admin functionality
- Update data model to include status, adminReply, and updatedAt fields
- Hide user emails from public API responses for privacy
- Add admin-only endpoints: list, reply, update status, delete
- Create admin-feature-requests.html with full management UI
- Add status badges and admin replies to public feature requests page
- Add Feature Requests link to all admin page sidebars

Admin capabilities:
- View all feature requests with author emails (admin only)
- Reply to feature requests with admin responses visible to public
- Update status: pending, planned, in-progress, completed, declined
- Delete feature requests
- Filter and sort by status, votes, date
2026-02-10 13:27:36 +00:00
southseact-3d
cfd8d9c706 feat: implement comprehensive blog system
Add dual-source blog system with Editor.js integration:
- Blog storage supporting repo-based (JSON) and database sources
- Admin panel with rich text editor using Editor.js
- Public news page with infinite scroll
- Individual blog post viewer page
- Categories management in admin
- Image upload functionality
- 4 SEO blog posts about WordPress with PluginCompass promotion
- 3 News blog posts about Plugin Compass
- API endpoints for CRUD operations
- Security and validation for admin operations

Closes blog feature request
2026-02-10 13:23:37 +00:00
southseact-3d
8e9f2dec8e added support for todos 2026-02-10 11:53:31 +00:00
OpenCode Dev
cc40085441 feat: implement undo button to revert file changes and remove message from history
- Modified handleUndoMessage in server.js to remove the undone message from session history
- Added persistState() call to save the updated session state after undo
- Message is now removed from UI when undo is completed
- Works for opencode/build messages that are completed, errored, or cancelled
2026-02-10 10:59:36 +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
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
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
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
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
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
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
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
cto-new[bot]
33e32b62b3 Add Chutes AI as a proper provider in admin limits section 2026-02-08 10:13:35 +00:00
cto-new[bot]
078ff433da Add automatic model discovery from configured external providers 2026-02-08 10:03:29 +00:00
cto-new[bot]
23d4c8d0e6 Refactor WordPress prompt system and add completion signal 2026-02-07 22:12:43 +00:00
southseact-3d
ed67b7741b Restore to commit 74e578279624c6045ca440a3459ebfa1f8d54191 2026-02-07 20:32:41 +00:00