* 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
* fix(backend): normalize git credential extraheaders
* fix(frontend): remove permission immediately after responding
Call removePermission synchronously after a successful API response,
matching the existing pattern used by replyToQuestion and rejectQuestion.
This ensures the UI updates promptly even if the SSE permission.replied
event is delayed or missed.
---------
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 <>
Replace direct opencodeServerManager calls with a supervisor that
provides health polling, operation locking, and a 4-step recovery
pipeline (restart, debug capture, rollback, seed default config).
Add archiveBrokenConfig to SettingsService for backup before rollback.
Wire supervisor into all route factories with graceful fallback to
direct manager calls. Add health watch configuration defaults and
env vars.
* feat: add assistant mode integration and fix test environment
- Add assistant-mode service for managing assistant workspace files (AGENTS.md, opencode.json)
- Add backend GET/POST routes for assistant-mode status and initialization
- Add AssistantRedirect page and useAssistantSessionLauncher hook
- Update mobile navigation to include Assistant tab (replaces Alerts)
- Fix React.act compatibility by setting NODE_ENV=test in vitest config
- Add shared Zod schemas for AssistantMode types and requests
* feat: enhance assistant mode with session list view and legacy config migration
- Add session list view for assistant mode with full workspace management
- Migrate legacy opencode.json permission format to granular permissions
- Enable assistant navigation from mobile tab bar and repo switcher
- Preserve assistant context in session routes via query params
- Auto-restart OpenCode server after assistant mode initialization
- Add comprehensive tests for legacy config detection and navigation
- Add baseBranch parameter to cloneRepo and createWorktreeSafely
- Create CreateWorktreeDialog component for dedicated worktree creation
- Add Create Worktree action to RepoRowActions and RepoDetail page
- Update BranchesTab to use CreateWorktreeDialog
- Allow specifying base branch when creating worktrees
- Add plugin detection to determine if server restart is required when config changes
- Extend health check timeout to 120s when plugins are configured (from 30s)
- Implement retry-once logic for plugin installations that may cause initial startup failure
- Check agent, plugin, skills, and provider fields for restart decisions (previously only agents)
- Improve frontend toast messages to distinguish between restart and apply scenarios
- Set XDG_CACHE_HOME in Dockerfile for proper cache directory management
- Extract getFileApiUrl helper with options interface for type-safe URL building
- Handle paths containing '.' and '..' segments via query parameters
- Remove duplicate URL construction logic from FileBrowser, FilePreview, and FileTree components
- Add getSpecialRoutePathFromRequest helper in backend for consistent path extraction
- Add query parameter support for file paths to handle special characters
- Enable navigation above base path with proper validation
- Centralize URL encoding logic for file API calls
- Update path validation to use workspace base instead of repos base
- Add normalizePath utility for consistent path handling
* chore: bump version to 0.9.16
* Remove custom session title generation and rely on upstream OpenCode titles
- Delete backend/src/routes/title.ts and backend/src/services/session-title.ts
- Remove /api/generate-title route from backend/src/index.ts
- Delete backend/test/routes/title.test.ts
- Remove useTitleGenerating hook and title generation logic from frontend/src/hooks/useOpenCode.ts
- Remove generating prop from Header.EditableTitle and frontend/src/pages/SessionDetail.tsx
- Clean up unused imports in frontend/src/hooks/useOpenCode.ts and frontend/src/components/ui/header.tsx
- Session titles now come directly from upstream OpenCode via session refetches after prompt
* refactor: optimize session query updates with setQueryData
- Remove redundant query invalidations in useSendPrompt
- Use setQueryData for optimistic updates in SSE session.updated handler
- Update session cache directly when session exists in list
- Prepend new sessions to list when not found
- Fall back to invalidation only when cache is empty
- Change reloadConfig to read from opencode.json file instead of HTTP API
- Add logging for OpenCode PATCH responses to aid debugging
- Make providerId optional in schema with custom validation when needed
- Update test to mock fs.readFile instead of fetch
- Trigger reloadConfig() after API key save/delete in providers route so the
OpenCode server immediately recognizes newly connected providers
- Wrap reloadConfig() in try/catch in both providers.ts and oauth.ts so
credential operations succeed even if the reload fails transiently
- Add invalidateProviderCaches() utility covering all provider-related query
keys, replacing scattered manual invalidation across ProviderSettings
- Remove duplicate provider key invalidation from invalidateConfigCaches()
by delegating to invalidateProviderCaches()
- Remove unused invalidateAllConfigRelatedCaches() export
Fixes#180
* Fix Ralph state type safety and null handling in status commands
* Refactor Ralph to use worktree-keyed session mapping instead of sessionId lookups
* Add configurable KV TTL with 7-day default and update agent prompts
* Add --limit flag to CLI status and improve null safety for RalphState fields
* Bump memory package version to 0.0.25
* ralph: ralph-repo-level-skills-dialog-skillseditor-fix completed after 4 iterations
* Remove parent session notification and child session tracking from Ralph loops
Sending promptAsync to parent sessions on loop completion could resume
work in previously inactive sessions. Removed parentSessionId from
RalphState, child session tracking maps, and all related event handling.
Watchdog stall detection still works via the session status API.
* Migrate global skills to workspace path
* Add skill injection to scheduled job prompts
* Refactor schedules UI with MultiSelect and tab menu
* Update skills UI components for managed skills
* feat: discover local repos and reconnect OpenCode sessions
Replace one-by-one local repo setup with parent-folder discovery and path-aware repo linking so first-time installs can recover existing OpenCode chats. Add first-run import support and onboarding docs for standalone OpenCode users, including Docker path-matching guidance.
* fix: address session discovery review feedback
* fix: improve delete/unlink messaging for local vs cloned repos
* feat: discover local repos and reconnect OpenCode sessions (#158)
---------
Co-authored-by: itz4blitz <justinscroggins@outlook.com>
Co-authored-by: itz4blitz <60281870+itz4blitz@users.noreply.github.com>
* fix(lsp): Fixes pyright LSP initialization timeout
* test(lsp): Add unit tests for bin directory initialization
- Add reinitializeBinDirectory() public method for testing
- Add 7 comprehensive test cases
- Cover success scenarios, error handling, and edge cases
- Achieve 100% code and branch coverage
* Refactor OpenCode server for testability and fix bin directory tests
* Standardize test ENV mocks and modernize imports
---------
Co-authored-by: Niu Shuai <guisu2010@gmail.com>
* fix(lsp): Fixes pyright LSP initialization timeout
* test(lsp): Add unit tests for bin directory initialization
- Add reinitializeBinDirectory() public method for testing
- Add 7 comprehensive test cases
- Cover success scenarios, error handling, and edge cases
- Achieve 100% code and branch coverage
* Refactor OpenCode server for testability and fix bin directory tests
---------
Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>