Skip to content

[codex] fix Prompt Optimize ProseMirror writer - #72

Open
weiadou wants to merge 3 commits into
BigPizzaV3:mainfrom
weiadou:codex/fix-prompt-optimize-prosemirror-write
Open

[codex] fix Prompt Optimize ProseMirror writer#72
weiadou wants to merge 3 commits into
BigPizzaV3:mainfrom
weiadou:codex/fix-prompt-optimize-prosemirror-write

Conversation

@weiadou

@weiadou weiadou commented Aug 3, 2026

Copy link
Copy Markdown

Summary

  • release Prompt Optimize 1.0.2
  • write optimized text to Codex Desktop ProseMirror composers even when selectAll reports false
  • make cancellation and clipboard-fallback messages explicit that the original input was not changed
  • add a dependency-free regression test for the ProseMirror writer and refresh the Script Market SHA-256

Root cause

The contenteditable writer treated selectAll and insertText as one combined success condition. In the current Codex Desktop ProseMirror composer, the selection can already be established and insertText is supported, while selectAll reports false. That prevented the insert and incorrectly fell back to the clipboard.

Validation

  • node --check scripts/prompt-optimize.js
  • node --check tests/prompt-optimize-prosemirror-writer.test.js
  • node --test tests/prompt-optimize-prosemirror-writer.test.js (2 passed)
  • parsed index.json, verified its Prompt Optimize entry is unique, and verified its SHA-256 matches scripts/prompt-optimize.js
  • git diff --check origin/main...HEAD
  • manually inspected the current Codex Desktop page: the active composer is a ProseMirror contenteditable textbox and insertText is supported and enabled

No API key or model configuration was read or changed, and validation made no external model request.

Related

Fixes #71

Related to #55 and #59. Builds on #56: this PR intentionally includes the transport fallback proposed there because upstream main still serves Prompt Optimize 1.0.0; the writer fix applies on top of that fallback.

@weiadou
weiadou force-pushed the codex/fix-prompt-optimize-prosemirror-write branch from 23ef9e7 to 7af42af Compare August 3, 2026 01:56
@weiadou
weiadou marked this pull request as ready for review August 3, 2026 02:13
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.

Prompt Optimize 在 ProseMirror 输入框中错误回退到剪贴板

1 participant