Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Internals

Crates

To build the rustdoc documentation locally:

cargo doc --workspace --no-deps --document-private-items

Key UI source files

For the core Rust source files, see Architecture.

FilePurpose
opencode-ui/packages/app/src/context/devaipod.tsxPod management context
opencode-ui/packages/app/src/pages/pods.tsxPod management page
opencode-ui/packages/app/src/context/workspace-terminal.tsxWorkspace PTY client
opencode-ui/packages/app/src/pages/session/git-review-tab.tsxGit diff review
opencode-ui/packages/app/src/pages/session/terminal-panel.tsxAgent/Workspace terminal tabs
opencode-ui/packages/app/src/utils/devaipod-api.tsisDevaipod(), apiFetch, error reporting

Testing

Rust unit tests (cargo test): ~274 tests covering web.rs routing, proxy behavior, pod configuration, git operations. Run via just test-container.

Bun unit tests (bun test with happy-dom): 46 existing test files. Covers devaipod-specific modules like utils/devaipod-api.ts (apiFetch, error reporting), context/workspace-terminal.tsx (session lifecycle), and pages/session/terminal-label.ts (kind prefix formatting).

Rust integration tests (cargo test -p integration-tests): verify HTTP endpoints, auth, static files, and proxying using curl inside a running devaipod container.

Playwright E2E tests (bun test:e2e): 33 existing specs. For devaipod features, the SPA can be served directly from the pod-api sidecar — no cookie injection needed since VITE_DEVAIPOD=true enables all devaipod code paths at build time.

Notable discoveries

  • exec_in_container has ~200-500ms overhead per call through the podman VM on macOS — this motivated creating the pod-api sidecar.
  • SELinux is enforcing on the podman machine VM; the api container needs label=disable for the podman socket.
  • GlobalSDKProvider does NOT react to URL changes — it reads server.url once at init time. This is why iframe removal is deferred (see the todo).
  • SolidJS createEffect reactive tracking — async functions reading store properties inside createEffect cause accidental tracking loops; must wrap in untrack().
  • Each pod on its own origin naturally isolates localStorage, eliminating the need for monkey-patching approaches.