Commit Graph

101 Commits

Author SHA1 Message Date
southseact-3d
49983fbc3c Build OpenCode from source in Docker and remove broken session token queries
- Dockerfile: Build OpenCode CLI from source during Docker build instead of downloading from GitHub releases
- Disabled GitHub Actions workflow that was failing to create releases
- Removed getOpencodeSessionTokenUsage function that tried non-existent CLI commands (session info/usage/show)
- Token tracking now relies on 3 layers: result extraction, streaming capture, and estimation
2026-02-16 16:38:22 +00:00
southseact-3d
c2e5980a8b added scroll to bottom template 2026-02-16 13:42:05 +00:00
Developer
14f59c2f56 Fix builder plan message display and error handling
- Strip double stars (**) and double hashtags (##) from plan message displayContent in both client and server
- Fix server restart error replacing plan message by skipping error state for plan messages
- Fix rate limiting regex pattern to use proper global flag
2026-02-16 08:40:58 +00:00
southseact-3d
dafd3c796d Add admin token override feature for user accounts
- Add tokenOverride field to token usage bucket
- Create POST /api/admin/accounts/tokens endpoint for setting manual token limits
- Update admin accounts page to display token usage and override status
- Add 'Set Tokens' button to manually override user token limits for the month
- Override takes precedence over plan-based limits when set
2026-02-15 16:19:06 +00:00
southseact-3d
9973c3511c fix: remove message status chip for plan messages
Hide the status indicator (queued, running, done, etc.) from user messages
in the builder UI when the message is a plan message (OpenRouter/non-OpenCode
messages). Regular build messages still show their status as before.
2026-02-15 13:58:50 +00:00
Developer
04780632e8 fix: show undo/redo buttons when server restart error occurs 2026-02-15 12:50:56 +00:00
Developer
6bcdb2b739 Migrate test checkout page to inline Dodo Payments checkout with theme customization
- Replace modal-based checkout with true inline checkout embedded in page layout
- Implement split layout: payment form on left, package selection + order summary on right
- Add real-time order summary sync via checkout.breakdown events
- Apply comprehensive theme customization matching app design (Shopify green, proper colors)
- Add loading states and empty state for better UX
- Use ES modules with proper DodoPayments SDK import
2026-02-15 10:58:15 +00:00
Developer
cea30dc84c Fix admin test checkout email validation - ensure valid email format is sent to Dodo Payments 2026-02-14 21:36:55 +00:00
Developer
a6a5d8f7a0 Fix ReferenceError: handleAdminTopupOptions is not defined
- Added missing closing brace for handleTopupConfirm function
- Removed extra closing brace after handleAdminMe function
- Admin functions (handleAdminTopupOptions, handleAdminTopupCheckout, handleAdminTopupConfirm) were incorrectly nested inside handleTopupConfirm scope, making them inaccessible to the router
2026-02-14 20:38:22 +00:00
Developer
4fa0a1b737 Fix ReferenceError: handleAdminTopupOptions is not defined by removing unnecessary await 2026-02-13 19:43:11 +00:00
Developer
180990bea5 fix: standardize contact email to info@plugincompass.com and add await to topup handlers 2026-02-13 15:02:31 +00:00
southseact-3d
af30843f05 fix: add missing Map declarations (loginAttempts, adminLoginAttempts, apiRateLimit, csrfTokens)
Fixed ReferenceError: apiRateLimit is not defined that was causing
internal server errors on all pages. Added 4 missing Map variable
declarations that are used throughout the codebase for rate limiting
and CSRF protection.
2026-02-13 11:13:07 +00:00
southseact-3d
098e971151 Fix syntax error: remove orphan object definition after sendEmail function 2026-02-13 09:18:11 +00:00
southseact-3d
df3a8cdf43 mailpilot sending 2026-02-12 19:35:55 +00:00
southseact-3d
6c09b70317 fix: improve plan change UX with card charge confirmation and fix paid-to-free downgrade 2026-02-12 19:06:17 +00:00
southseact-3d
16f620cccb added internal mcp for the wp verify scripts 2026-02-12 17:01:18 +00:00
southseact-3d
49747d08db fix: prevent duplicate Dodo customers and handle multiple subscriptions per email
Comprehensive fixes to prevent customer ID mismatches:

1. **Checkout creation now passes customer_id** (lines 13669, 13064, 13503):
   - All checkouts (subscription, topup, PAYG) now call ensureDodoCustomer() first
   - Pass existing customer_id to checkout body to prevent Dodo from creating duplicates
   - Added customerId to metadata for tracking

2. **Subscription confirmation validates customer consistency** (line 13843):
   - Logs warning when checkout returns different customer_id than stored
   - Tracks which customer_id was used in checkout metadata
   - Prevents silent customer ID overwrites

3. **ensureDodoCustomer handles multiple customers per email** (line 6774):
   - Logs warning when multiple customers found for same email
   - Checks ALL customers for active subscriptions
   - Selects customer with active subscriptions if multiple exist
   - Returns first customer only if no active subscriptions found

4. **Added missing return statements** (lines 12417, 12448):
   - Prevents double response errors after successful plan changes

This ensures that:
- New subscriptions use existing customers instead of creating duplicates
- Plan changes work correctly even with multiple subscriptions
- Customer ID mismatches are detected and logged
- The correct customer (one with active subscriptions) is always used
2026-02-12 12:06:49 +00:00
southseact-3d
d61fa3d621 fix: add return statements after successful plan changes to prevent double response
- Added return statement after successful paid-to-free cancellation (line 12417)
- Added return statement after successful paid-to-paid plan change (line 12448)
- Prevents 'Cannot write headers after they are sent' error
- Each plan change now returns immediately with the updated account data
2026-02-12 11:58:35 +00:00
southseact-3d
1e30e07ed5 fix: remove hardcoded subscription ID and rely on API queries
- Removed hardcoded subscription ID from code
- Rely on API queries to find subscriptions by customer or through fallback search
- Added proper logging to diagnose customer/subscription mismatches
2026-02-12 11:51:51 +00:00
southseact-3d
8e937a6ff4 debug: try fetching subscription directly by ID to check customer mismatch
- Add direct API call to fetch subscription sub_0NYKZRvba3g5KJfp8R5jp
- Log customer ID comparison to detect mismatches
- Update user record if subscription belongs to different customer
- This will help identify if duplicate customers exist in Dodo
2026-02-12 11:50:14 +00:00
southseact-3d
2268a0e649 debug: log full API response to diagnose empty subscription results 2026-02-12 11:48:58 +00:00
southseact-3d
001993d0bc fix: query all subscriptions without status filter for customers with multiple subs
- Query ALL subscriptions for customer without status filter first
- This handles customers with multiple subscriptions across different statuses
- Returns first active subscription found, or most recent if none active
- Added detailed logging to show all subscription IDs and statuses found
- Fallback to check individual statuses including cancelled/expired
2026-02-12 11:45:53 +00:00
southseact-3d
2a603549f4 debug: add detailed logging for customer and subscription lookup
Add comprehensive DEBUG logs to trace through:
- Customer lookup by email (request and response details)
- Subscription lookup by customer ID (for each status)
- Entry point when plan change is initiated

This will help identify exactly where the lookup is failing.
2026-02-12 11:36:52 +00:00
southseact-3d
d82dcfd5e4 fix: improve customer lookup to prevent duplicate customers in Dodo
- Modified ensureDodoCustomer() to query existing customers by email before creating new ones
- This prevents duplicate customer records when dodoCustomerId is missing from database
- Added logging for both found existing customers and new customer creation
- Updated subscription lookup to check multiple statuses (active, pending, on_hold)
- Should resolve paid-to-paid and paid-to-free plan change issues for users missing subscription IDs
2026-02-12 11:30:52 +00:00
southseact-3d
ae871df0a0 fix: resolve subscription ID lookup and checkout URL issues
- Fix getBaseUrl() ReferenceError by changing to resolveBaseUrl(req) for free-to-paid upgrades
- Add subscription lookup by customer email when dodoSubscriptionId is missing
- Log critical issues when paid users have no subscription ID in database or Dodo
- Return clear error message to contact support when subscription cannot be found
- Prevent silent failures in plan changes from settings page
2026-02-12 11:09:45 +00:00
southseact-3d
c762470fa9 Align topup.html fonts with home.html: remove Space Grotesk, use Inter only 2026-02-12 10:49:09 +00:00
southseact-3d
e2abb2ee98 fix 2 2026-02-11 20:16:01 +00:00
southseact-3d
a66c983360 Fix topup page header styling to match settings.html 2026-02-11 20:12:55 +00:00
southseact-3d
7d7388f571 Fix user profile dropdown z-index to appear above messages 2026-02-11 19:31:57 +00:00
southseact-3d
0513000a9e Fix builder page layout: make new chat and history buttons sticky at top on desktop
- Moved sticky positioning from mobile-only to global CSS for .top-left-actions

- Buttons now stay fixed at top above content on all screen sizes

- Includes various other app updates (version management, server improvements)
2026-02-11 19:23:23 +00:00
southseact-3d
e2a2dff301 Fix topup page: resolve JS error, improve styling, remove redundant buttons 2026-02-11 18:27:02 +00:00
southseact-3d
277ee351bf Fix redeclaration of const userChip in feature-requests.html 2026-02-11 18:20:03 +00:00
Liam Hetherington
382a4abcb8 Merge branch 'main' into copilot/implement-secure-database-setup 2026-02-11 15:17:40 +00:00
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
Liam Hetherington
633f005f6c Merge pull request #22 from southseact-3d/codex/show-undo-and-redo-buttons-with-zero-output
Show builder undo/redo controls when message has zero output
2026-02-11 10:26:12 +00:00
Liam Hetherington
6cc4258d75 Show undo/redo controls even when builder output is empty 2026-02-11 09:46:54 +00:00
Liam Hetherington
e6485c6bbf Merge pull request #20 from southseact-3d/dependabot/npm_and_yarn/chat/npm_and_yarn-0d7ef37a24
Bump multer from 1.4.5-lts.2 to 2.0.2 in /chat in the npm_and_yarn group across 1 directory
2026-02-11 09:43:07 +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
dependabot[bot]
c0eae5f3b4 Bump multer in /chat in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the /chat directory: [multer](https://github.com/expressjs/multer).


Updates `multer` from 1.4.5-lts.2 to 2.0.2
- [Release notes](https://github.com/expressjs/multer/releases)
- [Changelog](https://github.com/expressjs/multer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/expressjs/multer/compare/v1.4.5-lts.2...v2.0.2)

---
updated-dependencies:
- dependency-name: multer
  dependency-version: 2.0.2
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 21:23:34 +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