Repository navigation
feat(agents): an Admin's "Publish and send on its own" box on each agent - #1983
Merged
Merged
Conversation
…permission AUTONOMOUS-GO-LIVE PR 1 (migration 00443), with nothing reading it yet: chat_settings gains the workspace switch (auto_go_live_groups, who turned it on, when, under which terms); chat_agent_go_live keeps an agent's permission for the version it was given on, with its daily limit (1-20, 5 unless set); chat_agent_go_live_events keeps each step an agent takes live on its own, read by brand access. reserve_agent_go_live and finish_agent_go_live (service role) hold the daily limit under a lock per agent, once per (draft, target); a failed step frees its slot. Types, schema.sql, and the brand-access and demo coverage lists follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AUTONOMOUS-GO-LIVE PR 3 (owner's Q1 answer B): pure checks on the page as it would go out, for a later PR's go-live step. go-live-checks.ts holds a page with text aimed at AI (in its text or its structured data), hidden text, 30 words in a row copied from an untrusted read of the run, or a link to a site that isn't the brand's, a source the draft lists, or a page a read listed (page-sites linksToSites, sitesOfPages). An agent run now keeps its untrusted reads as 64-bit hashes of 12-word runs in its progress, 32 KB at most; past that the check holds the page. A person's own chat keeps none. Nothing calls the checks yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er session AUTONOMOUS-GO-LIVE PR 4 (migration 00444). POST /api/internal/chat/go-live/send (CRON_SECRET) is how the web's engine will send an agent's page on its own: it checks everything again from the database (Chat on, Full auto's plan, the Admins' switch, the run running as the person, the agent's permission for the run's version, the person's role and the Managers' publishing switch, brand access, not the demo brand, and the step's own reservation), then sends as a person's Send to CMS does, with the agent run kept on the delivery (content_draft_deliveries.agent_run_id). The step is finished done, or failed with why, which frees its slot; a refusal frees only this step's own slot. Never retried. v1 takes CMS drafts only. Nothing calls it yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… test's model steps out of a hook-named helper Co-Authored-By: Claude Opus 5.5 <[email protected]>
…function AUTONOMOUS-GO-LIVE PR 2a. lib/content/quality-inputs.ts qualityState() computes E-E-A-T, Trust and Readability and what the editor shows beside them from the reads the editor holds, so PR 2b's server gate for an agent going live on its own computes them exactly as the editor does. The editor's two dozen memos become one call after its reads; nothing on screen changes. quality-inputs.test.ts keeps the editor's code from before the move and shows both give the same values for four page types in each phase, for every read still pending, and with Quality off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ate, on the run's budget AUTONOMOUS-GO-LIVE PR 2b-1 (the owner's 2026-11-02 decision). POST /api/internal/chat/go-live/quality-reads (CRON_SECRET) reads the draft as saved for the web's gate: its links, and with Quality's phase 2 its claims, its page read and the kinds of the sites the gate's rules can't place. A kept read costs nothing; a new one is the agent run's own step (chat-budget agentRunReserve: feature agent, within the run's cap and the month's budget), not the workspace's Quality budget. Each read answers on its own (run_cap, ai_budget, off, failed), so the gate can hold the page on the one it lacks. The three reads take an optional meter; the page read's brand context moves to content-page-context.js for both callers. Nothing calls the endpoint yet. 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]>
…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
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]>
Merged
8 of 13 tasks
# Conflicts: # help/chat/agents.md # server/src/lib/brand-access-policies.test.js # server/src/middleware/demo-brand.test.js # supabase/schema.sql # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx # web/src/lib/chat/agents.ts # web/src/lib/chat/engine.test.ts # web/src/lib/chat/engine.ts # web/src/lib/chat/go-live.ts # web/src/lib/chat/precedence-context.ts # web/src/lib/chat/precedence.ts # web/src/lib/chat/registry/define-tool.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 7: an Admin's "Publish and send on its own" box on each agent (§7.2). Stacked on #1982 (the precedence's step 4b, which reads this permission). No migration:
chat_agent_go_liveis #1967's (00443). BehindCHAT_AUTO_GO_LIVE: with the flag off, nothing shows and nothing extra is read. The owner approved the screens.The box (agent form, step 3 "Mode & approvals", under the Approvals table)
Its own request:
GET / PUT / DELETE /api/chat/agents/{id}/go-liveNever part of the agent's save, so a Manager's edit can't carry it. The form sends it after the create or patch, for the version that save left the agent on.
PUT
{ dailyLimit }, Admins only. It needs:go_live_off);asked: goLive);go_live_mode);It upserts
chat_agent_go_livefor the agent's current version:skill_checksums {},granted_by/granted_at.DELETE takes it away, even while the switch is off.
Both are logged as
agentGoLiveOn/agentGoLiveOff.GET is for whoever may see the agent.
402 read-only first; refusals as values (fix(prompts): show suggestions' load failures plainly and retry once, instead of React #441 #1777).
An edit leaves the permission behind. A new version no longer matches the row's
version, so step 4b and the server don't lift anything for it. The row is kept rather than deleted, so the page can say "Off since the agent changed" and who allowed it. An Admin's own edit with the box still ticked gives it again for the new version.The agent's page and card
Badge "Publishes on its own · {n} a day": next to the mode on the page, under the chips on the card. Only while the switch is on and the permission fits the version.
Side card "Publishing on its own":
Take down itself is PR 10.
lib/chat/agent-go-live.tshas the reads (switch, permission, recent, the list's limits).agent-go-live-permission.tshas the write; the split avoids an import cycle withagents.ts.Before 00443 (
42P01,PGRST205,42703,PGRST204) the switch reads as hidden.Words and Help
en.json:chatAgents.form.goLive.*,chatAgents.detail.goLive.*, the refusals,asked.goLive, and the Activity summaries.help/chat/agents.mdgets a new section, "Let an agent publish on its own".help/chat/skills.md: a skill "doesn't publish by itself: only an agent an Admin allows may send pages on its own".Not here: the notice to the Admin and owner when an edit turns it off needs
chat_notices'agent_go_live_offkind (00446). It moves to PR 8 with the other notices.Related issue
None. AUTONOMOUS-GO-LIVE spec, PR 7.
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:
agent-form.test.tsx(8 new):{ dailyLimit: 7 };agent-detail.test.tsx(3 new): the badge, the card's states, the recent list, no card when never allowed or with the flag off.agents-list.test.tsx: the card's badge.agent-go-live.test.ts(9):forbidden_role;route.test.ts: limits 1–20 only (400 otherwise), 404 for a bad id, 402 first, refusals as values, GET.agent-form.test.ts: where a go-live refusal shows.Manually (
CHAT_AGENTIC=true,CHAT_AUTO_GO_LIVE=true, as an Admin):Screenshots (light and dark, 1024 px): attached to the owner's approval.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (40a7e68), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41395031130): 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