Skip to content

[codex] Fix Android dashboard simulator issues#4

Merged
adrienlacombe merged 4 commits into
masterfrom
codex/android-dashboard-simulator-fixes
May 25, 2026
Merged

[codex] Fix Android dashboard simulator issues#4
adrienlacombe merged 4 commits into
masterfrom
codex/android-dashboard-simulator-fixes

Conversation

@adrienlacombe

Copy link
Copy Markdown
Owner

Summary

  • Fix Android desktop stream WebSocket URL construction so query parameters are built on HTTP(S) before converting to WS(S).
  • Fix Android Files screen to operate from the backend workspace root with relative child paths.
  • Fix Android Terminal send path by emitting required tagged WebSocket frames, avoiding stale socket sends, supporting IME Send, and normalizing PTY control output.
  • Add an executable Android simulator test plan with failure classification and investigation logging.
  • Ignore generated Android simulator run artifacts.

Root Cause

The latest simulator run exposed multiple client/backend contract issues: Desktop passed a wss:// URL into OkHttp's HTTP URL builder, Files attempted writes under /, and Terminal frames omitted the backend-required t discriminator because kotlinx serialization omitted default-valued fields.

Validation

  • ./gradlew :app:assembleDebug :app:testDebugUnitTest :app:lintDebug
  • Manual simulator run on Pixel_10_Pro_API36_1 / Android API 36.1 Google Play image.
  • Verified terminal command echo appears in UI dump after fixes.
  • Verified Files test folder creation and cleanup.
  • Verified final app-specific logcat check has no sh.sandboxed.dashboard crash/ANR markers.

Notes

Remaining non-app blockers from the remote backend run:

  • Mission execution is blocked by backend configuration: selected Claude backend reports missing claude CLI / no npm or bun in workspace.
  • Desktop reaches the backend correctly, but the backend reports display :101 unavailable.

@adrienlacombe adrienlacombe requested a review from Copilot May 25, 2026 16:21
@adrienlacombe adrienlacombe marked this pull request as ready for review May 25, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Android emulator/simulator regressions by aligning the Android dashboard client with backend contracts for Desktop streaming, Files operations, and Terminal WebSocket framing, and by adding a repeatable simulator test procedure.

Changes:

  • Fix Desktop stream WebSocket URL construction by building query parameters on an HTTP(S) URL before converting to WS(S).
  • Update Files to start at the backend workspace root (.) and add a navigation back-stack plus safer child path construction.
  • Update Terminal WebSocket behavior to always emit tagged frames, avoid sending on stale sockets, support IME Send, and normalize PTY output; add a simulator-focused test plan and ignore run artifacts.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
android_dashboard/TEST_PLAN.md Adds a detailed, artifact-driven Android emulator test plan to reproduce and classify simulator failures.
android_dashboard/app/src/main/java/sh/sandboxed/dashboard/ui/terminal/TerminalScreen.kt Improves terminal UX (IME send, send button gating) and normalizes output handling; updates submit behavior on failed sends.
android_dashboard/app/src/main/java/sh/sandboxed/dashboard/ui/files/FilesScreen.kt Moves file operations to workspace root (.), adds up-navigation via back-stack, and adjusts mkdir child path handling.
android_dashboard/app/src/main/java/sh/sandboxed/dashboard/data/api/TerminalSocket.kt Fixes terminal frame serialization to always include the required t discriminator and adds stale-connection protection.
android_dashboard/app/src/main/java/sh/sandboxed/dashboard/data/api/DesktopStreamSocket.kt Fixes URL building to avoid feeding ws(s):// into toHttpUrl() while preserving query params.
.gitignore Ignores generated Android simulator run artifacts under android_dashboard/test-artifacts/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

android_dashboard/app/src/main/java/sh/sandboxed/dashboard/ui/files/FilesScreen.kt:112

  • In refresh(), the fallback branch sets error = "Could not open ..." and then immediately calls refresh() again. Since refresh() starts by clearing error (it.copy(loading = true, error = null)), the fallback message can be dropped before Compose observes it (state updates may be conflated), so the user may never see why they were redirected to workspace root. Consider surfacing this as info (or a one-shot UI event) and/or avoid clearing error when refresh() is invoked as part of the fallback path.
                .onFailure { e ->
                    // Fall back to "." once if the requested path can't be opened (e.g. server returns
                    // 500 because the directory doesn't exist on this install).
                    if (path != ".") {
                        _state.update { it.copy(path = ".", backStack = emptyList(), error = "Could not open $path — falling back to workspace root") }
                        refresh()
                    } else {
                        _state.update { it.copy(error = e.message, loading = false) }
                    }

@adrienlacombe adrienlacombe merged commit 2c80f04 into master May 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants