Skip to content

feat(tui): add /app desktop handoff#25638

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/teleport
Jun 3, 2026
Merged

feat(tui): add /app desktop handoff#25638
fcoury-oai merged 2 commits into
mainfrom
fcoury/teleport

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

TL;DR

/app opens the current CLI thread in Codex Desktop on macOS and native Windows.

Why

TUI users should have a quick handoff into Codex Desktop without having to find or reconstruct the current thread manually. Codex Desktop already supports codex://threads/<thread-id> deep links, but the TUI needs a Desktop-specific launch path instead of treating the deep link like a normal web URL.

This also needs to avoid unsupported environments. In particular, a CLI running inside WSL may use a Linux-side Codex home that the Windows Desktop app cannot see. Sharing the Windows Codex home through /mnt/c also appears fragile for SQLite-backed local state, so this PR deliberately hides /app on WSL for now rather than offering a command that can launch Desktop but fail to open the session.

What Changed

  • Add /app to continue the current TUI session in Codex Desktop on macOS and native Windows.
  • Keep /app hidden on WSL and ordinary Linux.
  • Route Desktop handoff through a dedicated app event so normal web links still use the browser path.
  • Open codex://threads/<thread-id> with native macOS open.
  • On Windows, launch the installed OpenAI.Codex packaged app through PowerShell with resources/app.asar and the thread deep link, avoiding the MSIX protocol-handler path that can start Electron without its app bundle.
  • Keep /app available while a task is running.
  • Report a focused TUI error if /app is invoked before the thread id is available.
  • Add slash-command dispatch coverage and snapshots for the command popup, success message, and startup error.

How to Test

  1. On macOS with Codex Desktop installed, start a TUI session and enter /app.
  2. Confirm Codex Desktop opens the same thread and Chrome does not open.
  3. On native Windows with the Store package installed, start a TUI session and enter /app.
  4. Confirm Codex Desktop opens the same thread without an Unable to find Electron app dialog.
  5. Start a task and confirm /app remains available while the task is running.
  6. Invoke /app before the thread id is available and confirm the TUI reports that the session is still starting.
  7. On WSL and ordinary Linux, confirm /app is not offered in the slash-command popup.
  8. Open an ordinary web URL from the TUI and confirm it still uses the browser path.

Manual verification:

  • macOS Desktop handoff passed using just c and /app.
  • Native Windows Desktop handoff passed with the Store package installed.
  • WSL shared-home testing exposed SQLite initialization / I/O failures, so /app is now intentionally hidden there.

Targeted automated verification:

  • cargo check -p codex-tui
  • just test -p codex-tui desktop_handoff
  • just test -p codex-tui app_command

Additional local notes:

  • just test -p codex-tui still fails on two unrelated Guardian tests.
  • just argument-comment-lint is blocked by the existing Bazel/LLVM compiler-rt empty-glob failure; the touched Rust positional literal callsites were manually inspected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 523515fd74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/slash_command.rs Outdated
@fcoury-oai fcoury-oai changed the title feat(tui): add desktop session teleport command feat(tui): add /app desktop handoff command Jun 1, 2026
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@etraut-openai etraut-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like there are some things unrelated to this PR in this branch, perhaps a bad merge?

Also, there's more complexity here than necessary. I asked codex to apply $simplify-code, and it cut about half the lines out of it (some of them admittedly related to the bad merge).

Comment thread codex-rs/app-server/src/lib.rs
Comment thread codex-rs/state/src/telemetry.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

Rebuilt the branch in 5179725 as one focused commit. I removed the unrelated app-server/state changes, consolidated the Windows and WSL packaged-app launcher, and removed the redundant slash-popup snapshot/tests. The diff is now 6 TUI files with 177 additions, down from 11 files with 336 additions. Validation: UV_CACHE_DIR=/private/tmp/codex-uv-cache just fmt, cargo test -p codex-tui slash_app, cargo test -p codex-tui desktop_thread_url_targets_codex_threads_deep_link, cargo check -p codex-tui, cargo insta pending-snapshots, and git diff --check. I also verified /app manually on macOS using just c; Windows and WSL still need host-specific smoke testing. @codex review

@fcoury-oai fcoury-oai requested a review from etraut-openai June 2, 2026 13:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 517972594b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/slash_command.rs
Comment thread codex-rs/tui/src/app/history_ui.rs
Comment thread codex-rs/tui/src/app/history_ui.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 240dd9c908

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/app/history_ui.rs
Comment thread codex-rs/tui/src/app/history_ui.rs Outdated
Comment thread codex-rs/tui/src/app/history_ui.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77ee93efba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/chatwidget/slash_dispatch.rs
Comment thread codex-rs/tui/src/app/history_ui.rs Outdated
Comment thread codex-rs/tui/src/slash_command.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fcoury-oai fcoury-oai force-pushed the fcoury/teleport branch 3 times, most recently from 3d564b5 to 8c32df8 Compare June 3, 2026 13:40
@fcoury-oai fcoury-oai changed the title feat(tui): add /app desktop handoff command feat(tui): add /app desktop handoff Jun 3, 2026

@etraut-openai etraut-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

@fcoury-oai fcoury-oai merged commit 80b65e9 into main Jun 3, 2026
31 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/teleport branch June 3, 2026 23:30
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants