Skip to content

fix(mobile): show Codex async decision cards and compose replies - #20074

Closed
jakeparkcolde wants to merge 2 commits into
stablyai:mainfrom
jakeparkcolde:jakeparkcolde/mobile-codex-decisions
Closed

jakeparkcolde wants to merge 2 commits into
stablyai:mainfrom
jakeparkcolde:jakeparkcolde/mobile-codex-decisions

Conversation

@jakeparkcolde

@jakeparkcolde jakeparkcolde commented Sep 11, 2026 •

Copy link
Copy Markdown

ELI5

Codex can ask questions while it keeps working. Orca mobile now shows those questions and choices in a card. Add to message puts the selected answers into the message box while preserving the existing draft; the user reviews and sends the message normally. Dismiss closes the mobile card locally.

What Changed

  • Recognize request_user_input_async titles, string options and title-only questions from loaded Codex transcripts, after the matching assistant completion confirms that Codex displayed them.
  • Keep the card through immediate {"accepted":true} results, unrelated tool activity and settled replay; a new user message clears the local projection.
  • Reuse the mobile question wizard and existing composer. Separate async draft composition from blocking selector delivery, including cancellation and send-error handling.
  • Key dismissal by call identity, and reject stale callbacks after prompt/session changes. A previous sticky blocking prompt cannot prevent the displayed async card from dismissing.
  • Exclude async calls from the shared blocking-question parser, so object-shaped inputs cannot accidentally receive selector keys.

Why

The missing card is reproducible on main. Codex 0.153.4's async handler emits an assistant item and returns immediately; its questions use title and optional string options. It does not use the pending JSON-RPC request or blocking TUI selector lifecycle of request_user_input.

The installed 1.4.188 bundle and current main already decode the ordinary assistant text. This change adds the missing mobile decision surface, without claiming that the whole transcript was blank.

Linked Issue

Refs #20073

Visual Proof

Before After
Before After

Selected answers appended to the existing draft

These show the real mobile prompt components mounted in an isolated React Native Web harness at 390×844. The before build uses the base prompt hook. The harness disables transport; it is not an iOS/Android or paired-device screenshot.

Testing

  • Automated tests added/updated
  • Manually tested on an actual mobile device

All commands used ORCA_BACKGROUND_LAUNCH=1 where applicable.

  • Root focused Vitest: 4 files, 43 tests passed — shared ask parser/FIFO and Codex hook question lifecycle.
  • Mobile focused Vitest: 13 files, 164 tests passed — decoder→mobile sanitizer→card projection, immediate acceptance, concurrent tools, replay/page boundary, new-user answer, repeated call identity, draft preservation, no async digit/Escape delivery, stale-session callback, existing controller and blocking-answer behavior, plus the new upstream live-turn indicator/view suites.
  • Added integrated prompt/dismissal regressions for sticky blocking status during working and done, including reconnect retention. Both assertions failed before the correction and pass afterward.
  • Targeted strict TypeScript check of the changed parser/action/prompt/dismissal modules passed.
  • Changed-file root/mobile oxlint, max-lines rules, formatting and git diff --check passed.
  • Headless Chromium click flow selected a non-default option and free text, then verified the preserved draft; no page errors.

GitHub PR/Mobile checks currently require approval to run for this external contribution; no full-CI success is claimed. Full workspace typecheck, build and full test suite were not run. Validation used a bounded temporary dependency set (Vitest 4.1.11, TypeScript 6.0.3) because this is a sparse checkout with limited disk space; the local pnpm launcher also fails before execution. Changed JSX/controller behavior has component/controller and browser coverage, not a full Expo typecheck.

AI Disclosure

OpenAI Codex (GPT-6 Astra) assisted with investigation, implementation, tests and review.

Author

GitHub: @jakeparkcolde. X/Twitter handle not supplied.

Review

Self-review found no new platform-specific path/keyboard behavior, RPC method, stream opcode, host status producer, auth/permission policy, or git-provider dependency. SSH/local/folder-workspace behavior uses the existing transcript and draft paths. Work is linear in the loaded transcript; no background poller or persistent host cache is added. Existing mobile theme tokens and the existing question wizard are reused. Async card actions perform no network write and cannot clear a prior send-failure banner as if an answer had been delivered.

Coordinator reviewed the final diff, test output and visual artifacts; actual device/transport verification and full workspace CI remain pending. Latest commit: d17acefc20ef6a748bf952b23d60ff6776b6fd49, based on upstream fab78c766952404a1296d519a1dd76df6ed8d12e. The overlap with #19977 was resolved by reusing its new useMobileBridgeChatPromptWrites hook. An additional independent review found and verified the sticky-status dismissal correction; its focused rerun passed 42 tests across 5 files, with no remaining blocking finding in the reviewed scope.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material is copied.

Notes

  • Loaded-history limit: mobile initially loads 40 messages. Both the async call and its matching assistant item must be loaded. Older calls require loading earlier history. Invalid/clipped tool input is not converted into a partial card; the existing assistant prose remains the fallback. Tests cover the page boundary and recovery after loading earlier records.
  • Composition only: Add to message prepares a draft; it does not submit an answer or resolve Codex's retained question editor. Actual Codex TUI/paired-network reply delivery, iOS/Android, native desktop, SSH and cross-version device runs remain unverified.
  • A new user message ends the local question projection; this is not a claim that Codex emitted serverRequest/resolved for an async question.
  • Native structured app-server sessions are outside this change. The separate blocking serialized-arguments fallback issue discovered during investigation is not fixed or claimed here.

Checklist

  • Small, focused mobile decision-card improvement
  • Behavior and boundaries explained
  • Before/after attachments uploaded to GitHub
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH/remote and folder-workspace impact considered
  • Full lint/typecheck/test/build CI gates completed

@miguel93041

Copy link
Copy Markdown

@jakeparkcolde I've opened #30062 for the same async-question gap, covering desktop and mobile in both terminal-backed and structured chat. Your issue and this proposal are linked in its description.

The main differences are that pending questions are derived on the host, so they are available outside the loaded history window, and Submit sends through the existing message path instead of adding the answer to the composer draft. The cards offer an Other field, preserve drafts when folded, and other clients remove resolved questions after the host records delivery.

384 focused tests and the build pass; physical-phone and live SSH checks are still pending, and fork CI needs maintainer approval. I'd welcome your review of the mobile behavior, especially the choice to submit directly.

@nwparker

Copy link
Copy Markdown
Contributor

Thank you for this PR. Codex async decision cards on mobile (and desktop) have now landed on main via #31652, which covers what this PR targeted. Since this branch is conflicting, we are closing it as superseded. We appreciate the contribution.

@nwparker nwparker closed this Oct 24, 2026
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.

3 participants