Skip to content

feat(draft): suggest revisions at the end of draft answers - #1111

Merged
miurla merged 1 commit into
mainfrom
feat/draft-revision-suggestions
Nov 5, 2026
Merged

miurla merged 1 commit into
mainfrom
feat/draft-revision-suggestions

Conversation

@miurla

@miurla miurla commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Draft answers rarely end with suggestions today, far less often than other answers, and the ones that do carry questions about the topic for the article's reader, not anything the writer would do next. Follow-up requests on drafts are mostly the same few shapes (shorten it, make it more formal or more human, rework a named paragraph, translate it), so they are easy to offer as buttons.

This replaces the related questions prompt with one general follow-up suggestions block instead of adding a draft-specific concept:

  • The block suggests the user's likely next messages. Its heading, icon, and content fit the answer: follow-up questions under "Related" (icon related) for an answer that informs, and three changes to the draft under "Revise" (icon edit, new) for a draft answer, phrased as the user's own instruction and anchored to the draft's purpose, audience, or parts.
  • Buttons still use submitQuery, so clicks still send the suggestion as the next message and record related_question_clicked.
  • The block is now recognised by its submitQuery buttons rather than by the related icon, both when history is stripped of old spec blocks and in the evals, so a heading with another icon is kept and counted. Existing history only holds related blocks, so the stripped prefix is unchanged for it.
  • The prompt says the heading belongs only to the spec Heading element. Without that line, about 70% of draft answers also wrote ### Revise as markdown above the block, so the heading showed twice. The related questions evaluator now flags that as malformed.
  • The prompt also says a request to write a piece is a draft answer even when the piece is informative. Without it, a request for a comparison article was answered inline instead of in a draft block (3 of 3 trials).

Evals

eval:draft-edits (32 items, 3 trials, synthetic plus local production seeds):

main this PR
draft answers with suggestions 0% 68% (two runs: 68%, 69%)
of those, "Revise" with edit icon 100%
unrelated requests with "Revise" 0%
suggestions heading repeated in markdown 0 of 39
newBlockRate 0.71 0.76
hijackRate 6.7% 4.4%
editSuccessRate 1.00 1.00

eval:related-questions (5 trials), against the committed thresholds:

adaptive quick threshold
emissionRate 0.90 0.98 ≥ 0.85
falsePositiveRate 0.050 0.017 ≤ 0.20
wellFormedRate 0.96 1.00 ≥ 0.90

The new draft metrics are added to thresholds.json as reported but not enforced.

Checked in the app

On bun dev: a draft answer shows "Revise" with a pencil icon and three changes; clicking "Make the tone firmer but still polite" ran editDraft (v2) and that answer got its own suggestions. A researched answer still shows "Related". No console errors.

Checks

bun lint, bun typecheck, bun format:check, bun run build, and bun run test pass.

Written with an agent (Claude Code, claude-opus-5-5).

Replace the related questions prompt with a general follow-up suggestions
block whose heading, icon, and content fit the answer: follow-up questions
under "Related" for an answer that informs, and changes to the draft under
"Revise" with an edit icon for a draft answer.
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
morphic Ready Ready Preview Nov 5, 2026 1:06am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T01:06:53.462256Z f90263c PR opened
🔒 Security Review ✅ Completed 2026-11-05T01:08:36.503186Z f90263c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

Comment thread evals/lib/related-questions.ts Resolved
Comment thread evals/lib/related-questions.ts Resolved
@miurla
miurla merged commit 50962e0 into main Nov 5, 2026
10 checks passed
@miurla
miurla deleted the feat/draft-revision-suggestions branch November 5, 2026 01:11

This branch was successfully deployed

1 active deployment
Preview — f90263c5 Deployed Nov 5, 2026 by vercel[bot]
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.

1 participant