When redoing a 'proceed with build' message, the system now uses the
currently selected model from the dropdown instead of the original
message's model. This allows users to switch models before redoing.
When session.opencodeSessionId is null (indicating the session was reset
due to corruption or undo failure), ignore any opencodeSessionId sent
in the request body. This prevents the client from reusing a corrupted
session that was previously reset on the server.
When opencode undo command fails:
1. Reset the opencode session (both IDs set to null)
2. Still remove the message from history
3. Return success instead of error
This prevents corrupted sessions from blocking subsequent operations.
When a message fails with zero output and error status, undoing it now
resets the opencode session to ensure the next message starts fresh.
This prevents corrupted session reuse that was causing subsequent failures.
Prevents error when undoing messages that produced no output.
Checks for reply, partialOutput, or done status before sending
/undo command to opencode.
- Add CORS headers to backend server to allow mobile app requests
- Implement request timeout (10s) in capacitor-bridge.js to prevent hanging
- Add comprehensive logging throughout authentication flow
- Add detailed error reporting in initApp for better debugging
- Log all API requests with request IDs for traceability
This fixes the 'Loading Plugin Compass...' infinite loop issue caused by
missing CORS headers and unhandled network timeouts.
When clicking redo on a message, the system would fail with 'Command exited with code 1'
if there were previous opencode messages but none of them produced any output. Now we
check if previous messages actually had output (reply or partialOutput) before
attempting to undo, preventing the error when there's nothing to undo.
Fixes issue where redo button fails when previous messages had no output.
- Update BACKEND_BASE_URL to plugincompass.com:9445
- Add comprehensive authentication system (login, signup, logout)
- Implement JWT token management with automatic refresh
- Add plugin/app management API (CRUD operations)
- Add session management for chat/builder
- Update mobile UI with real backend integration
- Add user account and usage tracking
- Enable plugin loading and editing from backend
- Fix module type for ES6 support
When clicking redo on the first build message, the system would fail with
'Command exited with code 1' because there was nothing to undo. Now we
detect if this is the first opencode message and skip the undo step,
proceeding directly to rebuilding.
Fixes issue where redo button fails on first message in builder.
- Added Plugin.png as app icon in windows-app/assets/
- Updated NSIS config with runAfterFinish to launch app after install
- Added installer.nsh for proper Windows registry entries
- Fixed icon paths to use PNG format
- App now properly registers in Windows Installed Apps
The debug logging added in commit dacde39 tried to access 'env' variable
before it was initialized at line 946. Changed to use process.env which
is always available.
- Added builder stage with all build dependencies
- Isolated build process to prevent failures in final stage
- Retry mechanism for bun install
- Copy only built binary to final image
- 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
- 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
Chutes AI counts each HTTP API request separately. The existing fix using
stepCountIs(1) only limited the Vercel AI SDK's internal loop, but the
outer while(true) loops in processor.ts and prompt.ts continued to make
additional HTTP requests after tool execution.
This fix:
- Returns singleStepTools flag from LLM.stream() to signal single-step mode
- Breaks out of processor.ts inner loop after one iteration for Chutes
- Breaks out of prompt.ts outer loop after one iteration for Chutes
This ensures only one HTTP request is made per user message for providers
like Chutes that bill per request.
- 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
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.
- 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
- 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
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.
Process detection fails in containers due to missing privileged tools
(ss -p requires root, lsof often not installed). HTTP health endpoint
is the reliable indicator of service health, so port/process checks
are now informational only.
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
- 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