61 Commits
Author SHA1 Message Date
Chris Scott ae4ce0e81c docs: move documentation to hosted site and refresh branding
Remove the in-repo MkDocs site, its deploy workflow, and the tests that
asserted its content. Repoint README, CONTRIBUTING, and .env.example links
to opencodemanager.app/docs, and update logos, favicon, PWA icons, manifest,
and image alt text to the OpenCode Manager branding.
2026-10-04 18:19:35 -04:00
Chris Scott ff629c1d99 docs: add theme showcase video to README 2026-09-29 16:29:18 -04:00
Chris Scott a1b7f58aae feat(opencode-config): redact secrets and add MCP listing to the internal config API (#366) 2026-09-28 23:52:41 -04:00
Chris Scott 702e3c4e13 docs: refresh screenshots, trim feature docs, and drop the New Repo sidebar CTA (#363) 2026-09-27 19:22:04 -04:00
Chris Scott dacde879d6 feat(opencode): migrate OpenCode Manager to OpenCode 2 (#359)
* 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
2026-09-26 13:16:45 -04:00
Chris Scott 5d9a159c07 Add domain to README 2026-07-13 00:15:09 -04:00
Chris Scott 01e50a7019 feat: add bundle-based OCM mirror sync (#289)
* feat: add bundle-based OCM mirror sync

* feat: add OpenCode model editor and HEAD-safe bundle import

* fix: consolidate discovery-cache, batch bundle refs, remove dead code (#290)

* fix: consolidate discovery-cache, batch bundle refs, remove dead code

* refactor: consolidate discovery cache into generic discoverCached, extract spawnGit helper

* feat: extract project-id-resolver, add CLI full-fallback prompt, wire lint into root scripts

- Extract shared project-id-resolver for origin URL matching (replaces local-repo duplicates)
- Add promptYesNo / confirmFullFallback to ocm CLI before slow full mirror
- Backend: consolidate opencode-workspaces routes with project-id-resolver
- Frontend: fix schedules prompt/global page navigation
- CLI: add eslint config, lint/lint:fix scripts, fix no-fallthrough in ocm.ts
- Root: wire CLI into build, test, typecheck, lint, lint:fix chains
- Fix test lint issues (_code, const, require→import)

* fix: replace polynomial regex with linear-time string ops in gitRemoteParts

* feat: add divergence guards for push/pull, streaming bundle upload, server-side ancestry check

- Backend: GET /:repoId/mirror/head (head+branch+dirty) and GET /:repoId/mirror/contains/:sha (ancestry check)
- CLI: checkPushDivergence warns before overwriting server commits; checkPullDivergence warns before discarding local commits; both require confirm or --force
- Bundle upload now streams from disk instead of buffering entire file in memory
- Version visible in --help and default (no-arg) output
- Version bump 0.1.5 → 0.2.0

* fix: show connecting message before fetching repos in default command

* fix: update default command messages to reflect actual matching behavior
2026-06-28 11:57:38 -04:00
Chris Scott 56c03b09ed docs: add mobile screenshot next to main image in README 2026-05-31 20:05:39 -04:00
Chris Scott 23a9bf8f2d docs: remove screenshots section, expand features list 2026-05-31 19:59:09 -04:00
Chris Scott c835c68777 docs: replace demo GIF with static screenshot in README and docs index 2026-05-31 19:57:01 -04:00
Chris Scott f1d2d39318 docs: relocate ocm CLI guide, update references, remove test.getfit.us config 2026-05-31 19:30:56 -04:00
Chris Scott a86e4b1238 feat(ocm-cli): workspace repo sync and manager token targeting (#233) 2026-05-23 19:49:44 -04:00
Chris Scott c3d6549f01 feat: add assistant mode, SSE streaming, and OpenCode server integration (#214) 2026-05-02 21:51:37 -04:00
Chris Scott 0f9caad98d Migrate memory plugin to standalone repository and remove Kasm files (#182)
Remove packages/memory from monorepo - plugin now lives at
chriswritescode-dev/opencode-memory and is installed from npm.

Update Dockerfile, docs, and workspace config to reflect the change.
Remove Dockerfile.kasm, kasm-startup.sh, and Kasm CI workflow.
2026-04-06 11:47:42 -04:00
Chris Scott fcfab08b0e Update documentation and configuration for production deployment
- Fix documentation drift across README, AGENTS.md, and CONTRIBUTING.md
- Update Docker configuration with process timing and OAuth env vars
- Simplify shared env config by removing unused Redis and OpenCode API URL
- Add skills documentation to navigation
- Improve .env.example with clearer AUTH_SECRET instructions
2026-03-22 18:54:15 -04:00
Chris Scott 1e863c5fc5 Add cron-based scheduling with prompt templates integration (#164) 2026-03-21 23:33:03 -04:00
Chris Scott 6ef68774d8 Clean up and enhance memory plugin (#151)
* refactor storage to use worker-based vector operations

* update memory service and agent implementations

* update opencode plugin sdk

* update memory plugin documentation

* add tests for memory service and injection hook

* update lockfile for dependency changes

* Add memory plugin v0.0.13 with message deduplication and config UI

* Remove planning state feature from memory plugin
2026-03-06 20:24:52 -05:00
Chris Scott be871aa5b2 Readme redesign (#146)
* Redesign README for improved GitHub rendering

* Fix release badge URL format

* Add .env setup to Quick Start and update config examples

* Add Git Commit Demo GIF

* Fix release badge to use tag endpoint

* update development docs and fix default port in env

* Enhance Docker documentation with environment variables and entrypoint behavior

* Expand Memory plugin documentation with architecture, agents, and hooks

* Add dark mode CSS and configure MkDocs for dark-only theme
2026-02-23 20:28:49 -05:00
Chris Scott 3461f86556 Add memory plugin with semantic search and session planning (#145)
* Add memory plugin with semantic search and session planning

* Clarify Memory Plugin is optional in docs
2026-02-23 15:08:56 -05:00
Chris Scott abec58282b Add SSH Authentication feature and bump version to 0.8.27
- Add SSH key authentication for git repositories
- Host key verification with fingerprint display
- Support for passphrase-protected SSH keys
- Custom SSH port support for non-standard ports
- Known hosts management with change detection
- Update documentation in README and docs/features/git.md
- Add SSH authentication to features overview
2026-02-08 14:31:38 -05:00
Chris Scott 67ace0ae89 Update README with hero social preview image 2026-02-06 23:26:22 -05:00
Chris Scott ae644e851d feat: add push notifications with VAPID (#110)
* 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
2026-02-06 11:23:10 -05:00
Chris Scott 4a0485daf0 Reduce demo GIF height in README for better fit 2026-01-27 09:53:39 -05:00
Chris Scott 52fd2381a2 Add Speech-to-Text feature documentation to README 2026-01-26 23:17:05 -05:00
Chris Scott da6cad8b3a Add comprehensive documentation and download feature (#83)
* 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
2026-01-26 23:09:27 -05:00
Chris Scott b9f0d539eb Add documentation for HTTP/LAN deployment configuration 2026-01-24 23:49:01 -05:00
Chris Scott 81a66d2ddb Add single-user authentication system with Better Auth integration (#76)
* 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
2026-01-24 17:45:44 -05:00
theepicsaxguyandChris Scott e91c54ba20 Git Source Control Integration (#74)
* 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>
2026-01-19 22:03:42 -05:00
Chris Scott 913c427f6b Add roadmap link to README 2026-01-15 18:19:24 -05:00
Chris Scott 614c6ebce8 Fix local development instructions to use pnpm
Closes #35
2025-12-29 23:19:05 -05:00
Chris Scott 87f79c63af Fix chat screenshot sizing in README 2025-12-26 22:30:54 -05:00
Chris Scott 1e508174b9 Fix inline diff to match mobile column layout 2025-12-26 22:23:43 -05:00
Chris Scott 817fe3d370 Add height constraint to inline diff screenshot 2025-12-26 22:23:04 -05:00
Chris Scott df37cb0669 Reduce inline diff screenshot width to 500px 2025-12-26 22:22:46 -05:00
Chris Scott e8c62d7f3f Add width constraint to inline diff screenshot 2025-12-26 22:22:21 -05:00
Chris Scott a951ce1021 Fix inline diff screenshot URL 2025-12-26 22:21:58 -05:00
Chris Scott 3224bf7923 Reorganize screenshots section with table layout 2025-12-26 22:20:23 -05:00
Chris Scott e51537d92d Update README screenshots with new images 2025-12-26 22:12:00 -05:00
Chris Scott ecf00cc4ef Update README with TTS features and Mermaid diagram support 2025-12-21 23:48:49 -05:00
Chris Scott 433c2da50d Add global AGENTS.md editor and expose dev server ports 5100-5103 2025-12-12 23:38:14 -05:00
Chris Scott af9f645f30 Add ZIP download feature for repositories
- Add archive service to create ZIP files excluding gitignored files
- Add download endpoint to backend repo routes
- Add download button to repo cards with loading state
- Update README with new ZIP download feature
2025-12-12 20:48:38 -05:00
Chris Scott fa814d4926 Update README with mobile-first description and code formatting 2025-12-12 19:16:49 -05:00
Chris Scott 7a647cb316 Fix README Docker clone URL to use correct repository username
- Update clone URL from cstech-dev to chriswritescode-dev
- Fixes issue #17 where users couldn't clone the repository
- Ensures Docker installation instructions work correctly
2025-12-12 14:08:41 -05:00
Chris Scott d648ef38f0 Revert asset URLs to working opencode-web releases, keep container name update
- Keep demo assets pointing to existing opencode-web releases
- Keep docker exec command updated to opencode-manager container name
2025-12-12 14:06:11 -05:00
Chris Scott 38d5727a95 Update README references from opencode-web to opencode-manager
- Update demo asset URLs to new repository
- Update docker exec command to use new container name
- Update version numbers in asset URLs to 0.4.0
2025-12-12 14:04:04 -05:00
Chris Scott 8d0d961e50 Rename project from opencode-webui to opencode-manager
- Update package names from opencode-webui to opencode-manager
- Update all backend import statements to use @opencode-manager/shared
- Update Docker configuration and container name
- Update README.md with new repository URLs and project title
- Update frontend assets and titles
- Update version to 0.4.0
- Update docker entrypoint script comments

This change maintains all functionality while better reflecting the
project's purpose as a comprehensive management interface for OpenCode.
2025-12-12 13:58:08 -05:00
Chris Scott 48b235d3da Simplify OAuth documentation in README 2025-12-07 23:04:24 -05:00
Chris Scott bc99c96021 Add OAuth provider authentication support (#14)
* 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
2025-12-07 23:01:05 -05:00
Chris Scott 680fed3313 Update repository URL in README 2025-12-07 14:38:52 -05:00
Chris Scott ec1d96a77d Fix session caching - enable refetch on focus and reconnect 2025-12-07 14:34:35 -05:00