Commit Graph

23 Commits

Author SHA1 Message Date
5a89f46e3d fix: replace per-path proxy with cookie-based catch-all routing
The /session/{id} URL prefix collided with OpenCode's internal
/session/{slug} SPA routes, causing a blank page. Now /c/{id} is
a thin entry point that sets a session cookie and redirects to /,
where the SPA loads at root with its router working correctly.

This also replaces ~50 individual per-path proxy route handlers
with a single /{path:path} catch-all, and simplifies the Caddyfile
from ~180 lines to ~17.
2026-02-16 10:40:17 +01:00
9683cf280b fix: add SSE streaming proxy and robust make try startup
The SSE proxy was buffering the entire response body with a 30s read
timeout, causing 504s on the OpenCode /global/event stream. Add a
streaming path that detects SSE requests (by Accept header or /event
path) and returns a StreamingResponse with no read timeout.

Also fix the make try target to poll the health endpoint for Docker
readiness and wait for the container to reach running status before
opening the browser.
2026-02-16 00:38:57 +01:00
fb2c1f0c60 fix: make try target auto-starts stack and uses correct API paths
The try and session targets were hitting /sessions directly instead of
/api/sessions (Caddy strips the /api prefix before proxying). Also, try
now depends on up and waits for health check before creating a session.
2026-02-16 00:18:34 +01:00
217d41d680 test: strengthen Cypress e2e tests with real API assertions
- Remove blanket uncaught:exception suppressor (API-only tests)
- Trim smoke test to single infra-verification assertion
- Rewrite health test with strict status/field assertions, no failOnStatusCode
- Add session CRUD tests (create, get, list, delete, 404 cases, cleanup)
- Use Cypress.env('API_URL') instead of baseUrl to avoid blocking smoke tests
- Remove unused main and type fields from package.json
2026-02-15 23:57:48 +01:00
991080ae2b test: add initial Cypress e2e test infrastructure
Smoke tests for verifying Cypress runs, plus basic API tests
for health and sessions endpoints.
2026-02-15 23:05:56 +01:00
3feedd5698 consolidated readme 2026-02-08 20:27:35 +01:00
eb8553ce0b security: lock down OpenCode containers to read-only legal research
Add defense-in-depth restrictions via agent config and global permissions:
- Global permission layer denies bash, edit, webfetch, lsp
- Build agent tools restricted to read-only (grep/glob/list/read/todo)
- General/explore subagents locked to read-only
- Plan agent disabled to prevent mode switching
- Custom system prompt for legal research context (temp=0.2)
2026-02-08 20:22:57 +01:00
7dae8faf62 security: fix timing attack vulnerability and incorrect method call
- Use secrets.compare_digest() for token comparison instead of == to
  prevent timing-based attacks that could leak token information
- Fix rotate_session_auth_token() to call the correct method
  rotate_session_token() instead of non-existent rotate_session_auth_token()
2026-02-05 00:36:07 +01:00
2cb5263d9e feat: add comprehensive OpenCode API endpoint proxies
Added proxy routes for all OpenCode internal API endpoints to support
full application functionality when accessed via session manager:
- project, agent, config, model endpoints
- thread, chat, conversation endpoints
- command, mcp, lsp, vcs endpoints
- permission, question, event, status endpoints
- internal session endpoint (distinct from container sessions)

Also updated Caddyfile for routing configuration.
2026-02-05 00:33:58 +01:00
d6f2ea90a8 fix: add missing _get_container_info method to AsyncDockerClient
docker_service.get_container_info() was calling self._docker_client._get_container_info()
but AsyncDockerClient didn't have this method, causing silent AttributeError and
returning None, which triggered false health check failures.

Added _get_container_info() using aiodocker's container.show() to properly retrieve
container state information for health monitoring.
2026-02-04 22:04:29 +01:00
69d18cc494 fix: session stability improvements
- Fix docker client initialization bug in app.py (context manager was closing client)
- Add restart_session() method to preserve session IDs during container restarts
- Add 60-second startup grace period before health checking new sessions
- Fix _stop_container and _get_container_info to use docker_service API consistently
- Disable mDNS in Dockerfile to prevent Bonjour service name conflicts
- Remove old container before restart to free port bindings
2026-02-04 19:10:03 +01:00
05aa70c4af connected zen 2026-02-03 00:36:22 +01:00
9281c0e02a refactored the big main.py file 2026-02-03 00:17:26 +01:00
5e1cb64a81 wp on webui 2026-02-02 23:37:11 +01:00
ce24e0caa0 claude.md 2026-02-01 19:40:55 +01:00
0ff43b1a9c gitignore 2026-01-18 23:29:12 +01:00
7a9b4b751e docker related 2026-01-18 23:29:04 +01:00
2f5464e1d2 fixed all remaining issues with the session manager 2026-01-18 23:28:49 +01:00
0243cfc250 work with session manager etc 2026-01-18 22:10:03 +01:00
165d87899d debuged python docker client issue 2026-01-18 20:01:23 +01:00
fa2d278c79 fixed findings from review 2026-01-18 19:15:33 +01:00
f76328b621 phase 1 2026-01-18 19:07:20 +01:00
93da0b117e first attempts 2026-01-18 19:03:38 +01:00