Commit Graph
442 Commits
Author SHA1 Message Date
Chris Scott 446d425e2e chore: clean up test suite per audit recommendations (#299)
Executes recommendations from a comprehensive test suite audit.
Removes dead, redundant, and trivial tests; rewrites SessionDetail
polling test to exercise real gating; trims duplicated assertions;
adds missing assertion in assistant-loading tests.

13 files changed, 233 insertions(+), 462 deletions(-)
2026-06-30 19:24:53 -04:00
Chris Scott a9b6f7ce46 feat: add session pinning for pinned/recent session groups (#301)
* feat: add session pinning for pinned/recent session groups

* refactor: extract buildSessionKey, deduplicate SessionCard rendering, clean up pins on delete
2026-06-30 19:22:26 -04:00
Chris Scott 217f5bd989 feat: add server restart coordination and health status tracking (#300)
* feat: add server restart coordination and health status tracking

* refactor: consolidate server restart logic, extract hooks, remove dead code
2026-06-30 18:20:54 -04:00
Chris Scott 68cd6b5a0b feat: add schedule permission config and workspace tracking (#297)
* feat: add schedule permission config and workspace tracking

Adds permission configuration for scheduled jobs (migration 016) and
workspace ID tracking on schedule runs (migration 017). Includes
service logic, UI controls, schema updates, and full test coverage.

* refactor: convert permission ruleset to object format, exclude active schedule worktrees from sibling repos

* refine: reduce destructive bash patterns to host-level commands only
2026-06-30 12:03:35 -04:00
Chris Scott 59258625c0 feat: add schedule worktree isolation for running jobs in isolated worktrees (#295)
* feat: add schedule worktree isolation for running jobs in isolated worktrees

* feat: schedule worktree isolation for running jobs in isolated worktrees

* feat: show worktree/branch artifact counts in clear history confirmation

* feat: validate and select base branches for schedule worktrees
2026-06-29 11:15:39 -04:00
Chris Scott 6c13d78563 fix: reconcile confirmed prompt on message fetch to clear stale send errors (#296)
* fix: reconcile confirmed prompt on message fetch to clear stale send errors

* refactor: extract reconcileConfirmedPrompt into dedicated module
2026-06-28 20:28:34 -04:00
Chris Scott 29a1e8f808 refactor: simplify RenameRepoDialog styling and remove unused props 2026-06-28 15:07:42 -04:00
Chris Scott 6a4e8734f9 feat: add repo rename capability with custom name field (#294)
* feat: add repo rename capability with custom name field

Add a custom name field to repos, allowing users to set a display name
independent of the repo URL or path. Includes a migration, PATCH endpoint,
rename dialog, and display name consolidation.

- DB migration 014 adds name column to repos table
- PATCH /api/repos/:id endpoint with Zod validation
- RenameRepoDialog component with clear/reset support
- RepoRowActions gains Rename action in both dropdown and inline modes
- getRepoDisplayName() consolidated to accept a repo object and prefer name
- All repo name display call sites updated to use the new API

* fix: add DialogTitle to RenameRepoDialog for a11y compliance

* refactor: extract getRepoDisplayName to shared utils, fix schedule cache invalidation on rename
2026-06-28 14:49:00 -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 bb1df259b6 fix: filter source control commits by branch (#286) 2026-06-27 09:36:03 -04:00
Chris Scott 8d93f2f1f9 fix: follow up prompt preservation changes (#292)
* fix: remove unused disabled prop, throttle SW update checks, precache icon

* fix: retract transient send error and restored prompt once server confirms send

When a long-running prompt request drops (gateway timeout or network error)
while the agent is actually working, the send error banner and the restored
prompt text were left in place. Tag send errors as 'network' and clear them
when the server confirms session activity (message.updated / session.idle),
also clearing the restored input text. Genuine server-reported session errors
(kind 'session') are preserved.

* style: restyle ErrorBanner with neutral card fill and destructive accent bar

Replace the all-red destructive Alert variant (transparent background, full
red text) with a neutral card-filled banner, a left destructive accent bar,
red icon, foreground title, and muted body/detail text. Improves the send-error
and git-error banners on the dark theme.
2026-06-27 09:26:37 -04:00
Chris Scott 71ba7371bc fix: allow saving edited PAT credential when reusing existing token 2026-06-21 09:25:48 -04:00
Chris Scott 55af93062a refactor: extract CredentialProvider service and consolidate git-auth utilities (#283)
* refactor: extract CredentialProvider service and consolidate git-auth utilities

* refactor: add git-credentials route and gh env plugin, pass internal token to OpenCode

* refactor: update credential provider integration and git route

* refactor: integrate credential provider across git auth, routes, and IPC
2026-06-20 21:52:18 -04:00
Chris Scott 5b85abd627 refactor: remove assistant auto-launch and simplify redirect flow (#282) 2026-06-20 12:28:32 -04:00
Chris Scott 617962f2dd feat: directory files upload system, deferred restart model, cache invalidation consolidation, and misc improvements (#281)
* 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
2026-06-20 00:40:36 -04:00
Chris Scott d268182610 refactor: extract SettingsList component and unify settings editor layouts (#280) 2026-06-18 10:44:52 -04:00
Chris Scott 6e80cdfb8c feat: add skill installer (#279)
* feat: add skill installer with install/uninstall and settings UI

* feat: refactor skill installer with extracted SkillLibraryList component

* feat: simplify SkillsEditor, extract SkillLibraryList

* feat: refactor skill installer components and add github utility
2026-06-17 23:11:29 -04:00
Chris Scott 24d34f28a3 Revert "feat: add skill installer with install/uninstall and settings UI (#277)" (#278)
This reverts commit 9cb2bb156b.
2026-06-17 23:09:34 -04:00
Chris Scott 9cb2bb156b feat: add skill installer with install/uninstall and settings UI (#277)
* feat: add skill installer with install/uninstall and settings UI

* feat: refactor skill installer with extracted SkillLibraryList component

* feat: simplify SkillsEditor, extract SkillLibraryList
2026-06-17 22:52:05 -04:00
Chris Scott 3e617c2df8 fix: preserve prompt text on network error and allow offline typing (#276)
* fix: preserve prompt text on network error and allow offline typing

* fix: preserve prompt on network error, swallow 524 to avoid duplicate sends

* feat: add service worker precaching with app shell and runtime cache strategies

* fix: copy frontend/plugins into Docker build context

* fix: improve service worker update checks with visibility and focus handlers

* fix: add connect timeout to event stream to recover from failed connections

* fix: remove optimistic message insert, keep prompt in input until server confirms
2026-06-17 17:28:59 -04:00
Chris Scott a7d0c13f9a fix: avoid auto-applying OpenCode config on dropdown selection (#275) 2026-06-15 18:58:50 -04:00
Chris Scott 4e32fd5b00 feat: add session status store with optimistic active state and SSE polling (#272)
* feat: add session status store with optimistic active state and SSE polling

- Adds sessionStatusStore with setOptimisticActive (auto-timeout), statusCache deduplication, and replaceStatuses/clearStatus

- Integrates store in useSendPrompt (set optimistic on send, clear on error)

- Adds session.status SSE event handling in useSSE with 5s polling fallback

- Refactors test to mock the store instead of using real store instance

- Fixes repoId null check in useRepoActivity

* feat: replace event-source-polyfill with native SSE for PromptInput

* fix: keep stop button visible and hide clear prompt button during active session

* feat: restore failed queued prompts and preserve optimistic active status during poll

* test: add MessageThread tests for optimistic editing state and resend flow

* fix: handle queued prompt edge cases during pending submission and SSE errors
2026-06-10 08:35:19 -04:00
Chris Scott 8133b655b0 refactor: persist assistant repo in database with ID migration (#271) 2026-06-09 14:46:39 -04:00
Chris Scott 0d384d6cf0 refactor: move assistant workspace install before OpenCode server start (#263)
* refactor: move assistant workspace install before OpenCode server start

* refactor: skip assistant-mode status fetch on open, use repo fullPath and cached session
2026-06-07 13:35:19 -04:00
Chris Scott 0d14e754e1 refactor: extract shared useUrlParams hook and use push navigation for dialogs (#266)
* refactor: extract shared useUrlParams hook and use push navigation for dialogs

* Remove schedule badges and fix dialog safe area padding

* fix: deduplicate server health toasts with stable IDs

* fix: restore Enabled/Paused status badges on schedule jobs

* refactor: consolidate url state hooks and add shared test utilities
2026-06-07 13:02:56 -04:00
Chris Scott ec7a47dc10 feat: replay session statuses on upstream reconnect and add compact type (#268) 2026-06-06 23:02:48 -04:00
Chris Scott 95ae584f6a feat: interactive task list checkboxes in markdown preview (#267)
* feat: interactive task list checkboxes in markdown preview

* fix: persist markdown checkbox toggles

* fix: sync optimistic markdown checkbox state

* fix: align markdown checkbox preview state

* fix: prevent "0" rendering in file browser header when repoId is 0
2026-06-06 22:11:49 -04:00
Chris Scott ac3cfc32f9 fix: allow editing in config editor without clearing search first (#265) 2026-06-06 18:16:13 -04:00
Chris Scott bcabcc145a fix: derive session active state from server status and incomplete assistant, not last user message 2026-06-06 16:02:10 -04:00
Chris Scott 468e2f5dfb refactor: derive session active state from messages instead of status store (#264)
* refactor: derive session active state from messages instead of status store

* refactor: remove duplicate session.updated handler from EventContext
2026-06-06 15:50:13 -04:00
Chris Scott d6bc1d7b69 fix(parts-batcher): defer operations when target message is missing from cache (#262)
* fix(parts-batcher): defer operations when target message is missing from cache

* fix(parts-batcher): add TTL for deferred operations to prevent repeated invalidations
2026-06-06 13:07:32 -04:00
Chris Scott 5dc95dc3f4 Merge branch 'refactor/sse-perf-hardening'
# Conflicts:
#	frontend/src/hooks/useSessionAgent.ts
2026-06-06 11:38:05 -04:00
Chris Scott a87ae2db9c Revert "fix: preserve session selection on reconnect (#261)"
This reverts commit fdeffeaab7.
2026-06-06 11:34:50 -04:00
Chris Scott d57a3b5810 fix: skip unnecessary model store subscriber notifications on no-op variant changes 2026-06-06 11:29:58 -04:00
Chris Scott 3b492c7e78 fix: resolve TS error on messages.length type narrowing when loading 2026-06-06 11:21:20 -04:00
Chris Scott 10275442ec refactor(sse): add sse-frame utility and refine SSE hardening 2026-06-06 11:11:10 -04:00
Chris Scott 12b7387e11 refactor(sse): harden SSE with queue-based writer, backpressure, and directory-aware batching
- Replace promise-chaining SSE writer with queue-based pump with MAX_QUEUED_FRAMES backpressure
- Make frontend parts batcher directory-aware with (sessionID, directory) composite key
- Add session content versioning for reliable content change detection
- Add TOOLS_CACHEBUST arg for selective Docker cache invalidation
- Add docker-upgrade.sh modes (cached/tools/full)
- Fix plugin install timeout and spawn error handling
- Fix assistant session endpoint path and ordering params
2026-06-06 11:11:10 -04:00
Chris Scott fdeffeaab7 fix: preserve session selection on reconnect (#261)
Preserve the user's selected session agent/model/variant across
reconnect cycles. Previously, background refetches (triggered on
reconnect) would clear the stored session agent and fall back to
the default agent.

- Restore stored session agent during initial message loading instead
  of falling back to the default agent unconditionally
- Remove isFetching from the early-return guard so background
  refetches preserve the cached message-derived configuration
- Track user model/agent overrides per session to prevent reconnect
  sync from overwriting manual selections
- Add shared formatModelKey() utility to eliminate repeated inline
  providerID/modelID construction across the codebase
- Remove unused getSessionAgentFromMessages export
2026-06-06 10:57:30 -04:00
Chris Scott 5b7e56ccda fix: align Home button size and position in RepoQuickSwitchSheet 2026-06-05 18:45:22 -04:00
Chris Scott a311cdbb98 fix(assistant): replace unbounded listSessions fallback with paginated lookup 2026-06-05 18:34:15 -04:00
Chris Scott 51ebfabb3d fix(assistant): remove stale localStorage cache read in session launcher 2026-06-05 18:27:36 -04:00
Chris Scott cc89a524c4 fix(schedules): clean up orphaned schedule records when repo is deleted (#255)
* fix(schedules): clean up orphaned schedule records and add schedule URL state management

* refactor(schedules): consolidate schedule tab state into useScheduleUrlState

* fix(schedules): cascade delete schedule runs/jobs and preserve assistant schedules in orphan cleanup

* refactor(schedules): replace deleteJobsByRepo with prepareRepoDelete, add lightweight ID query, remove dead mock

* refactor(schedules): consolidate PromptTemplateDialog form state into single object
2026-06-05 18:07:25 -04:00
Chris Scott 70cb62b77b feat(schedules): support scheduling jobs for the Assistant workspace (#254)
* feat(schedules): support scheduling jobs for the Assistant workspace

* refactor(schedules): extract assistant repo constants, rename workspace to schedule-target

* feat(navigation): add schedules link to session drawer menu

* fix(schedules): document Assistant repoId=0 in generated schedule-management skill
2026-06-05 11:16:31 -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 ce4fd6e22b fix(settings): wire up version dialog button in ServerHealthStatus (#253)
* fix(settings): wire up version dialog button in ServerHealthStatus

* fix(settings): render VersionSelectDialog outside outer Dialog to prevent nesting issues

* fix(settings): use portal + guarded close for version dialog to prevent Radix nesting issue

* fix(settings): replace portal workaround with direct VersionSelectDialog render

Remove the createPortal + useRef guarded-close pattern for the version
dialog (introduced to work around Radix nesting issues). Instead render
VersionSelectDialog directly inside the Dialog and prevent outside
interactions via onInteractOutside/onFocusOutside/onPointerDownOutside
preventDefault. Delete the obsolete VersionSelectContent component.
2026-06-05 08:51:01 -04:00
Chris Scott 0d6419aa16 feat(settings): replace config card grid with single-select dropdown (#251)
* feat(settings): replace config card grid with single-select dropdown

Redesign the OpenCode config list from a 2-column card grid to a single-select dropdown with adjacent action buttons (download, edit, set-current, delete) and the New Config button in the same row.

Remove stale New Config buttons from ServerHealthStatus and the OpenCodeConfigManager health card section.

* feat(settings): add find-in-text search for config editor
2026-06-04 23:31:47 -04:00
Chris Scott 2b2cb6d23d feat(stt): add energy-based VAD with silence gate and auto-stop (#249)
* loop: stt-warmup completed after 6 iterations

* refactor: extract STT startup helpers and simplify audio recorder

* feat(stt): add energy-based VAD with silence gate and auto-stop

- New VoiceActivityDetector class: adaptive noise floor, per-frame RMS
  classification, trailing-silence endpointing, configurable thresholds
- AudioWorkletProcessor computes RMS in existing flush loop and posts
  {samples, rms} instead of a bare Int16Array
- AudioRecorder integrates VAD via handleVadFrame() in both worklet and
  ScriptProcessor paths; auto-calls stop() on trailing silence; silence
  gate in processRecording() fires onNoSpeech instead of sending empty
  audio to the transcription API (fixes Whisper hallucination bug)
- useSTT wires setOnNoSpeech to reset isProcessing/isRecording cleanly
  without surfacing an error
- computeRms() exported helper for ScriptProcessor fallback path

* fix(stt): clear processing state when stopping a silent recording

stopRecording() called recorder.stop() before setIsProcessing(true). For
a silent take the recorder synchronously fires onNoSpeech (which sets
processing false), so the subsequent setIsProcessing(true) won and the
voice overlay was stuck in the processing state forever.

Set processing before stop() so the recorder callback (onNoSpeech or
onDataAvailable) has the final say on the processing flag.

* fix(stt): always emit a terminal signal so the voice overlay never sticks

Two remaining stuck paths after the silent-stop fix:

- processRecording() early-returned without firing onNoSpeech when a take
  had no captured audio (e.g. a quick start/stop under one worklet flush,
  totalSamples === 0). Now any non-emitting path (empty audio or no
  detected speech) fires onNoSpeech, while a genuine abort still returns
  silently.
- stopRecording() set isProcessing true even when the recorder was no
  longer recording (double-stop or post auto-stop), where stop() skips
  processRecording entirely and nothing clears the flag. Guard the
  external path on recorder state before entering processing.

* loop: mediarecorder-stt completed after 6 iterations

* refactor(stt): extract shared helpers and cleanup

* refactor(stt): add separate arm/disarm thresholds for voice swipe

* fix(stt): prevent default touch behavior on voice gesture handlers

* feat(stt): add audio-level speech detection before emitting data
2026-06-02 12:30:33 -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 626a4c42d1 feat(notification): rich notification content with shared format helpers (#245)
* loop: notification-format completed after 2 iterations

* refactor: deduplicate permission display logic into shared package
2026-05-31 13:07:04 -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