Repository navigation
Open
Labels
androidPrimary Android workenhancementNew feature or requestiosPrimary iOS worksharedShared or cross-platform implementationtodoPlanned scope with no implementation started
Description
Why
Terminals on mobile die whenever the app goes to background or the connection drops. OpenCode 2.x now has persistent PTYs that survive client disconnects (anomalyco/opencode#52760), so the app can reattach instead of losing the shell.
Current state
- No
/api/experimental/persistent-pty/*calls on either platform. capabilities.persistentPtyfrom/api/infois not read.- Android:
data/remote/PtyApi.kt,domain/terminal/TerminalConnectRequest.kt(5ab410b only fixed query encoding). iOS: no persistent-pty code found.
Upstream API (origin/dev, v2 openapi)
GET|PUT|DELETE /api/experimental/persistent-pty/{ptyID}(info / update / kill)GET /api/experimental/persistent-pty/{ptyID}/snapshot(scrollback to restore on reattach)POST /api/experimental/persistent-pty/{ptyID}/connect-token+GET .../{ptyID}/connect(WebSocket attach)POST /api/experimental/persistent-pty/handoff(returns{directory, instanceID, ticket, expiresAt})POST /api/experimental/persistent-pty/shutdown- Schemas:
PersistentPty.Info,CreateInput,UpdateInput,Snapshot,ReadResult,Handoff
Tasks
- Read
capabilities.persistentPtyand gate the feature (v1 and older 2.x keep current PTY behaviour) - Remote client for persistent-pty routes (Android + iOS)
- Create terminals as persistent when supported; keep
ptyIDper session/project - On foreground/reconnect: fetch snapshot, render scrollback, then reattach via connect-token + connect
- Terminal list shows surviving persistent terminals; explicit kill uses DELETE
- Investigate handoff (desktop <-> mobile) and whether the app should ever call shutdown
- Tests for reattach after background/network loss
Routes are experimental; expect churn. Tracked in the OpenCode tracker inventory as "Persistent terminals: not done" (also listed under nice-to-have in #546 / OPE-272).
Metadata
Metadata
Assignees
Labels
androidPrimary Android workenhancementNew feature or requestiosPrimary iOS worksharedShared or cross-platform implementationtodoPlanned scope with no implementation started
Activity