Fix subagent crash and add external OpenCode server support (#188)

* 🐛 Fix UI crash when subagent is active

Remove sessions dependency from hooks to prevent cascading re-renders.
Use getState() instead and switch to getGlobalSessionStatus().

*  Add support for connecting to external OpenCode server

Add OPENCODE_SKIP_START env var to skip starting embedded server.
Use OPENCODE_PORT to connect to existing OpenCode instance.
Update help text to document the new environment variables.

* 📝 Document external OpenCode server support

Add OPENCODE_PORT and OPENCODE_SKIP_START to READMEs.
Update AGENTS.md with external server integration notes.

*  Add URL-based routing for shareable session links

- Add react-router-dom dependency
- Create URL store for bi-directional sync with Zustand
- Add WebRouter/DesktopRouter context for runtime-aware routing
- Add useURLSync hook to sync URL with session/tab state
- Add useNavigation hook with copySessionLink utility
- Add share button in Header for copying session links
- Update App.tsx to use router wrappers

URL structure:
  /session/:sessionId?tab={chat|git|diff|terminal|files}&directory=/path
  /settings

This enables shareable links and deep-linking to specific sessions.

* Revert " Add URL-based routing for shareable session links"

This reverts commit b53ee304950a789538fa3d4a236d6361e634ea61.
This commit is contained in:
Taylor Beeston
2026-01-22 18:32:04 +02:00
committed by GitHub
parent 1937dbfcd2
commit 5fabc88f9e
7 changed files with 68 additions and 35 deletions
+1
View File
@@ -41,6 +41,7 @@ All scripts are in `package.json`.
- SSE hookup: `packages/ui/src/hooks/useEventStream.ts`
- Web server embeds/starts OpenCode server: `packages/web/server/index.js` (`createOpencodeServer`)
- Web runtime filesystem endpoints: search `packages/web/server/index.js` for `/api/fs/`
- External server support: Set `OPENCODE_PORT` and `OPENCODE_SKIP_START=true` to connect to existing OpenCode instance
## Key UI patterns (reference files)
- Settings shell: `packages/ui/src/components/views/SettingsView.tsx`