Repository navigation
Description
Problem
On a Fly instance (Sprites runtime), the OpenCode login connects and starts the CLI, but its provider menu ("Connect an integration") is unreadable in the dashboard's login terminal:
- every character appears on its own line;
- fragments of ANSI escape sequences show as text, e.g.
[90m,[39m,[36m, split across lines.
So the provider can't be chosen and the login can't be completed. Seen on 2026-11-29 on propr-dev-3868, epic head with #3865 and #3886, OpenCode CLI 2.4.2: "Connected to Sprite propr-…", then ┌ Connect an integration, then one glyph per line.
On the same instance, the Claude and Codex logins render correctly and complete. Sprites logins already use a 1000-column PTY (spritesLogin.ts, REMOTE_LOGIN_COLUMNS), so terminal width is unlikely to be the cause.
Likely cause (to confirm)
OpenCode's prompt UI (clack-style) redraws with cursor movement and SGR sequences, and Sprites' exec stream seems to deliver it in very small frames, sometimes one character each. Two things may be going wrong in the login output path:
- Chunks are rendered as lines. Each output chunk is appended as a new line instead of being concatenated into the terminal stream.
- The sanitizer runs per chunk.
sanitizeTerminalChunk(or equivalent) sees an escape sequence split across chunks, removes the lone ESC, and leaves[90mas text.
The Docker login path may buffer output differently, which would explain why the problem appears only on Sprites. Check whether Docker OpenCode logins render correctly today.
Expected
The OpenCode login renders the same on Sprites as on Docker. The provider menu is readable, the ↑/↓/Enter terminal keys move and select, and the login completes and saves credentials under .config/opencode.
Suggested shape:
- Keep a per-session decoder that carries incomplete UTF-8 and incomplete escape sequences over to the next chunk before sanitizing.
- Render the stream as a terminal (concatenating chunks and honoring CR and cursor moves, or at least collapsing redraws), not one chunk per line.
Acceptance
- Unit tests: an SGR sequence split across chunks (
\x1b|[90m) and a one-character-per-chunk stream render identically to the same output in one chunk. CR-redrawn menu lines collapse. - Live on Fly (Sprites): the OpenCode login shows a readable provider menu, a provider can be chosen with the terminal keys, and the agent shows Ready. Re-check the Claude, Codex and Vibe logins for regressions.
Activity
propr-dev commentedon Nov 29, 2026
🤖 AI processing has started for this issue using codex agent with gpt-6.2-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-6.2-sol3896/gpt-6.2-sol-sprites-opencode-login-me-20261129-2303-5pw3758-epic-runtime-abstraction-sc0issue-3896-20261129-2303-gpt-6.2-sol-5pw🔍 Track Task Execution
fix: fix OpenCode login menu rendering by setting PTY size
[3896 by GPT-6.2 Sol] Sprites: OpenCode login menu renders one charac…