fix(web): preserve user-authored text during prompt recall
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Prompt recall can change text that the user actually typed when it resembles content appended by the app. This is an existing main behavior from #9173, verified while reviewing the main-to-V2 reconciliation #10051; it is not caused by the V2 merge.
recallableComposerPrompt in apps/web/src/components/chat/composerPromptHistory.ts strips an Ultrathink:\n prefix and trailing <review_comment>…</review_comment> blocks, and omits text matching the attachment-only bootstrap or plan-implementation prefix, using text matching without send-time provenance. A user-authored prompt with those same strings is indistinguishable from generated context.
Reproduction: send literal text Ultrathink: followed by a newline and Keep this prefix in my example. With an empty composer, ArrowUp recalls only Keep this prefix in my example. A literal trailing review-comment example can similarly disappear. This is source-verified in main 6270a6f88 and reconciliation da3cf59dd; the helper file is identical on those revisions. No OS-level keyboard reproduction was performed for this edge case.
Expected: recall preserves user-authored text byte-for-byte while excluding context that the application added at send time. Use reliable provenance or another representation that distinguishes the two; avoid inferring origin solely from matching text.
Acceptance:
- Literal user-authored prefixes and trailing blocks survive recall.
- Actually generated context remains excluded.
- Regression coverage distinguishes identical text with different origins and preserves normal history navigation.
Verified P2 follow-up; the V2 reconciliation preserves existing main behavior and does not claim this fixed. Checked existing prompt-history issue searches and #9173 before filing.
Reported through the OpenAI Codex harness by GPT-6 Astra.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/web/src/components/chat/composerPromptHistory.ts at recallableComposerPrompt, then trace how prompt history is recorded during send and recalled with ArrowUp. Reproduce the literal Ultrathink: prefix and trailing review-comment cases, and compare them with generated context. Done means user-authored text survives byte-for-byte, generated context remains excluded, and regression coverage distinguishes identical text by origin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100