24667ee4f4569813c95a87f5e6523de95748677f
Adds full-stack crash capture so any unexpected failure — React render,
uncaught JS exception, unhandled promise rejection, or native — is
reported to Sentry with rich, scrubbed context. Expected operational
errors (timeouts, biometric cancel, etc.) stay local to preserve signal.
Changes:
- src/lib/sentry.ts: explicit native crash handlers, release/dist tags
from app.json, beforeSend/beforeBreadcrumb URL+secret scrubbing,
addBreadcrumb/captureException helpers, ErrorUtils + onunhandledrejection
wrappers that always feed the in-memory log buffer (so offline Share
Report includes the crash too).
- src/components/ErrorBoundary.tsx: new app-wide React boundary with a
dark recovery screen — error message, top stack/component frames,
Share Report (clipboard + native share sheet) and Try Again.
- src/lib/diagnostics.ts: buildCrashReport() reuses the existing
DiagnosticReport pipeline so crashes and connect failures share one
UI and one transport.
- _layout.tsx: wraps app in ErrorBoundary; emits app.lifecycle
breadcrumb at startup.
- stores/{connections,events,sessions}.ts: high-signal breadcrumbs at
connect, SSE connect/disconnect/reconnect, and session select.
- (tabs)/settings.tsx: fix unhandled promise on notificationsGranted().
- app.json: bump expo.version to 0.2.3.
- docs/prd.md, docs/tdd.md: new product + technical design docs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OpenCode Mobile
A React Native / Expo app for connecting to OpenCode servers from your phone.
Features
- Multiple Connection Types: Connect via local network, tunnels (Cloudflare/ngrok), or cloud-hosted instances
- Secure Authentication: Biometric authentication (Face ID/Touch ID) support
- Session Management: View, create, and manage coding sessions
- Real-time Chat: Stream responses from your AI assistant
- File Diff Viewer: See what changes were made to your code
Getting Started
Prerequisites
- Node.js 18+
- Bun (recommended) or npm
- Expo Go app on your phone (for development)
Installation
# From the monorepo root
cd packages/mobile
bun install
# Start the development server
bun start
Connecting to OpenCode
-
Start OpenCode in server mode on your machine:
OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096 -
Open the app and add a connection:
- Local Network: Use your machine's local IP (e.g.,
http://192.168.1.100:4096) - Tunnel: Set up a Cloudflare Tunnel or ngrok and use the tunnel URL
- Cloud: Connect to a hosted OpenCode instance
- Local Network: Use your machine's local IP (e.g.,
Building for Production
iOS
bun run ios
# or
eas build --platform ios
Android
bun run android
# or
eas build --platform android
Security
- Credentials are stored securely using
expo-secure-store(iOS Keychain / Android Keystore) - Optional biometric authentication for app access
- Optional biometric confirmation for sending messages
- All traffic should use HTTPS for non-local connections
Architecture
packages/mobile/
├── app/ # Expo Router screens
│ ├── (tabs)/ # Tab navigation
│ ├── session/ # Session screens
│ └── connection/ # Connection management
├── src/
│ ├── components/ # Reusable components
│ ├── hooks/ # Custom hooks
│ ├── lib/ # SDK client & types
│ └── stores/ # Zustand state stores
└── assets/ # App icons & images
Contributing
This is part of the OpenCode monorepo. See the root README for contribution guidelines.
Description
Languages
TypeScript
49%
Python
20.5%
HTML
18.9%
JavaScript
8.8%
Kotlin
1.2%
Other
1.6%