Repository navigation
feat(content): publish a new page live in WordPress, Webflow and Wix (00447) - #2001
Merged
Merged
Conversation
…440) AGENT-OWN-KEY PR 2. When the workspace's own AI key fails, every run ends "Something went wrong" and nothing names the key. This adds what the next PRs use to stop runs, pause agents and tell Admins. Nothing is visible yet. - lib/agent/key-errors.ts: classifyProviderError(provider, error) unwraps the AI SDK's RetryError and reads the APICallError's status and body: invalid (401, 403, Google API_KEY_INVALID), no_credit (insufficient_quota, OpenRouter 402, Anthropic's low credit balance or billing_error), model (404, Azure DeploymentNotFound), transient (408/409/429/5xx/529, Google RESOURCE_EXHAUSTED, a dropped connection, a timeout) or request (anything else, and OpenRouter's 403 moderation flag). invalid, no_credit, model and unreadable (a key that can't be decrypted, ours) are the key classes. - lib/chat/key-health.ts: ownKeyFailure reads the active key's failure without decrypting; markKeyFailing starts one episode however many runs fail at once (a conditional update on failing_since) and keeps the latest class; markKeyWorking clears it only when set and resumes the agents paused own_key; resumeOwnKeyAgents for a key that went out of use. - 00440: organization_ai_keys gets checked_at, failing_since, failure_class, failure_status and notified_at, failing_since set exactly while failure_class is. A new key string clears all five in a trigger, so a key replaced in Settings starts unchecked whatever the route sends, and the web may deploy ahead of the migration. chat_agents.paused_reason and chat_agent_runs.stop_reason gain own_key. schema.sql and the Supabase types are regenerated. Agents resumed by the system aren't logged, as the cap resume isn't. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g it to the AI limit AGENT-OWN-KEY PR 7 (§3.1 point 2, §13 item 1). When the workspace's active own key couldn't be decrypted (the master key rotated without a re-save, a malformed row), resolveAgentModelConfig answered null and Chat silently ran on Ansvisor's key and the workspace's AI budget, while chatRunsOnOwnKey still said "own". A workspace that keeps its data with its own provider would have had it sent through Ansvisor's key. - lib/agent/key.ts: readActiveKey tells none saved, unreadable (with its provider) and ready apart. resolveAgentModelConfig keeps answering null for both, so today's Agent Chat still asks for a key. - lib/chat/key.ts: resolveChatModelKey throws OwnKeyUnreadableError on an unreadable own key, never Ansvisor's key, and marks the key failing unreadable (key-health, best effort). The run ends in error; PR 3 gives it its own words. chatRunsOnOwnKey already reads it as own. - Agents: aiLimitReached reads an unreadable key as the workspace's own (no AI limit), and the agent form still says the agent runs on that provider's key. - Help "Use your own AI keys": a key the server can no longer read stops Chat; save it again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AGENT-OWN-KEY PR 3 (§5.1, §5.2). A revoked key, an account out of credit or
a model the key can't reach ended every run "Something went wrong", the
reading model's failure was tried again on the same key, and a triggered
agent kept firing until 3 failed runs in a row paused it.
- Engine: a failed model call on the workspace's own key is sorted by
classifyProviderError (engine-key.ts stepFailure). A key class ends the
run at once with code own_key: no read→write second call, and a Help
answer stops too. The key is marked failing (one episode) and the run's
progress keeps keyFailure. The words name the provider and the class
("Anthropic turned down your workspace's key." / "…out of credit." /
"…can't find the model {model}…" / "…can't be read any more.") plus "So
Chat stopped here. What's done so far is kept."
- A saved key that can't be read (PR 7) ends the run the same way before
any call.
- A provider that didn't answer after the SDK's retries ends provider_down:
"{provider} didn't answer, so Chat stopped here… Try again in a moment."
The key isn't marked.
- Ansvisor's own key failing keeps today's path: it isn't the workspace's
to fix.
- ChatModels carries the key's provider and its health at the run's start;
the first answered call on a key marked failing marks it working, which
resumes the agents it paused (key-health).
- The run's error box: Admins get Open AI Providers, others read "An Admin
can fix it in Settings › AI Providers." (run.error code own_key,
kept on reload).
- Agents: an error run with keyFailure is stopped own_key ("Stopped · AI
key not working"), not failed, so it doesn't count toward 3 failed runs in
a row. A triggered agent pauses own_key ("Your AI key isn't working"); a
person's Run now or Run agent doesn't pause it.
- Help: chat.md "When your AI key fails"; agents.md "When your AI key fails".
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AGENT-OWN-KEY PR 4 (§5.2 items 4–6). While the workspace's own AI key was
failing, Run now and Run agent queued runs that then failed, Resume turned
a paused agent back on into the same failure, and nothing outside a run
said the key was the cause.
- runChecks refuses own_key_failed (409) when Chat runs on the workspace's
own key and it is marked failing (failingOwnKey): Run now and Run agent
queue nothing, on any brand; Activate, Resume and Take over are refused
the same way. The words: "{why} An Admin can fix it in Settings › AI
Providers, then run the agent again."
- The runner ends a queued run before any model call: stopped own_key; a
triggered agent pauses own_key, a person's run doesn't.
- Agent Center: a banner while the key fails, "Your {provider} key isn't
working · agents are paused" and why; Admins get Fix in AI Providers,
others read that an Admin can fix it there. The list's answer carries
the key's class and provider (keyFailure), no dates.
- The composer, on Chat's pages and in the side panel: one line over the
box, "{why} Chat stops on it until it's fixed.", with Fix in AI Providers
for Admins. Sending stays on. Read only where Chat runs on the own key.
- Help: agents.md and chat.md "When your AI key fails".
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed agents Settings › AI Providers gets Test on each saved key and on the Replace form: one call with no retries, sorted into working, out of credit, refused or unchecked. What it finds is kept on the key (00440): a failing key starts an episode, a working one ends it and restarts the agents it paused. The list shows each key's health. The agent sweep restarts agents paused for the own key once it works again, or once Chat no longer runs on it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fuse # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts # web/src/components/chat/agents/agents-list.tsx
…key (00442) AGENT-OWN-KEY PR 8: agents on the workspace's own key had no spending limit of their own. All agents together may now spend at most $250 a month on it at the providers' list prices (00442 chat_settings.own_key_agent_month_usd, $10 to $10,000, always on; Admins change it in PR 9's card). The server endpoint checks it at fire, run and Run now (429); an agent that reaches it pauses with own_key_cap, Run now and Run agent are refused, and the sweep restarts them when the period renews or the limit is raised. Chats a person starts don't count. Help: agents. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ils (00441)
AGENT-OWN-KEY PR 6: when the workspace's own key stops working, every
Admin gets one notice for the episode: a row at the top of the Chat
Inbox, "Your {provider} key isn't working · agents are paused", with
Fix it to Settings › AI Providers, and an e-mail (00441 chat_notices,
unique per person and episode). If the key still fails 3 days later,
one reminder. The notices close once the key works again or is removed.
Only while Chat is on for the workspace; nothing on self-hosted.
Help: AI providers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y-agent-cap Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # supabase/schema.sql
…-agent-cap Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # supabase/schema.sql # web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts # web/src/components/chat/agents/agents-list.tsx # web/src/lib/chat/agent-action.test.ts # web/src/lib/chat/agent-driver.test.ts # web/src/lib/chat/agent-driver.ts # web/src/lib/chat/agent-form-setup.test.ts # web/src/lib/chat/agent-runs.test.ts # web/src/lib/chat/agent-sweep.test.ts # web/src/lib/chat/agent-sweep.ts # web/src/lib/chat/agents.ts
The typecheck read the fake's answer as null only, so the test giving it a reached guard didn't type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # supabase/schema.sql
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings › AI Providers gets an "Agents on your key" card for Admins only (other roles never get it): the most all agents may spend on the workspace's own AI key a month, $10 to $10,000 ($250 unless set), and this month's estimate at list prices with when it renews. The bar turns amber from 80% and red at the limit. PUT /api/settings/ai-providers/guard saves it (00442), answering unavailable before the migration. The agent form's own-key line names the key's monthly limit. Help updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # help/settings/ai-providers.md # web/src/app/api/settings/ai-providers/route.test.ts # web/src/app/api/settings/ai-providers/route.ts # web/src/lib/chat/agent-sweep.test.ts # web/src/lib/chat/agent-sweep.ts # web/src/lib/chat/key-health.ts
…health Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or a test passes Saving a new key string clears the old key's failure (00440's trigger), so markKeyWorking found nothing failing and never closed the Admins' notices. The PUT now closes the provider's open notices before the new key's check is kept, and a passing check closes them whether or not a failure was still marked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # supabase/schema.sql
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AUTONOMOUS-GO-LIVE PR 6. Settings › Chat gets "Agents that publish on their own", under what Managers may take live: an Admin's switch, off by default, locked below Growth and while Content Quality is off, read-only for everyone else. Turning it on asks the Admin to accept the responsibility text first (its version kept with who and when, 00443); turning it off needs no dialog. Hidden unless staff turn on CHAT_AUTO_GO_LIVE for the workspace (autoGoLiveEnabled). Where it shows, the page's "EXECUTE needs a click" lines say an Admin may let an agent go live on its own. Help: a new Settings › Chat article, and the "nothing is published without your click" lines name the exception. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…trust with the draft's reads Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ess and demo coverage tests Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…notices Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mo guard leaves Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-reads Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efore an agent takes it live AUTONOMOUS-GO-LIVE PR 2b-2. lib/content/go-live-gate.ts goLiveGate() gathers, with no one's session, every read the Content Editor's scores take (the draft, its authors, inputs, sources, rules, confirmations, own images and catalog product; its links, claims, page read, sources' kinds, brand facts and site trust from the server's go-live reads, made on the agent run's budget when none is kept) and scores the page with the editor's own qualityState. It holds the page for a click, with why: with Content Quality off, placeholders or fields a CMS won't take, suggestions waiting, a read that couldn't be made, a fact that differs from an approved one or one stated with none approved, a score under 60 or an average under 75. A score with nothing to judge is left out, as the editor's average leaves it. To read the page as the editor does on the server: the catalog match takes a client (catalog-match.ts), the editor's StarterKit options and the HTML block's node schema move to lib (the editor uses the same), and textRanges and openSpotPlaces move to lib/content/doc-text.ts with pageDoc(), which parses a page into the editor's document. Nothing calls the gate yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…check the plan themselves Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-go-live-agent-drafts
…live-agent-drafts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AUTONOMOUS-GO-LIVE PR 5. Step 4b of the precedence: for an agent run in Full auto whose agent an Admin allowed for the run's version, on a workspace whose Admins let agents take publishing live, on Growth and up and behind CHAT_AUTO_GO_LIVE, the Send to CMS click is lifted once the guards pass (injection and untrusted start, the page as Send to CMS makes it, its text and links, a live page, the quality gate, the daily limit). The engine reserves the agent's slot, sends the checked page through the API's internal route as the run's person, and logs it as go_live (00445). A guard that fails, a full limit or a failed send keeps the click card and says why. Interactive Chat and MCP keep the click; nothing can turn it on until the Settings switch and the agent's box ship. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AUTONOMOUS-GO-LIVE PR 7. Under the agent form's Approvals table, an Admin
lets the agent send pages to the CMS without a click, at most its daily
limit (1-20, 5 by default), in Full auto, while the workspace's switch is on
in Settings > Chat. The box says why it can't be ticked (the plan, the
switch, the mode); a Manager reads it with Ask your Admin. It is saved as
its own request (GET/PUT/DELETE /api/chat/agents/{id}/go-live, Admins only,
logged), for the version the agent is on, so an edit leaves it behind and
the page says "Off since the agent changed". The Approvals row and the
summary say "On its own · up to {n} a day"; the agent's card and page carry
the badge, and the page lists who allowed it and its last day's go-lives.
Help: agents.md gains the section, skills.md and the Ready to Publish
preset no longer say going live is always a click.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o-live-notices # Conflicts: # server/src/middleware/demo-brand.test.js # supabase/schema.sql # web/src/lib/chat/agents.ts
…e on its own (00446)
AUTONOMOUS-GO-LIVE PR 8. Once a step an agent took on its own is done, the
server tells the agent's owner and the people its version notifies, those
who reach the page's brand: a notice at the top of their Inbox's Needs you
("{agent} sent "{title}" to {CMS} as a draft", Open page, Open run) and an
e-mail by their "Notify me when an agent needs me". When the page's draft
works on an Action Center action, its History says so. When an edit makes
a new version of an allowed agent, the Admin who allowed it and the owner,
not the editor, are told it no longer publishes on its own (Open agent);
allowing it again closes those notices. Opening an agent's notice closes
it. The Content Library's last send says it was the agent's, on its own.
00446: chat_notices gains the two kinds and a brand_id; a notice about a
brand is read and changed only by people who reach it, who may also close
their own (resolved_at). Help: agents.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…00447)
AUTONOMOUS-GO-LIVE PR 9, server part. lib/cms-publish.js writes the
checked page into its CMS draft (sendContentPages), then publishes it on
its own there (Webflow: out of draft + WEBFLOW_PUBLISH_COLLECTION_ITEMS;
WordPress: status publish; Wix: publish the draft post), and marks the
send published at its address, which records the ship event. Framer
(whole-site publish) and pages live already are refused. A person's
Publish goes through POST /api/content-drafts/publish-cms (Admins and
Managers, not Managers while publishing is off for them; demo guarded);
an allowed agent's through the internal go-live /send with kind publish.
00447: ship_cms_publish takes the run, agent and agent run (automated for
an agent's publish); reserve_agent_go_live gives a step of another kind
on a page already counted its own row without a new slot, so a publish
after its CMS draft has its own record and notice. The go-live notice and
e-mail say "{agent} published "{title}" on {site}" with the live page, and
the action's History gets agent_published.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…allowed agent
AUTONOMOUS-GO-LIVE PR 9, web part. A new EXECUTE row publish_cms
("Publish pages on your site", Webflow, WordPress or Wix) runs
publishDraftToCms, which builds the page as Send to CMS does, with the
same checks, and posts it to the API's publish-cms route. An agent an
Admin allowed publishes on its own through the go-live send (kind
publish); otherwise it is a click card. publish_refused is said as the
CMS's refusal, checked before the rule that reads *_refused as "not
connected".
The Inbox notice of an agent's publish says "{agent} published "{title}"
on {site}", with "Live on {site}" under it and Open page opening the live
page. The agent box, the Ready to Publish preset, the skills' "Never
publish" lines (spec §14, library.json rebuilt) and Help (chat, agents)
say what can go live on its own now.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 13 tasks
# Conflicts: # help/chat/agents.md # help/chat/chat.md # help/settings/chat-rules.md # server/src/lib/brand-access-policies.test.js # server/src/lib/chat-notices/go-live.js # server/src/lib/chat-notices/go-live.test.js # server/src/routes/internal-chat-go-live.js # server/src/routes/internal-chat-go-live.test.js # supabase/schema.sql # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx # web/src/components/chat/chat-inbox.test.tsx # web/src/components/chat/inbox-notices.tsx # web/src/lib/chat/engine.test.ts # web/src/lib/chat/engine.ts # web/src/lib/chat/go-live-send.ts # web/src/lib/chat/notices.test.ts # web/src/lib/chat/notices.ts # web/src/lib/chat/precedence-context.ts # web/src/lib/chat/precedence.ts # web/src/lib/chat/registry/content-tools.ts # web/src/lib/chat/registry/define-tool.ts # web/src/lib/chat/registry/tools.test.ts # web/src/lib/chat/skills/library.json # web/src/lib/chat/write.test.ts # web/src/lib/chat/write.ts # web/src/lib/content/quality-inputs.test.ts # web/src/lib/content/quality-inputs.ts # web/src/types/supabase.ts
This was referenced Nov 3, 2026
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
AUTONOMOUS-GO-LIVE PR 9: publish a new page live on Webflow, WordPress and Wix, from Chat with a person's click, or on its own by an agent an Admin allowed (§4 row 2, §6.4, §10.5). Stacked on #1989 (go-live notices). Migration 00447;
schema.sqlregenerated. The owner approved the screens: the Inbox row in both themes, the agent box's line in both themes, and the e-mail.Publishing a page (
server/src/lib/cms-publish.jspublishContentPage)framer_site_publish, 409), because Framer publishes the whole site;live_item, 409), because the Content Editor changes it.sendContentPages, as Send to CMS does). The page that passed the checks is the page that goes live.WEBFLOW_PUBLISH_COLLECTION_ITEMS;status: publish;markDeliveryPublished, which records the ship event).publish_refused, 502, with the CMS's words). The draft stays sent and nothing is marked live.Where it is called
POST /api/content-drafts/publish-cms{brandId, target, page}./sendwithkind: 'publish'. It finishes its step with the published address.00447
ship_cms_publishtakes the run, the agent and the agent run. It isautomatedfor an agent's publish,assistedfor a person's.reserve_agent_go_live: a step of another kind on a page and destination already counted in the last 24 hours gets its own row, with no new slot. A publish after its CMS draft therefore has its own record and its own notice.Chat (
registry/content-tools.ts)publish_cms("Publish pages on your site"):publishing, Manager and up;draft_idanddestination(Webflow, WordPress or Wix);publishDraftToCms(actions/cms-send.ts), built assendDraftToCmsbuilds the page, with the same checks: placeholders, a live page, the Manager switch.goLive: {kind: 'publish'},go-live-send.ts). Otherwise it is a click card.publish_refusedis said as the CMS's refusal. Before this change it was matched as "not connected" by the_refusedrule; it is now checked first, in both the person's and the agent's path.People are told (
chat-notices/go-live.js, Inbox)agent_published.Words
publish: description and steps 3–4;winback,tasks,refresh,compare,translate,audit-fix: "Never publish yourself: the app decides whether a page goes live, and asks the person unless an Admin allowed this agent to go live on its own".library.jsonis rebuilt fromskills/*/SKILL.md.chat/chat.md: new section "Send or publish a page from Chat";chat/agents.md: publishing on its own, and the Inbox notice's live page.Related issue
None. AUTONOMOUS-GO-LIVE spec, PR 9.
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
Unit tests, server:
cms-publish.test.js:cms/webflow,cms/wordpressandcms/wixtests.content-drafts-publish-cms.test.js: roles, the Manager switch, the body.internal-chat-go-live.test.js: kindpublish.impact-ledger/ship.test.js: agent ids,automated.chat-notices/go-live.test.js: the publish words and the History event.Unit tests, web:
chat-content.test.ts(publishDraftToCms):write.test.ts:live_itemandpublish_refusedare said as they are.tools.test.ts: the row, its roles, and its go-live step.chat-inbox.test.tsx: the published row and its external link.notices.test.ts:urlonly for a publish, and only http(s).skills(library rebuilt).Manually (
CHAT_AGENTIC=true,CHAT_AUTO_GO_LIVE=true, 00446 and 00447 applied):agent_went_livenotice withkind: 'publish'and aurl, as inpr-queue/preview-golive9-seed.sql.Screenshots: attached to the owner's approval (Inbox light and dark, the agent box light and dark, the e-mail).
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (bea7524), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41412966725): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code