Commit Graph
15 Commits
Author SHA1 Message Date
Chris Scott f7fd3176d4 Refactor SSE event handling and consolidate notification contexts 2026-01-12 23:56:50 -05:00
Chris Scott a6fd795eaa Implement session-level todo state management with inline display 2026-01-04 18:08:09 -05:00
Chris Scott ed4bc17987 add typecheck script and fix TypeScript errors (#48) 2026-01-04 17:11:53 -05:00
b28f069576 Fix/permission request directory (#31)
* 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>
2025-12-27 09:21:45 -05:00
Chris Scott 4fd658fc7d Add diff expansion controls with ContentDiffViewer and CodePreview components 2025-12-26 18:07:33 -05:00
Chris Scott fb430359ce Add todo tool rendering components for task management 2025-12-21 08:51:59 -05:00
OpenCode 722c62f61e Add break-all to tool output for better mobile wrapping 2025-12-14 21:11:21 +00:00
OpenCode 873321b088 Fix tool call status stuck on running and improve mobile code block word-wrap 2025-12-14 20:30:07 +00:00
Chris Scott 2c9782aa53 Update ToolCallPart component styling 2025-12-12 19:36:25 -05:00
Chris Scott 7fdf776b50 Add message queuing and retry handling with status indicators 2025-12-07 23:47:23 -05:00
Chris Scott 3e31dbcdf8 Fix parent/child session navigation for task tool calls 2025-12-06 11:15:09 -08:00
Chris Scott 8c0689eac8 Update UI components and refactor message display 2025-11-29 20:23:45 -05:00
Chris Scott 64e49a8a52 Improve chat UI with scroll management and bash command handling 2025-11-28 17:07:51 -05:00
Chris Scott 9a2ebc9652 Fix mobile chat layout overflow and sticky prompt input 2025-11-27 22:00:36 -05:00
Chris Scott bbf66c259b Initial release v0.2.5 2025-11-23 23:25:27 -05:00