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)
- Add eslint rules for test files with proper tsconfig and globals
- Add no-empty rule exception for PromptInput
- Remove unused renderTrigger dependency from useMemo in virtualized-text-view
- Fix session status to properly set idle state when assistant message completes
* feat(source-control): add commits and file management components
- Introduced `CommitsTab` for displaying commit history with relative time formatting.
- Added `GitFlatFileItem` and `GitFlatFileList` for managing file statuses in the source control panel.
- Implemented `SourceControlPanel` to encapsulate source control functionalities including changes, commits, and branches.
- Enhanced `useGit` hook to manage git operations such as fetch, pull, push, commit, stage, and unstage files with appropriate error handling and toast notifications.
- Updated `RepoDetail` to integrate the new source control panel and provide a user interface for source control actions.
- Defined `GitCommit` type for better type safety in commit-related operations.
* refactor: streamline error handling in Git operations and update error imports
* feat: enhance Git services and ESLint configuration for improved functionality
* refactor: update method signatures for consistency and clarity in Git services
* feat: refactor git services and improve error handling
- Remove unused imports and clean up code in repos.ts and git-operations.ts.
- Simplify error handling in repo.ts by enforcing message property in ErrorWithMessage interface.
- Update GitPushService to remove unnecessary database parameter in methods.
- Enhance executeCommand function to better handle command execution results.
- Update tests to use mocked functions for better isolation and clarity.
- Add specific ESLint rules for test files to accommodate common testing patterns.
- Introduce tsconfig.test.json for better TypeScript configuration in tests.
- Update vitest.config.ts to use the new test TypeScript configuration.
* refactor: remove esbuild configuration from Vitest setup
* feat: enhance Source Control Panel with branch management and integrate into RepoDetail and SessionDetail pages
* feat: implement Git authentication service and refactor related services
- Add GitAuthService to handle Git environment setup with credentials.
- Refactor GitBranchService, GitCommitService, GitFetchPullService, GitPushService, GitStatusService, and GitLogService to utilize the new GitAuthService.
- Remove GitCommandUtils and related error handling for Git operations.
- Delete git-operations.ts and associated tests as functionality is now integrated into other services.
- Update TypeScript configuration to enable composite projects for better build management.
* feat: refactor Git services to improve structure and update imports
* refactor: simplify error utility functions and update test cases for Git services
* feat: refactor GitAuthService and update related tests for improved credential handling
* feat: implement GitDiffService and related endpoints for file diff functionality
* feat: add emitDeclarationOnly option to TypeScript configuration files
* feat: enhance GitLogService to fetch remote branches and improve error handling in repo commands
* feat: update Git command execution to remove fallback and enhance environment variable handling
* feat: add repository authentication tracking
- Add `requires_auth` column to repos table
- Implement auth check in GitAuthService
- Update cloneRepo to detect public/private repos
- Add test coverage for auth-related functionality
- Improve UI styling for auth-related indicators
* feat(git): implement interactive Git authentication with askpass
- Add GitAskpassService to handle credential requests from Git
- Implement askpass script that communicates with backend
- Update GitAuthService to use askpass instead of direct credential
injection
- Add new endpoint for branch listing and status
- Improve branch name handling in GitBranchService
- Enhance error handling in GitDiffService for untracked files
- Add upstream branch checking and setup in GitFetchPullService
- Update UI components for better visual consistency
- Fix various minor UI styling issues
* feat(git): enhance Git authentication with improved askpass support
- Update askpass endpoint to handle hostname parameter and return full
credential object
- Replace `createNoPromptGitEnv` with `createSilentGitEnv` for better
VSCode compatibility
- Add compiled Node.js askpass script for broader compatibility
- Enhance GitBranchService to return detailed branch information with
upstream tracking
- Improve branch listing UI with better sorting and display
- Update GitAuthService to use askpass for all operations with proper
credential handling
- Fix various UI styling issues in diff view and source control panel
- Update test mocks to use new silent environment function
- Add proper error handling and credential caching in GitAskpassService
* feat(git-auth): implement IPC-based Git authentication system
- Add new IPC server infrastructure for handling Git credential requests
- Implement AskpassHandler to manage Git authentication through IPC
- Replace previous HTTP-based askpass system with local IPC
communication
- Remove deprecated GitAskpassService and related HTTP endpoints
- Update GitAuthService to use IPC-based authentication flow
- Add new shell scripts for Git askpass integration (askpass.sh,
askpass-main.js)
- Remove database column 'requires_auth' as it's no longer needed
- Update all Git service classes to use new authentication approach
- Improve error handling and credential caching
- Add proper cleanup for IPC server on shutdown
* fix(frontend): correct GitBranch type usage in BranchesTab and BranchSwitcher
* fix(ipc): handle empty responses and add logging for askpass handler
- Handle empty response bodies in askpass-main.ts to prevent JSON parse errors
- Add logging to IPC server for debugging request/response issues
- Add logging to AskpassHandler for credential lookup visibility
* fix(ipc): return empty credentials for silent fetches instead of failing
Silent fetch operations (used when fetching commit history on repo open)
should return empty credentials gracefully rather than failing, allowing
git to proceed without credentials for public repos or cached credentials.
* chore(ipc): add detailed logging for debugging askpass requests
- Log handler registration and lookup paths
- Log incoming request details
- Log handler response results
* chore(askpass): add comprehensive debugging to trace IPC communication
- Add detailed stderr logging to askpass-main.ts for all steps
- Log environment variables and paths at initialization
- Log IPC connection attempts and responses
- Log JSON parsing results
This will help trace where the IPC communication fails.
* chore(debug): add comprehensive logging to trace git environment and IPC requests
- Log GIT_ASKPASS, VSCODE_GIT_IPC_HANDLE, GIT_TERMINAL_PROMPT env vars when executing git
- Log all incoming IPC requests with URL and body
- Log handler registration status
* Integrate GitAuthService throughout repo operations
- Add GitAuthService parameter to all repo service functions
- Replace direct git env creation with GitAuthService.getGitEnvironment()
- Update route handlers to pass GitAuthService to service calls
- Remove createSilentGitEnv utility in favor of centralized auth
- Ensure consistent git authentication across all operations
* refactor: consolidate git services and remove duplicate fetch service
- Remove GitFetchService and consolidate into GitFetchPullService
- Clean up duplicate git authentication logic across services
- Simplify repo service by removing redundant environment handling
- Update tests to reflect consolidated service structure
- Remove unused imports and streamline API endpoints
- Reduce codebase complexity by eliminating service duplication
* refactor: clean up unnecessary config changes and improve git API types
* feat(git): add GitCommit interface and fix push mutation
* feat(git): fix source control panel issues
- Fix unstaged file diff showing all changes instead of working directory only
- Remove auto-refresh (10s) to reduce git command spam
- Add reset/revert mutation for unpushed local commits
- Fix branch creation/switching to update database
- Add unpushed commit detection and visual indicator in commits tab
- Handle no-upstream branch status gracefully
* fix(git): improve branch listing and remove regex parsing issue
- Fix branch name parsing to use full name instead of regex capturing only first word
- Add refresh button for branches
- Show remote branches with Globe icon and make them non-clickable
- Add 'local' label for branches without upstream tracking
- Handle remotes/ prefix properly in branch detection
* fix(git): remove duplicate refresh button
* fix(git): properly extract branch name from git output
- Extract branch name before whitespace/bracket in git branch -vv -a output
- When clicking remote branch, checkout local tracking branch instead of remote reference
* fix(git): remove duplicate refresh button from branches tab
* fix: improve source control panel mobile layout
- Set full height on mobile for better screen utilization
- Add larger centered close button on mobile
- Hide default close button when custom one is shown on mobile
* Remove git credential test feature
The test credential button in settings was broken because it tried to test
authentication against just the host URL (e.g., https://github.com/) instead
of a repository path. Since git credentials are already handled correctly
through the askpass mechanism when cloning repositories, the test button
was redundant and has been removed.
Changes:
- Remove /test-credential endpoint from settings routes
- Remove testGitCredential API from frontend
- Remove TestCredentialRequest/Response types
- Remove test button and related state from GitSettings component
* fix: resolve Copilot review issues
- Remove duplicate GitCommit interface definition
- Fix CSS typos: bg-linear-to-br -> bg-gradient-to-br
- Fix typo: /sessflex-shrink-0 -> flex-shrink-0
- Add *.test.js to .gitignore and remove compiled test files
- Fix missing closing brace in useGit.test.tsx
- Remove unused maskToken function
* fix(git): correct ahead/behind count order and add renamed file path parsing
- Fix git rev-list output parsing: ahead comes first, behind second
- Add oldPath extraction for renamed (R) and copied (C) files in status
- Refactor git service tests to use consistent mocking patterns
- Add missing Database and SettingsService mocks to prevent test failures
---------
Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
Fixes#62
- Config file in workspace volume is now the source of truth
* Preserve raw config content with comments instead of re-stringifying parsed JSON
* Sync provider credentials to OpenCode server when adding or removing API keys
* Add error handling for session errors with toast notifications and inline message display
* Refactor provider settings to manage API keys directly with edit/delete support
* Adding markdown preview in FilePreview
* Refactor markdown rendering into reusable components
* Fix: Make syntax highlighting theme-aware
* Refactor: Follow project conventions for naming and CSS organization
* Refactor: Use virtualization infrastructure for markdown preview
- Add loadAll(), fullContent, isFullyLoaded to useVirtualizedContent hook
- Expose new methods via VirtualizedTextView ref handle
- Remove duplicate fetch in FilePreview, use ref methods instead
- Add 1MB size limit for markdown preview with user-friendly message
---------
Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
* 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>
* feat: Implement /compact command with processing feedback
- Add 'compact' status type to session status store
- Update SessionStatusIndicator to show purple pulsing animation for compaction
- Add summarizeSession() API method to OpenCode client
- Modify command handler for /compact to:
- Get current model from state
- Show compaction toast
- Set session to compacting status
- Call summarize endpoint with provider/model
- Update SSE handler to clear compact status on session.compacted event
The user sees a purple animated indicator and 'Compacting' text during the operation, matching the TUI experience.
* Fix compact command to use break instead of return for model validation
---------
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
- Add revertMessage and unrevertSession methods to OpenCode API client
- Create useRemoveMessage and useRefreshMessage hooks for message operations
- Add MessageActionButtons component with X (remove) and refresh buttons
- Add EditableUserMessage component for editing prompts before resend
- Update MessageThread to integrate action buttons and editable messages
- Update AGENTS.md with improved guidelines and pnpm preference
* feat: Implement OAuth support for provider authentication
- Add OAuth routes and API endpoints for authorize/callback flows
- Create OAuthAuthorizeDialog and OAuthCallbackDialog components
- Extend ProviderSettings to support both OAuth and API key auth
- Add OAuth credential support to auth service
- Update shared schemas with OAuth request/response types
- Support both 'auto' and 'code' OAuth flows
- Maintain backward compatibility with existing API key authentication
Backend:
- backend/src/routes/oauth.ts (new)
- backend/src/services/auth.ts (extended)
- backend/src/index.ts (route registration)
Frontend:
- frontend/src/api/oauth.ts (new)
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx (new)
- frontend/src/components/settings/OAuthCallbackDialog.tsx (new)
- frontend/src/components/settings/ProviderSettings.tsx (enhanced)
Shared:
- shared/src/schemas/auth.ts (OAuth schemas)
* feat: Complete OAuth implementation with comprehensive features
- Add comprehensive error handling for OAuth failures with specific error messages
- Implement OAuth token status checking and expiration monitoring
- Add token refresh preparation with 5-minute expiration buffer
- Enhance OAuth API client with detailed error reporting
- Update OAuth routes to include database parameter and token status endpoint
- Add complete OAuth documentation to README with setup guide
- Improve user experience with clear error messages and troubleshooting steps
- Support both auto and code OAuth flows for different providers
- Maintain backward compatibility with existing API key authentication
Error Handling:
- Specific error messages for invalid codes, expiration, access denied
- Graceful fallback for server errors and network issues
- User-friendly error display in OAuth dialogs
Token Management:
- Token status endpoint for checking credential validity
- Expiration monitoring with automatic refresh preparation
- Secure storage of OAuth credentials alongside API keys
Documentation:
- Complete OAuth setup guide in README
- Comparison table for OAuth vs API keys
- Troubleshooting section for common OAuth issues
* fix: Resolve OAuth button opening API key dialog instead
- Add isOAuthMode state to track authentication mode
- Update API key dialog to only open when not in OAuth mode
- Modify OAuth and API key button handlers to set proper mode
- Add proper cleanup handlers to reset OAuth mode on close
- Ensure dialog state management prevents conflicting dialogs
This fixes the issue where clicking 'Add OAuth' would incorrectly
open the API key dialog instead of the OAuth authorization dialog.
* refactor: Address audit findings for OAuth implementation
Critical fixes:
- Remove unused db parameter from createOAuthRoutes()
- Add query invalidation in handleOAuthSuccess to update UI after OAuth
- Remove unused setOAuth and getOAuthWithRefreshCheck methods
- Fix file permission in delete method (add mode: 0o600)
DRY improvements:
- Extract duplicated error handling to shared oauthErrors.ts utility
- Add OAuthMethod constants to replace magic numbers 0/1
- Use centralized OPENCODE_SERVER_URL constant via ENV config
- Remove unused ProviderAuthMethodsResponseSchema import
Code quality:
- Add documentation comment noting types should match shared schemas
- Consolidate error mapping logic into single mapOAuthError function
- Improve code maintainability and reduce duplication
Files changed:
- backend/src/routes/oauth.ts
- backend/src/services/auth.ts
- backend/src/index.ts
- frontend/src/lib/oauthErrors.ts (new)
- frontend/src/api/oauth.ts
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx
- frontend/src/components/settings/OAuthCallbackDialog.tsx
- frontend/src/components/settings/ProviderSettings.tsx
* Store model selection client-side with recent models display
* Limit provider settings to OAuth-capable providers only
* Remove unused code and consolidate model initialization into useModelSelection hook
- Immediately re-enable input when user clicks Stop
- Retry abort API call every 3 seconds in background (max 10 retries)
- Force-complete messages locally so UI is not blocked
- Stop retrying when server confirms abort via SSE