Skip to content

fix(content): let the Content Agent use a placeholder only for a missing fact - #1620

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-fewer-placeholders
Oct 28, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-fewer-placeholders

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Of the 6 placeholders that held the Webflow send, 4 weren't missing facts: [About], [Documentation], [OpenAI release notes] twice, [Google AI updates]. Another was [competitor].

  • A PLACEHOLDER_RULE in content-agent.js limits placeholders to what the agent can't know: a number, a price, a date, a person's or customer's name, a quote.
  • A page, a document, a link, a product, a brand or a competitor is written in plain words.
  • The rule goes into every prompt that writes a page's words: write, suggest, rewrite and Apply rules.
  • Each rule's JSDoc sits above its own rule.

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 feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd server && npx vitest run src/lib/content-agent.test.js src/lib/content-writer.test.js
  2. After the API deploy, run the agent on a new page: it names pages and documents in words, not in brackets.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

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 lint and npm test (3,349 tests).
  • web/: yarn format, yarn lint (0 errors, the 7 earlier warnings), yarn typecheck, yarn test (4,385 tests) and yarn build.
  • This branch's own tests were also run on it alone.

🤖 Generated with Claude Code

cihan-gyk and others added 2 commits October 27, 2026 23:33
…son must find, never a page, a document or a competitor

A new page held its send to Webflow on six placeholders, and four were no
missing fact: "[About]" and "[Documentation]" pages, "[OpenAI release
notes]" (twice) and "[Google AI updates]" were pages and documents the
agent could name in plain words, and "[competitor]" a word it could write.
Each placeholder holds a send or an export until the person fills it, so
every one the agent writes is work for them.

One rule (PLACEHOLDER_RULE) now goes into every prompt that writes a page's
words: writing a new page, the Improve suggestions, Apply rules and
Rewrite the whole page. A placeholder is only for a number, a price, a
date, a person's or a customer's name, or a quote. A page, a document, a
link, a product, a brand, a company or a competitor is written in plain
words ("your About page", "OpenAI's release notes"), the competitors given
by name, else "competitors". Write as few as the facts need.

The number and name guards still turn an unsourced figure, name or quote
into a placeholder, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… each above its own rule

The new rule went in between ATTRIBUTION_RULE and its JSDoc: each comment now sits over the rule it explains.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk 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.

Looks good.

PLACEHOLDER_RULE goes into all four prompts that write a page's words: write, suggest, rewrite and the agent's Apply rules. It sits after each one's "never invent… write a placeholder" line, so the two read together. With the brief rules off, the prompts stay the constants, so "asks as before while they are off" still holds. The new test fails without the change. The branch is on an older main (dcd1d953) but merges clean on 3f6a4d4b, and with #1626 and #1627, which edit the same files. content-writer, content-agent and content-rewrite tests pass on the merged tree.

Before the API deploy: no change. It's a server prompt, so the agent keeps writing [About]-style placeholders until the deploy.

@gkhngyk
gkhngyk merged commit a2a6e82 into ansvisor:main Oct 28, 2026
6 checks passed
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.

2 participants