Skip to content

[codex] Add Warp OSC 9 notification support#16878

Draft
jgershen-oai wants to merge 2 commits intomainfrom
codex/warp-osc9-support
Draft

[codex] Add Warp OSC 9 notification support#16878
jgershen-oai wants to merge 2 commits intomainfrom
codex/warp-osc9-support

Conversation

@jgershen-oai
Copy link
Copy Markdown
Collaborator

Summary

  • Detect Warp sessions via WARP_CLI_AGENT_PROTOCOL_VERSION and select the OSC 9 notification backend when notification method is auto.
  • Let Warp receive notification updates even when Codex believes the terminal is focused, since Warp handles notification visibility itself and does not relay focus events to the PTY.
  • Port the behavior onto the current codex-rs/tui layout without reintroducing the removed tui_app_server tree.

Context

Warp supports OSC 9 notifications and exposes its CLI agent protocol environment variable in supported sessions. Codex already used OSC 9 for terminals like WezTerm/Ghostty; this extends that path to Warp and avoids suppressing Warp notifications based on focus state.

Testing

  • just fmt
  • cargo test -p codex-tui
  • just argument-comment-lint
  • git diff --check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Warp terminal support to Codex TUI desktop notifications by detecting Warp sessions via an environment variable and adjusting both backend selection and focus-suppression behavior to match Warp’s focus/visibility model.

Changes:

  • Detect Warp sessions via WARP_CLI_AGENT_PROTOCOL_VERSION and prefer OSC 9 when notification method is auto.
  • Bypass Codex’s focus-based notification suppression when running under Warp.
  • Add a unit test covering auto-selection of OSC 9 for Warp-detected sessions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
codex-rs/tui/src/tui.rs Adjusts notify() gating so Warp sessions are not suppressed by terminal_focused.
codex-rs/tui/src/notifications/mod.rs Adds Warp env-var detection, plugs it into OSC 9 capability detection, and expands tests.

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

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