Launch bug: harden Portal terminal connection state and xterm lifecycle #12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Launch bug
Portal console/terminal can still be flaky and occasionally hangs on
Connecting....Repo review confirms this does not look like an Agent language/runtime issue. Most of the console lifecycle architecture is already present:
zpack-portaluses@xterm/xtermand@xterm/addon-fitTerminalView.tsxhas WebSocket open/message/close/error handlersfile already closedand/dev/ptmxServerConsole.tsxgates streaming by game connectability / dev agent-online stateLikely remaining issue
The hang appears to be a frontend connection-state trap rather than missing terminal architecture.
Observed risk from Portal code:
ServerConsole.tsxcan leaveisStreaming=truewhileconnectionStatusiserror,closed, or stuck atconnecting.Connecting...and stay disabled even after the WebSocket path failed.TerminalView.tsxavoids opening a new socket if the current socket isOPENorCONNECTING, but there is no obvious connect/open timeout to force-close a staleCONNECTINGsocket.errorpath should aggressively close/clear the current socket and sender callback instead of relying on a cleancloseevent.Required launch-safe fix
Add a WebSocket connect timeout in
TerminalView.tsx.open, close it, clearsocketRef, callonSend(null), and emitonStatus("error")oronStatus("closed").Harden the WebSocket error path.
Reset
isStreaminginServerConsole.tsxwhen terminal status becomes:closederroridleMake the button recoverable.
Connecting....Open ConsoleorReconnect.Consider a backend/Agent ready semantic later.
openas connected, but that only proves Browser ↔ API opened.console_ready/terminal_attachedframe when API ↔ Agent and Agent ↔ console/session are actually attached.xterm/addon notes
Current addons:
Not currently using:
Do not add
addon-attachas an automatic fix. The custom WebSocket layer is intentional because it handles auth, reconnect, buffering, stale session handling, and Portal status callbacks.Launch expectation
This is a targeted Portal terminal reliability fix. Do not rewrite the Agent or switch languages for this issue.