Feature Request: Implement VS Code Agent Integration (@codex hand-off support)

Open 💬 2 comments Opened Jan 5, 2026 by feketegabor

What feature would you like to see?

The OpenAI Codex VS Code extension should integrate with VS Code's Agent framework to enable @codex session hand-off functionality as documented in official VS Code documentation.

Background

According to the official VS Code documentation on Agents:

"You can hand off a local agent session from chat in VS Code by using the Continue In control, or by typing @cli, @cloud, or @codex in your prompt to pass the task to another agent type."

The documentation also states:

"Third party agents are background agents developed by other providers, such as OpenAI Codex, and that are integrated into the VS Code agent experience."

And lists the command: Codex: New Codex Agent: start a new OpenAI Codex agent session in a chat editor

Current Behavior

When typing @codex in VS Code Copilot Chat:

  • The @codex participant is not recognized
  • No hand-off to the Codex agent occurs
  • The documented workflow does not work

Environment Tested

  • VS Code Insiders: 1.108.0-insider
  • GitHub Copilot: v1.388.0
  • GitHub Copilot Chat: v0.36.2026010502
  • OpenAI Codex Extension: Installed (openai.chatgpt)
  • OS: Windows 11 Pro Build 26200
  • Subscriptions: Both ChatGPT Plus AND GitHub Copilot Pro+ (tried both authentication methods)
  • Settings tried: Including "Run Codex in WSL" option

Expected Behavior

According to VS Code documentation, users should be able to:

  1. Type @codex in chat to hand off a session to the OpenAI Codex agent
  2. Use the "Continue In" control to delegate to Codex
  3. Run Codex: New Codex Agent command to start a Codex agent session

Technical Implementation Suggestion

VS Code provides the Chat Participant API and the chatSessionsProvider proposed API for third-party agent integration.

The extension would need to:

  1. Register a chat participant with name: "codex" in package.json
  2. Implement a ChatRequestHandler to handle hand-off requests
  3. Optionally integrate with the chatSessionsProvider API for session management in the Agents view

Why This Matters

  • The official VS Code documentation explicitly mentions @codex as a supported hand-off target
  • Users following the documentation expect this feature to work
  • This would enable seamless workflow integration between GitHub Copilot and OpenAI Codex within VS Code

References

Additional information

I understand the VS Code extension is currently closed-source (per issue #5822), but this feature request is for implementing the integration that VS Code's documentation already describes as available.

View original on GitHub ↗

2 Comments

feketegabor · 7 months ago

Additional Feature Request: Git Worktree Isolation Support

In addition to the @codex chat participant integration, I'd like to request support for VS Code's Git worktree isolation mode for Codex background agent sessions.

How Worktree Isolation Works in VS Code

According to the VS Code Background Agents documentation:

"To isolate background agent changes from your main workspace, you can create a background agent session that uses a Git worktree. When you create a worktree, VS Code creates a separate folder for the session. The background agent operates in this isolated folder, to prevent conflicts with your active work."

The workflow currently works like this for Copilot CLI:

  1. Start a new background agent session in VS Code
  2. Select "Worktree" for the isolation mode in the chat input box
  3. VS Code automatically creates a new Git worktree folder
  4. All agent changes are applied to the worktree folder, isolating them from the main workspace
  5. After completion, review and merge changes back into the main workspace

Why This Matters for Codex Integration

Currently, users must choose between:

  • Running Codex in the main workspace (risk of conflicts with active work)
  • Manually managing isolation (cumbersome)

With worktree isolation support:

  • Users can let Codex work autonomously without worrying about file conflicts
  • Multiple Codex sessions can run in parallel on different worktrees
  • Changes can be reviewed before merging back to main workspace
  • Safer for experimental/proof-of-concept work

Requested Implementation

When creating a new Codex agent session via:

  • Codex: New Codex Agent command
  • @codex hand-off from local chat
  • "Continue In → Codex" control

The extension should:

  1. Present the isolation mode selector (Workspace vs. Worktree) like Copilot CLI does
  2. If "Worktree" is selected, create/use a Git worktree for the session
  3. Apply all Codex changes to the isolated worktree
  4. Integrate with VS Code's Source Control view to show the worktree
  5. Provide "Keep", "Undo", and "Apply" controls for reviewing changes after completion

Visual Reference

The VS Code documentation shows this isolation mode selector:

!Worktree isolation mode

And this file changes review interface:

!File changes review

Technical Notes

  • VS Code's worktree integration uses standard Git worktrees (git worktree add)
  • The worktree path is shown in the Agents view for tracking
  • Session cleanup can optionally remove the worktree folder

This would make Codex a first-class citizen in the VS Code agent ecosystem, with feature parity with Copilot CLI background agents.

References

Llorx · 6 months ago

This is a must in any AI tool nowadays. What makes anyone multiply his performance is not just starting to use AI, but using multiple AI at the same time. This is the major boost in production. How people works with AI is evolving pretty fast and Codex App (Still Mac only???) and Codex VSCode plugin (no worktrees??) is losing positions.