* feat: add persistent model state storage with database backend
- Create opencode_model_state table for storing user model preferences
- Implement database-backed model state management (recent, favorite, variant)
- Add atomic JSON file utilities with file locking for concurrent safety
- Migrate providers routes from file-based to database storage
- Add backfill migration to preserve existing model.json data
- Include comprehensive tests for model-state and atomic-json modules
- Refactor useSessionAgent hook to simplify agent/model resolution logic
- Update getFileApiUrl to use consistent query parameter approach
* fix: include workspace dependencies in Docker image
* fix: overlay workspace node_modules after source to prevent layer overwrite
* fix: ensure model state table exists for existing databases
* feat: add model state persistence and improve model selection sync
- Add setActiveModel to modelStore and useModelSelection for direct model updates
- Sync session agent model/variant to store when messages load
- Include model, agent, and variant in optimistic user messages
- Fix useSessionAgent to check isFetching during message loading
- Update env.ts to use getter for BASE_PATH for dynamic resolution
- Fix test environment variable from OPENCODE_WORKSPACE_PATH to WORKSPACE_PATH
* refactor(frontend): extract VoiceStatusOverlay component and improve swipe tracking
- Extract voice status overlay to dedicated VoiceStatusOverlay.tsx component
- Move pointer event handlers from button to container for larger swipe surface area
- Users can now initiate swipe gesture from anywhere in the container, not just the button
* refactor(frontend): add SSE delta support and improve status synchronization
- Add SSEMessagePartDeltaEvent type for streaming delta updates
- Add SSESessionCreatedEvent type for session creation events
- Implement directory filtering for SSE events to prevent cross-contamination
- Add version tracking for status snapshots to ignore stale responses
- Replace individual status updates with atomic replaceStatuses operation
- Refactor parts batcher to use unified operation queue with delta support
- Clear stale statuses on initial snapshot and directory changes
- Add tests for status snapshot clearing and stale response handling
* refactor: remove auto-restart from assistant mode and fix mobile sheet close behavior
Stop restarting OpenCode after assistant mode initialization since the
startup error logic is no longer needed. Also fix the repo quick switch
sheet to stay open when launched from the mobile tab bar, preventing
unwanted navigation away from the sheet.
* refactor(frontend): improve speech-to-text UI
* feat: improve mobile session actions
* feat(frontend): improve mobile session actions
Replace inline file search in MoreDrawer with FileBrowserSheet for
mention-file interactions. Add activePromptFileBasePath state to track
workspace context, normalize file paths on selection, and improve
command sorting with relevance ranking (exact > prefix > partial match).
* refactor(frontend): remove dead state and deduplicate event reconciliation
Remove unused activePromptDirectory from uiStateStore and its writers in
SessionDetail and PromptInput. Consolidate duplicated permission and
question reconciliation helpers in EventContext behind a generic
session-scoped helper.
---------
Co-authored-by: Chris Scott <>
* refactor(prompt): improve mobile speech-to-text feedback
Consolidate the voice button rendering and add a clearer mobile swipe-up affordance for auto-send while fixing hold activation state.
* refactor(prompt): improve mobile speech-to-text feedback
---------
Co-authored-by: Chris Scott <>
* fix: sync model selection with OpenCode state
* feat(model): add favorites system for model selection
- Add toggleFavoriteModel API endpoint
- Add favorite toggle UI in ModelQuickSelect and ModelSelectDialog
- Show provider name prefix when model display names are ambiguous
- Fix directory scoping for getProviders API calls
feat(assistant): send welcome message on new session creation
- Send setup guidance message when creating new assistant session
---------
Co-authored-by: Chris Scott <>
* loop: simple-chat-mode completed after 1 iterations
* feat(frontend): add simple chat mode for user messages and clean up redundant optimistic filtering
* refactor(frontend): consolidate status indicators and simplify simple chat mode
- Merge MiniScanner and CompactStatusIndicator into SessionStatusIndicator with size and showLabel props
- Hide step-finish cost/token display in simpleChatMode
- Update SessionCard and PromptInput to use unified SessionStatusIndicator
- Add tests for step-finish rendering in simpleChatMode
- Replace ChevronDown with ArrowDown icon for scroll button
- Adjust scroll threshold to 150px for better UX
- Add prompt overlay height tracking for proper message container padding
- Include compact status in active session check
* fix: prevent delete button click when card is not swiped open
* refactor: improve CreateRepoInput type safety
* security: require AUTH_SECRET and use secure random generation
* fix: SSH key path validation, async passphrase stripping, and port handling
* fix: use correct console methods for logger levels
* Add error handling to DB update functions and improve migration logging
* Add error handling for session lookup in auth middleware
* Add structured git error handling with user-friendly messages
- Parse git errors with specific error codes (AUTH_FAILED, REPO_NOT_FOUND,
PUSH_REJECTED, MERGE_CONFLICT, etc.) and appropriate HTTP status codes
- Return structured error responses with summary and detail from backend
- Add GitErrorBanner component for better error display in UI
- Add optional onError callback to useGit hook for external error handling
* Make IPC server initialization/disposal async and fix SSH host key handler
* add try-catch error handling in frontend lib utilities
* remove unresolved promise handlers in speech synthesizer callbacks
* Extract error types to shared package
* Import GitErrorCode from shared package
* Refactor API layer to use shared FetchError and fetchWrapper
* Update prompt parser and source control components
* Extract MCP server list to separate component with improved badge menu UX
* merge useSettingsDialogUrl into useSettingsDialog and extract getRepoDisplayName utility
* add separate loading state for passkey sign in
* refactor hooks: use fetchWrapper, improve error handling, add proper types
* replace browser confirm() with DeleteDialog component in settings
* fix: add missing variables parameter in React Query onError callbacks
* Refactor message parts to use separate Zustand store
* Update QuestionPrompt styling for light/dark mode
* Add OAuth authentication support for MCP servers
* Improve mobile text sizing with responsive text classes
* refactor: improve virtualized text viewer with React Query infinite scroll and simplified buffering
* Add push notifications with VAPID and PWA support
* feat: add VAPID environment variables for push notifications
* Replace SquareFill with MicOff icon for stop recording buttons
* Send push notifications when app is not focused
* Fix stop generation button icons to use X instead of MicOff
* feat: enhance push notification logging and debugging
- Add structured logging throughout push notification flow
- Improve error handling with detailed diagnostics
- Add /api/notifications/debug endpoint for troubleshooting
- Enhanced test notification response with per-subscription results
- Add service worker logging and better install/activate handling
* Improve VAPID push notification configuration with validation and better defaults
- Add validation warnings for VAPID_SUBJECT format (requires mailto: prefix for iOS/Safari)
- Expose VAPID details via notifications API endpoint
- Update default VAPID_SUBJECT from mailto:admin@opencode.local to empty string
- Enhance VAPID logging with key lengths and subject info
- Improve documentation in .env.example with setup instructions
* Fix notification URL to use repo ID instead of filesystem path
* Clean up push notification logging and debug endpoints
* Add push notifications documentation
* Add SSE reconnection before critical actions and handle Cloudflare 524 errors
* refactor: improve responsive layout in QuestionPrompt component
* fix: proper cache updates for OpenCode version on install/upgrade
* fix: markdown files now default to rendered view and render properly
- Add .md and .mdx MIME type support in backend (files.ts, defaults.ts)
- Add key props to FilePreview components to force proper remounting when switching files
- Fix markdown file detection with case-insensitive extension check
- Reset markdownPreview state when file changes to ensure correct default view
- Add onContentLoaded callback to VirtualizedTextView for reactive content updates
- Add fullContent state to properly handle large markdown file rendering
- Add error handling for async content loading to prevent blank screens
- Reduce loading timeout from 50ms to 0ms for more responsive loading
Fixes issues where:
- Markdown files opened in raw view instead of rendered view
- Large markdown files (12k+ lines) showed blank after loading completed
- State persisted incorrectly when switching between different file types
* Add directory download feature with ZIP archive support
* Improve voice recording UX with loading states and better transcript handling
* Fix auth config for prod/dev ports and add documentation
Update AUTH_TRUSTED_ORIGINS and PASSKEY_ORIGIN to use backend port 5003 (frontend uses 5173 in dev). Add comprehensive auth documentation covering secrets, trusted origins, admin reset, and passkeys. Update README and add mkdocs config.
* Remove roadmap section from README
* fix session last active
* Feature/sst (#81)
* Use CSS field-sizing for textarea auto-height and abort STT recording on clear
* Fix invalid date display in git commits
* Use Unix timestamps for git log dates
Changes:
- Bump version to 0.7.3
- Set package.private to false
- Add useSessionAgent hook for per-session agent mode
- Remove global mode preference, use session-level mode
- Add mobile drag-and-drop toggle for repo list
- Improve repo card UI with truncation and compact status
- Fix TypeScript errors in repo.ts (undefined handling)
* Fix mobile image upload and paste with improved file type handling
* Replace older sessions header with separator line
* Add ESLint no-console rules and fix lint errors
- Add eslint configuration for backend with no-console rule
- Add reusable error type guard utility
- Replace all error: any with error: unknown and type guards across backend
- Update logger to use console.warn/console.error only
- Remove unused variables and dead code functions
- Fix regex escape characters
- Update AGENTS.md with lint commands and requirements
* Fix permission response by including directory parameter
Extract directory from query key in useActiveRepos hook and pass it
to OpenCodeClient when responding to permissions. Use composite keys
for client and SSE connection tracking to support multiple repos with
the same URL but different directories.
* Keep permission dialog open on response failure and show error toast
* Fix permission request proxying to preserve query parameters
The backend proxy was incorrectly handling URL query parameters when stripping the /api/opencode prefix. This caused the directory parameter to not be passed correctly to the OpenCode server, breaking the permission request/response flow.
Changes:
- Separate pathname and search parameters explicitly
- Only strip /api/opencode from pathname, preserve search params
- Add logging for permission requests to aid debugging
- Update error logging to use correct variables
This fix ensures that permission responses are properly forwarded to the OpenCode server with all necessary query parameters, allowing the session to proceed correctly when users grant permissions.
* Fix permission client lookup when only individual sessions are loaded
The PermissionContext failed to find a client when responding to permissions because it only scanned the sessions list query, but SessionDetail and other pages only load individual sessions via useSession.
Changes:
- Update useActiveRepos to also scan individual session queries
- Match query keys like ['opencode', 'session', url, sessionId, directory]
- Extract session ID from individual session query data
- Build active repos map from both sessions list and individual session queries
This ensures permission dialogs can find the appropriate client to send responses, even when viewing a single session without loading the full sessions list.
* Fix permission client lookup with fallback to query cache
The activeRepos state was often empty when permission dialogs appeared due to timing issues with the React Query cache subscription. This caused No client found for session errors.
Changes:
- Add fallback scan of query cache directly in getClient when activeRepos is empty
- Remove excessive debug logging that was spamming console
- Add minimal log only when fallback is actually used
- Fix query key length checks to be more robust
This ensures permission responses work correctly even if the useActiveRepos hook hasn't yet populated the state, by falling back to scanning the query cache directly to find the session and creating the appropriate OpenCodeClient.
* Add directory-based permission requests with global notification and message auto-refresh
---------
Co-authored-by: OpenCode Agent <agent@opencode.ai>
Co-authored-by: Chris Scott <chris@cstech.dev>
* Add message undo/refresh features and stop audio floating button
* Exclude workspace directory from pnpm workspace detection
---------
Co-authored-by: Chris Scott <chris@cstech.dev>
- Use setQueryData for immediate branch switch UI updates
- Replace model selector with SessionStatusIndicator during active streams
- Remove async model name fetching in favor of existing modelString