Repository navigation
fix(content): tell the Content Agent how long an existing page is now, beside its Length - #1627
Merged
Merged
Conversation
…, beside its Length
Started on an existing page, the agent's suggestions were told only the
page's Length ("about 3000 characters"), never how long the page already
was. A page of 5,353 characters for a Length of 3,000 got suggestions that
added more (editor tests 2026-10-26 and 2026-10-27).
The prompt for an existing page's suggestions (buildWritePrompt with
passages) now says how long the page is now and what that asks of them
(lengthNow), against the Length's ±20% band, as the editor reads it:
- over the band: suggest cuts (repetition, filler, the least useful
detail) before anything new, and keep each addition short;
- under it: add what the questions and rules ask for;
- within it: keep it about this long.
A new page has no length yet, and a page rewritten whole is told its
length in its own lines, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… is among the rules With Length off the page keeps its length, as in a whole rewrite and the agent's own line, so its suggestions aren't asked to cut it.
7 of 12 tasks
Contributor
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On an existing page, the agent's suggestions were told only the page's Length ("about 3000 characters"), never how long the page already was. A page of 5,353 characters with a Length of 3,000 got suggestions that added more (editor tests, 2026-10-26 and 2026-10-27).
The prompt for an existing page's suggestions (
buildWritePromptwith passages) now says how long the page is now (lengthNow). It reads that against the Length's ±20% band, as the editor does:A new page has no length yet. A page rewritten whole is told its length in its own lines, as before.
Needs the API deploy.
Related issue
None. From Ansvisor’s production test of the Content Editor and Send to CMS (2026-10-27).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd server && npx vitest run src/lib/content-writer.test.js src/lib/content-agent.test.jsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Checked together with the other PRs from the same test (one integration tree of all eleven on main 3f6a4d4):
server/:npm run format,npm run lintandnpm test(3,349 tests).web/:yarn format,yarn lint(0 errors, the 7 earlier warnings),yarn typecheck,yarn test(4,385 tests) andyarn build.🤖 Generated with Claude Code