Den 30be6636c2 feat(diagnostics): active connect-failure triage + Sentry + in-app share (#2)
* feat(diagnostics): active connect-failure triage + Sentry + in-app share

Replaces the opaque "Connection Failed" / "Network request failed" dead-end
with on-device diagnostics that classify *why* a connect attempt failed.

On failure (quick connect and edit-connection test), the app now:
- runs parallel probes: target /global/health, target root, and a public
  204 endpoint (internet reachability check)
- classifies the cause: malformed-url, no-internet, server-unreachable,
  health-failed, tls-error, timeout
- shows a plain-English summary + a "Share report" button that copies a
  full report (target URL, per-probe results w/ error.cause, device/app
  info, recent log ring-buffer) to the clipboard and opens the share sheet
- captures the same structured context to Sentry (auto-upload), gated on
  EXPO_PUBLIC_SENTRY_DSN so dev/CI builds work without secrets

New: src/lib/logbuffer.ts (ring buffer + logger), src/lib/diagnostics.ts
(regex URL parse — Hermes URL is incomplete — probe + report + share),
src/lib/sentry.ts (no-op-without-DSN wrapper, scrubs basic-auth from URLs).

Wired Sentry.wrap around RootLayout and initSentry() at module load.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ci(sentry): wire Sentry DSN + source-map upload env into build; bump to 0.2.2

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 17:07:44 -07:00

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

  1. Start OpenCode in server mode on your machine:

    OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096
    
  2. 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

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
No description provided
Readme 17 MiB
Languages
TypeScript 49%
Python 20.5%
HTML 18.9%
JavaScript 8.8%
Kotlin 1.2%
Other 1.6%