Skip to content

Remind the model to save a section it wrote as text - #69

Merged
TechNomadCode merged 1 commit into
mainfrom
fix/say-when-a-section-was-not-saved
Nov 9, 2026
Merged

TechNomadCode merged 1 commit into
mainfrom
fix/say-when-a-section-was-not-saved

Conversation

@TechNomadCode

Copy link
Copy Markdown
Owner

gpt-oss can write a drafted section into its reply instead of calling saveSection, so nothing is saved or checked.

While saveSection is on offer, a reply that is recognisably a section (its first line is only a section title, or it is a save written as JSON, and it quotes at least two sources) goes back to the model with a reminder to save, up to two times. The visitor sees only the result. No reminder starts 25 seconds or more into the model call, to stay inside the route's 60 seconds. If the model never saves, the first reply passes as written.

  • src/server/ai/cloudflare.ts: the remindingToSave middleware, next to the markup retry
  • src/server/ai/unsaved-draft.ts: the rule
  • This changes what the model receives; unmeasured on the real model, by the owner's choice. Warnings in the logs show how often it runs and helps.

Local: npm run verify passes, with new tests in tests/unit/unsaved-draft.test.ts that fail without the fix. Not run: end-to-end tests (no interface change), the real model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechNomadCode
TechNomadCode merged commit 987f8cb into main Nov 9, 2026
5 checks passed
@TechNomadCode
TechNomadCode deleted the fix/say-when-a-section-was-not-saved branch November 9, 2026 14:15
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