IDE Extension: add selected Markdown preview content to Codex thread
What variant of Codex are you using?
IDE Extension for VS Code (OpenAI.chatgpt), version 26.5715.31925.
What feature would you like to see?
Allow users to add a selection from VS Code's rendered Markdown preview to the active Codex thread.
Current behavior:
- Open a Markdown file in the source editor.
- Select text and right-click.
- Add to Codex Thread is available and adds the file selection as context.
- Open the same file using VS Code's built-in Markdown preview.
- Select rendered content and right-click.
- Add to Codex Thread is not available.
Desired behavior:
- When text is selected in the built-in Markdown preview, its context menu should offer Add to Codex Thread.
- Invoking it should add the Markdown file and the selected rendered content to the active Codex thread.
- Preserve the source file path and map the selection back to a Markdown source range when possible.
- If an exact source range is ambiguous, selected text plus the file path and nearby context would still be useful.
- Do not show or enable the action when the preview has no meaningful selection.
This would make rendered specifications, plans, READMEs, and design documents usable as first-class Codex context without switching back to Markdown source and locating the same passage again.
Additional information
The existing Codex command is contributed only to editor/context and reads from window.activeTextEditor, so it works for source-editor selections but not for VS Code Markdown preview webviews.
VS Code's built-in Markdown extension owns the markdown.preview webview. The current generic webview/context command argument does not automatically include the DOM selection. VS Code does, however, support third-party markdown.previewScripts, so the integration may be implementable within the Codex IDE Extension; if a generic selected-text contract is required, that prerequisite may need coordination with microsoft/vscode.
I searched the open and closed openai/codex issues for combinations of “Markdown preview”, “Add to Codex Thread”, “preview selection”, and “IDE Extension” and did not find an equivalent request. Existing selection-based Markdown preview requests such as #26198 concern Codex Desktop rather than the VS Code IDE Extension.