OpenCode returns an empty command list for a location until it has
loaded that location's config, then emits a command.updated event. When
the browser stream or the upstream SSE connection is reconnecting, that
event is missed and nothing reloads the list, leaving the slash menu
stuck on the builtin commands until the OpenCode server is restarted.
Reload commands, agents and skills on both a browser stream reconnect
and an upstream resync, and handle skill.updated so skill changes
refresh like agent and command changes already do.
Resolve effective bindings from stored prefs plus defaults with leader/direct collision handling and default leader Ctrl+X; let direct actions pass through in terminals and suppress abort while an overlay is open. Add half-page scroll disengage, verified overlay focus restore, and consolidate prompt reset.
Align the manager's model selection with the OpenCode TUI: one
model.json-backed preference store, one provider catalog, one ordering
and default-ownership rule, and one set of availability, ref-formatting
and variant helpers shared across chat, schedules, agents and the goal
auditor.
- Add a shared TUI-compatible model-preference module and make the
backend model.json store match its format.
- Consolidate the frontend provider catalog, availability check, model
ref formatter and variant persistence into single owners.
- Drive chat, schedule, agent and goal-auditor model lists from a shared
useModelSections hook and buildModelSections, following TUI ordering.
- Extract a shared ModelCombobox with a taller list, and list models the
TUI way in ModelQuickSelect.
- Add a shared isRecord util and model-selection comparison helpers.
Fuse two to five completed multi-run entries into one synthesized session,
and explain a session's diff as ordered walkthrough stops cached by diff hash.
- Multi-run fusion service, persistence, routes and FuseRunDialog
- Change walkthrough service, persistence, routes and ChangesWalkthroughDialog
- Shared unified-diff parser plus bounded text generation, json-extract,
text-truncate and service-error helpers
- Match command arguments across newlines so a multi-line /btw or custom
command runs instead of being sent as plain text.
- Run a typed command on plain Enter once its name is complete, while
Enter stays a new line for regular text and Shift+Enter for commands.
- Focus the prompt when a session opens on a pointer device, and return
focus to the previously focused element when a dialog closes, except a
text field on touch so the keyboard stays closed.
- Invalidate the session list on session.forked so a forked session shows
in the sidebar without waiting for the next event.
- Correct the Quick Start keyboard shortcuts.
* fix: stabilize scheduled runs and background task tracking
* fix: complete scheduled runs and harden background task status
- Route directory-less OpenCode session events (session.execution.*,
session.usage.updated) to backend listeners by remembering each
session's directory in the SSE aggregator, so scheduled runs finish
and failure push notifications fire; browser delivery is unchanged.
- Resolve background shell status from the transcript completion notice
when OpenCode no longer lists the shell, keep the first terminal
status so a kill is not reported as completed, and share one status
icon and colour mapping between the transcript and background bar.
- Reconcile child sessions only while unknown or running, trigger it
from the EventProvider alone, refresh children that drop to unknown
after a poll, and forget deleted sessions.
- Fetch the model list and default concurrently while waiting for the
schedule model, share configured-model selection, and consolidate
schedule startup cancellation cleanup.
- Reduce background work re-renders, prune shell exit records, remove
dead exports, and document background work in the chat guide.
* fix: hide finished background tasks and clip long dialog titles
- Vendor the 36 OpenCode theme palettes into the shared package, synced
from the pinned OpenCode release tag via pnpm themes:sync.
- Add a colorTheme user preference across the settings schema, defaults,
and the assistant internal API.
- Extend palettes with success, warning, info, and diff colors, and add a
resolver that maps palettes to CSS tokens and applies them to the DOM.
- Apply the theme app-wide through a ThemeProvider context, adopting the
tokens in message, repo, session, and settings components, agent
colors, git status styles, and diff viewers.
- Add a theme picker to General settings and make model quick-select
follow the active theme (fixes#355).
* feat(sidebar): add repo-grouped session navigation with live status
- Add a searchable, collapsible session tree to the desktop sidebar, grouped by repository with pinned and time-bucketed ordering.
- Track per-session busy, retry, and compact status in a shared store fed by the SSE event stream and scoped by directory.
- Extract shared navigation components reused by the desktop tree and the mobile repo quick-switch sheet.
- Show a Git tab and hide Schedules inside a repo on the mobile tab bar; add Repos and Assistant entries to the session More drawer.
- Replace the CommitsTab local relative-time formatter with a shared formatShortRelativeTime util.
* refactor(sidebar): unify session status tracking and navigation helpers
* feat(sidebar): add collapsible sessions and menu sections
* fix(sessions): keep specific live status over snapshot busy
* feat(opencode): migrate OpenCode Manager to OpenCode 2
Port the backend lifecycle, generated plugins, event aggregation,
schedules, worktrees, provider credentials, MCP, config handling, the
frontend chat model, and the ocm CLI to OpenCode 2.
Adopt @opencode/client 2.0.15 as the single typed V2 API contract,
require OpenCode 2.0.0 or newer (pinned 2.0.15), and delete every
V1-only code path.
* refactor(opencode): reload config in place and drop v1 compatibility shims
Route config/skill/AGENTS.md changes through the OpenCode location reload
API instead of a full server restart, stop auto-resuming interrupted
sessions, remove the restart coordinator and v1 MCP/version shims, and pin
support to OpenCode >=2.0.15 <3.0.0. Adds integration-ready retries,
service-mode launch, ocm-cli repo proxy, and new frontend form/MCP helpers.
* refactor(opencode): consolidate v2 migration helpers and harden install, proxy, and session flows
- extract shared semver and model-ref utilities, reuse across version checks
- share the OpenCode release download script across Docker, entrypoint, dev setup
- unify install/upgrade failure recovery and guard externally managed OPENCODE_BIN
- scope the repo proxy location rewrite and surface ocm proxy errors
- rework frontend session projection, permission lookup, and cache invalidation
* fix(schedules): reject unavailable agents before creating a session
* feat(opencode): add ocm install, schedule agent fallback, and session move guards
* feat(sandbox): add KVM-backed agent sandboxing via microsandbox
* feat(sandbox): route host-shell surfaces into microVM via shell wrapper
* feat(sandbox): route host-shell surfaces into microVM via shell wrapper
* fix(sandbox): harden enforcement validation and backup handling
* fix(sandbox): bound lifecycle queue and harden install/backup paths
Bound the OpenCode supervisor lifecycle queue to one running plus one
pending operation so repeated restarts cannot stack unbounded HTTP
requests, while exempting stop() so shutdown is never dropped.
Reject enforcement backups that carry no recoverable removed sections,
matching the existing fail-closed handling of unparseable backups.
Install OpenCode through a private mktemp staging directory instead of
the predictable /tmp/opencode path.
Use named path/os imports in the files added by this branch.
* refactor(sandbox): remove OpenCode version allowlist gating under enforcement
* fix(settings): use resolved opencode binary and verify installed version
* refactor(sandbox): scope enforcement to agent bash tool only
* fix(sandbox): plan bash against factory directory and attest runtime tmpfs; align permission reply API
* fix(sandbox): pin neutral entrypoint and persist opencode upgrades across rebuilds
* fix(sandbox): align canonical spec with msb 0.6.8 runtime defaults
* feat(sandbox): show unwrapped sandboxed bash commands in message UI
* refactor(sandbox): pin shell shim to sandbox agent bash without rewriting commands
* feat(sandbox): route notifications through a host-side manager tool
* feat(sandbox): route all assistant capabilities through the ocm tool
Add an allow-listed request action to the generated ocm plugin so agents
reach settings, assistant reload, repos, git-info, workspaces, and
schedules through the tool instead of curling the internal API with a
bearer token, which is impossible under sandboxing.
Rewrite the curl-based skills to use the ocm request action and drop the
apiBaseUrl plumbing. Remove the now-unread .opencode/internal-token file
and the sandbox tmpfs mask that hid it; attestation now rejects any
tmpfs other than the runtime /tmp mount.
* fix(sidebar): wire new-session and new-schedule actions to every page
AssistantRedirect never registered a listener for the sidebar's
new-session event, so the desktop sidebar CTA on /assistant was a
no-op; the Schedules pages had the same gap for new-schedule.
Make useSidebarAction the single source of truth for action keys and
event dispatch, and warn when an action is dispatched with no mounted
handler so an unhandled CTA fails loudly instead of silently. Wire the
missing listeners to the existing per-page handlers.
* feat(sandbox): forward git credentials into the microVM and add sandbox guest image
* feat(sandbox): add git credential forwarding toggle to settings
* Fix question prompt not rendering for active session
currentQuestion was the first pending question globally across all
sessions. When another session had the first question in the flat list,
the QuestionPrompt would not render for the session being viewed even
though it had its own pending question.
Add getForSession() to the questions context and use it in
SessionDetail to look up questions scoped to the current session.
* test(frontend): cover session-scoped question prompt resolution
The SessionDetail useQuestions mocks did not expose getForSession, so
every page test threw on the new session-scoped lookup. Add it to each
mock and lock in the behaviour with regression coverage: the context
helper resolves questions per session while another session owns the
global current question, and SessionDetail renders the prompt for the
session being viewed.
---------
Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
* feat: show variant label on model picker and add folder upload for agents/commands
- Replace three-dot variant menu trigger with selected variant label
- Add POST /api/settings/opencode-directory-files/install endpoint
- Upload agents/commands markdown folders into .config/opencode/{agents,commands}/
- Reload OpenCode server after upload so files are picked up
* fix: revalidate branch/git caches when mobile sheet opens and on vcs.branch.updated SSE
- add shared invalidateRepoGitCaches() helper for consistent invalidation
- revalidate repo list when mobile repo quick-switch sheet opens
- revalidate current repo when mobile More drawer opens
- revalidate repo/git caches when Source Control dialog opens
- handle vcs.branch.updated SSE event with optimistic cache update
- use helper in branch create/switch mutations in useGit and BranchesTab
* style: make variant selector look more like a button with chevron and compact sizing
* refactor: consolidate settings editors, add folder upload support, and clean up unused code
* refactor: consolidate settings editors, add folder upload support, and clean up unused code
* feat: add opencode-directory-files listing service and consolidate settings editors
* fix: distinguish scroll from tap in suggestion popups on touch devices
* refactor: consolidate settings editors and add DirectoryFilesList component
* refactor: target repo status cache updates only to affected batch entries
* refactor: streamline settings, git hooks, and query invalidation logic
* feat(session): paginated session list with infinite scroll and search
Replace per-directory useQueries session listing with a combined
cursor-based useInfiniteQuery (25 per page, loads more on scroll) and
move search into the API query instead of client-side filtering.
Add OpenCodeClient.listSessionsPage backed by the v2 /api/session
endpoint plus a toLegacySession adapter. Add invalidateSessionListCaches
to centralize session-list cache invalidation for infinite queries, and
update EventContext and useSSE to handle the new infinite-query cache
shape.
* fix(session): centralize and debounce session-list cache invalidation
Migrate ResetPermissionsDialog off the stale per-directory cache key
(which no longer matches the infinite-query key shape and hardcoded the
opencode URL) to the shared invalidateSessionListCaches helper, and drop
the now-unused repoDirectory prop and its call sites.
Debounce session-list invalidation on SSE session.updated events in
EventContext and useSSE so a burst of updates coalesces into a single
refetch instead of one per event. Fix the directory fallback in
EventContext getClient so it never returns the joined directory key.
* fix(permissions): scope instance dispose to the repo directory
Drop the session-list cache invalidation from ResetPermissionsDialog:
disposing the OpenCode instance does not change the persisted session
list, so the refetch was unnecessary, and the prior cache key no longer
matched the paginated shape.
Guard the reset-permissions route against an empty repo directory so it
never forwards /instance/dispose without a directory, which would
dispose the entire server instead of only the repo's instance.
* chore: remove dead code and unused exports
* fix: preserve model form during config refresh
Signed-off-by: mehmet turac <mehmetturac@gmail.com>
* loop: model-select-fix completed after 11 iterations
* fix(frontend): show provider prefix for duplicate models in quick select dropdown
When the same model exists under multiple providers, show the provider name
for both entries so users can distinguish them. Detects duplicates by modelID
across all favorites and recents.
* refactor(frontend): replace useTallScrollContent with scroll visibility hook
* fix: harden mirror push rollback
* Remove Load button from skill cards, clicking card loads skill
* feat(backend): add plugin installation support and schema updates
* refactor(frontend): remove unused useHeaderScrollVisibility hook
* refactor(frontend): replace model dropdown with bottom sheet selector
Replace DropdownMenu-based ModelQuickSelect with a bottom sheet
implementation featuring favorites, recents, provider browsing, and
search. Remove onShowModelsDialog prop from PromptInput and
SessionDetail, using data attribute trigger instead. Fix ZodIssueCode
deprecation, input text color, and portal rendering for bottom sheet.
* fix(frontend): simplify session model restore and fix mobile swipe reset
* loop: single-source-models completed after 10 iterations
* refactor(frontend): add desktop sidebar layout to model quick select
* refactor(frontend): improve model selector with connected providers, favorites, and recent management
* fix(frontend): constrain model name width to prevent overflow in prompt input
* fix(frontend): adjust padding and styling in model quick select
* fix(frontend): add optimistic removal with rollback for recent models
---------
* 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 <>
Implement syncForSession for permissions alongside questions, using React
Query for automatic polling with 30-second intervals when sessions are
active. Adds reconcilePermissionsForDirectory to handle stale session
cleanup and ensures permissions are removed after response.
* 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
* Fix auth logout redirect and add tree node spacing
* Remove app loader animation and related cleanup
Removes custom app loader UI from index.html and useEffect in App.tsx that handled loader fade-out transition
* refactor: consolidate git services into single GitService class
Merges GitBranchService, GitCommitService, GitDiffService, GitFetchPullService,
GitLogService, GitPushService, and GitStatusService into one cohesive GitService
that simplifies architecture and follows SOLID principles. Updates all route
handlers and tests to use the new consolidated service. Moves GitBranch interface
to shared types location.
* Refactor settings dialog to use URL-based state management with tab synchronization
* Update social preview image
* 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
* Remove unused variables from routes and migrations
* Use structured logging instead of console in archive service
* Remove unused test variables and configure ESLint for test files
* refactor sse directory management with reference counting and improve message invalidation
* simplify question prompt Other option handling and increase max height
Remove redundant Cancel/Confirm buttons, use main Next/Confirm button for custom input, prevent double selection in single-select mode, auto-scroll textarea on focus, increase max-height from 40vh to 70vh
* Add Better Auth integration with session management
- Implement user authentication using Better Auth library
- Add login, register, and sign out functionality
- Support passkey/WebAuthn authentication
- Create database schema for users, sessions, accounts, passkeys
- Add AuthProvider context and ProtectedRoute components
- Add account settings page in settings dialog
- Protect all API routes with authentication middleware
- Update environment configuration for auth providers
* Add single-user authentication system with admin setup
- Add first-run Setup page for initial admin account creation
- Add environment-based admin configuration (ADMIN_EMAIL, ADMIN_PASSWORD)
- Add password reset capability via ADMIN_PASSWORD_RESET environment flag
- Migrate to data routers with auth loaders, remove ProtectedRoute
- Add change password functionality to account settings
- Enforce AUTH_SECRET requirement in production
- Auto-disable registration when admin is pre-configured via environment
* Track busy/idle session status across hooks
* Bump version to 0.7.5
* Update pnpm to 10.28.1
When permission events arrive via SSE, record which repo/directory they
came from. Use this mapping in getClient() to ensure the correct directory
parameter is sent when approving permissions for subagent sessions.
Fixes#33
Co-authored-by: OpenCode Agent <agent@opencode.ai>
* 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 duplicate config validation to backend
- Fix TTS button comparison using original text
- Track original vs sanitized text in TTS context
- Update toast import in message hooks
- Add type safety for error handling