Commit Graph
24 Commits
Author SHA1 Message Date
Chris Scott 59fd516b75 fix(session): unify prompt sends on prompt_async and suppress stale network banners
Remove the long-lived synchronous POST to /session/{id}/message that produced
spurious "Connection Failed" banners on transient network blips; route every
send (normal, streaming-queue follow-up, message refresh) through prompt_async,
whose failure genuinely means not-delivered. Suppress network-kind banners
while SSE is disconnected or reconnecting (the header already shows that state);
session-kind banners still appear and reconcile clears confirmed prompts after
reconnect.
2026-07-20 23:45:46 -04:00
Chris Scott 9479e1f662 fix(frontend): adapt session list to OpenCode v1.16.0 API response changes (#252)
* fix(frontend): adapt session list to OpenCode v1.16.0 API response changes

* fix: support both old and new /api/session response formats
2026-06-05 09:00:10 -04:00
Chris Scott dbd6866682 feat(assistant): self-configuring assistant mode (#244)
* test(backend): replace better-sqlite3 test mock with node:sqlite

Reimplement the bun:sqlite test mock on top of node:sqlite with an
explicit BEGIN/COMMIT/ROLLBACK transaction wrapper.

* feat(assistant): self-configuring assistant mode

Add a self-editable assistant workspace and the APIs that support it:
- POST /assistant/reload disposes and re-bootstraps the assistant
  instance (directory-scoped, rate-limited) so agent.md edits apply.
- Internal settings API accepts non-secret TTS/STT patches via
  dedicated partial schemas.
- Strip the generated agent persona from opencode.json on repair so
  user-customized agents are preserved across config recovery.
- Cache the last assistant session id to avoid redundant session
  listing on launch.

* style(repo): align worktree and workspace tabs with primary/orange theme
2026-05-31 11:38:02 -04:00
Chris Scott eedbbfb94e feat(session): paginated session list with infinite scroll and assistant mode improvements (#243)
* 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.
2026-05-31 10:32:14 -04:00
Chris Scott b9236f7f20 feat(worktree): worktree tabs, server env vars, and multi-directory SSE (#240)
* loop: worktree-tabs-2 completed after 4 iterations

* loop: server-env-vars completed after 7 iterations

* feat(worktree): add worktree tabs and server env vars settings

* refactor(worktree): multi-directory SSE support and workspace chip row

* feat(workspace): collapsible workspace manager and sibling filtering

* feat(workspace): workspace creation endpoint, refactored workspace manager, and tests

* refactor(frontend): unify workspace label and remove dead code

- extract shared workspaceLabel helper into api/repos and reuse in
  WorkspaceManager and RepoDetail directoryLabels
- remove unused useSessions hook and subscribeToDirectory subscription
- drop redundant frontend workspace dedup now guaranteed by backend
- align WorktreeTabs empty-state test with create-workspace button
2026-05-30 19:44:07 -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 62c8a41e01 fix(frontend): reconcile pending questions by directory and improve TTS fallback (#204) 2026-04-28 11:32:19 -04:00
Chris Scott 47524876aa Refactor schedule service and add cron support 2026-03-22 11:14:30 -04:00
Chris Scott 1e863c5fc5 Add cron-based scheduling with prompt templates integration (#164) 2026-03-21 23:33:03 -04:00
Niu ShuaiandChris Scott a77d9e0371 feat: add LSP server status display UI with dialog list (#154)
* feat: add LSP server status display


Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
2026-03-08 22:11:36 -04:00
Chris Scott 5de419ee28 fix issues (#136)
* 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
2026-02-15 19:48:03 -05:00
Chris Scott 8233fec1a9 Standardize on fetch and remove axios dependency 2026-02-02 23:58:16 -05:00
Chris Scott a05535e0ef Fix SSE reliability and message delivery for production environments (#85)
* Switch to sync prompt endpoint for reliable message delivery

Use the synchronous /message endpoint instead of /prompt_async to ensure
the UI receives authoritative response data. This matches OpenCode TUI
behavior and prevents message desync during sub-agent tasks.

* Add SSE heartbeat to prevent Cloudflare 524 timeout
2026-01-27 09:50:15 -05:00
Chris Scott efd3b94372 fix: use async prompt endpoint to prevent timeout on subagent tasks 2026-01-20 23:16:04 -05:00
Chris Scott f7fd3176d4 Refactor SSE event handling and consolidate notification contexts 2026-01-12 23:56:50 -05:00
Chris Scott 17ee96d316 regenerate OpenAPI spec and add model selection components 2026-01-10 18:39:12 -05:00
Chris Scott ac188c953b Remove console.log debug statements and cleanup debug code 2025-12-25 10:38:01 -05:00
Chris ScottandChris Scott a9ebee72c4 Fix compact command validation flow (#28)
* 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>
2025-12-19 00:10:12 -05:00
OpenCode Agent 6c4daaeae7 Add message undo/refresh functionality with editable user prompts
- 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
2025-12-16 18:53:31 +00:00
Chris Scott dc7964021d Add @ mention support for agents and files, extract CopyButton component 2025-12-06 11:21:06 -08:00
Chris Scott e2e6ca07ae Update provider management and model selection UI 2025-12-05 12:30:05 -08:00
Chris Scott 83834e7ed7 Add local repository support and permission request handling 2025-11-28 10:26:03 -05:00
Chris Scott fea3c214af Add MCP server management with auto-restart functionality 2025-11-26 23:43:19 -05:00
Chris Scott bbf66c259b Initial release v0.2.5 2025-11-23 23:25:27 -05:00