Skip to content

fix(chat): ask agents for any CMS, not Webflow, and keep Search Console optional - #1909

Merged
gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-skill-connections
Oct 31, 2026
Merged

gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-skill-connections

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Agents asked for Webflow as a required connection for /winback, /tasks and /publish, and for Shopify for /shopping (W2-15's agent-skills.ts, from the mockup's skill map). A workspace on WordPress, Framer or Wix, or with no CMS, couldn't turn those agents on. Search Console was required for /report and /winback, though they work without it. The agent runner (W2-16) also never checked connections: agents.ts left it "once those registries exist". Built on main. No migration. Behind CHAT_AGENTIC.

Connections are kinds now, not products (web/src/lib/chat/agent-skills.ts)

  • Any CMS (cms): Webflow, WordPress, Framer, Wix, or a workflow webhook that takes sent pages.
  • Any catalog source (catalog): Merchant Center, a feed, an upload, or a store whose sign-in works.
Skill Connection Required?
/publish any CMS Required
/shopping any catalog source Required
/winback, /tasks any CMS Optional
/report, /winback Search Console Optional

The runner checks them (agent-connections.ts, agent-driver.ts)

  • Before each run, the runner reads what the brand already has: a connected CMS site or an active webhook, a catalog source with a working sign-in, and the brand's Search Console and Analytics.
  • A missing Required connection: nothing starts. An agent on a trigger pauses with connection; Run now just stops.
  • A missing Optional connection: the run carries on. The run's message asks the agent to say "{name} isn't connected. I can do everything else without it." and do the rest.
  • Saved agents: agents saved with webflow or shopify count those as their kind, so no existing agent pauses.
  • Connections no integration offers yet (e.g. HubSpot) aren't held against a run.

Form: the Connections step shows "Any CMS" with which ones count, from en.json. Help: help/chat/agents.md gets a short "Connections" section (approved: false).

Related issue

None. Found while building Agent Center's ready-to-use agents.

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. Set CHAT_AGENTIC=true. On a brand with WordPress (or a webhook) and no Webflow, create an agent with /publish. Connections shows "Any CMS · connected", and the agent can be turned on.
  2. On a brand with no CMS, /publish is blocked as Required. /winback turns on, and its run says the CMS isn't connected and does the rest.
  3. Give a triggered /publish agent a brand with no CMS: the next run doesn't start, and the agent pauses with connection.
  4. Unit tests:
    • the connection reads;
    • the runner pausing on a missing Required connection, and accepting WordPress, a webhook, Merchant Center or a saved webflow;
    • the Optional-missing message;
    • "Any CMS" in the form.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes (0 errors; 7 old warnings in files this PR doesn't touch)
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

On this branch (b8ed719): web 784 files / 8,084 tests pass, yarn build passes; server format:check and lint are clean, and 349 files / 4,950 tests pass (3 skipped).

Follow-up: CHAT-21 also checks connections on Activate and Resume. This PR checks before each run, where the brand is known.

🤖 Generated with Claude Code

cihan-gyk and others added 3 commits October 31, 2026 21:29
…le optional

An agent's skills asked for Webflow (/winback, /tasks, /publish), Shopify
(/shopping) and Search Console (/report, /winback) as Required, so a
workspace on WordPress, Framer or Wix, or with no CMS, couldn't run them.
Connections are now kinds: "Any CMS" (Webflow, WordPress, Framer, Wix or a
workflow webhook) and "Any catalog source" (Merchant Center, a feed or a
store). Only /publish needs a CMS and /shopping a catalog source; the
rest are Optional.

The agent run driver now reads the brand's connections before a run: a
missing Required one starts nothing and pauses a triggered agent
(connection); a missing Optional one is said in the run, which does the
rest. Agents saved with a product (webflow, shopify) count it as its kind.
The form's Connections step shows "Any CMS" and what counts. Help article
updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	help/chat/agents.md
#	web/src/lib/chat/agent-driver.ts
… connection, and hold a skill's own

Run now and Run agent on an action queued the run and the runner then
stopped it with no reason, so the click showed a run that stopped without
a word. Both now refuse before queuing anything (connection_missing),
naming the connection and the brand; with several brands, none is queued.

The runner trusted the connections the agent was saved with. An agent saved
through the API with /publish and no connections, or /shopping with its
catalog set Optional, ran without them. The skills' Required connections
are now added to the saved list before the check, in the runner and the
two clicks alike.

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

Approving, with 1 fix on top: commit 4c7ae1f (after a merge of main, which conflicted in agent-driver.ts and help/chat/agents.md with #1895 and #1899).

The approach works. cms and catalog are connection kinds, read per brand from brand_cms_connections (Webflow, WordPress, Framer, Wix), webhooks that take content_draft.sent, and catalog_sources. Legacy webflow / shopify keys map onto those kinds. The form and the runner share agent-skills.ts, and no other copy still asks for Webflow. /report and /winback treat Search Console as Optional. get_gsc_summary already answers "not connected", and the run message tells the agent to say it worked without it.

Fix (4c7ae1f)

  • Run now and Run agent on an action stopped with no reason. Both queued the run. The runner then stopped it with stop_reason null, so the person saw a run marked "Stopped" and no explanation. Both now refuse before anything is queued, with a new connection_missing refusal (409) that names the connection and the brand. With several brands, none is queued.
  • The runner trusted the saved connection list. An agent saved through the API with /publish and connections: [], or with /shopping's catalog set Optional, ran without them. neededConnections now adds each skill's Required connections to the saved list before the check. The runner and both clicks use it.
  • Tests: two in agent-runs.test.ts (Run now, Run agent), one in agent-driver.test.ts and one unit test for neededConnections. The first three fail without the fix. The help article notes that Run now and Run agent say which brand is missing the connection.

Follow-ups (not blocking)

  • Resume doesn't check connections. An agent paused for connection can be resumed and will pause again on its next run.
  • "Any catalog source" counts every catalog_sources row whose sign-in works, uploads included. The wording "a product feed or a store" leaves uploads out.

Tests: vitest on src/lib/chat, src/components/chat, the Agent Center pages, the agents API, guards (plan-row) and help: 119 files, 1713 tests, all pass. tsc --noEmit is clean. ESLint and Prettier are clean on the touched files.

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

Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build.

@gkhngyk
gkhngyk merged commit 67ee37d into ansvisor:main Oct 31, 2026
4 of 5 checks passed
gkhngyk pushed a commit that referenced this pull request Nov 1, 2026
…n cards (#1917)

Agent Center opens on Ready to use (?tab=ready|yours); Your agents keeps
the Mine, Workspace, Paused and Archived filters. Ready-to-use agents are
presets kept as data (lib/chat/agents/presets/*.json, read through
catalog.json): skills from the library, triggers New agent offers, a mode,
connections, and for Soon cards what they wait for. Use this agent opens
New agent filled in (?preset=); nothing is saved or turned on by itself.
A mode the plan keeps closed shows its lock (planGateLock), and opens on
Auto, ask before changes. Analysts and Agency partners see the cards with
the read-only line. Goal is the only filter until a preset carries a
business type, industry or role. Help article updated.

The presets ask for connections as #1909 defines them: any CMS (Required
for Ready to Publish, Optional for Citation Win-back and Task Finisher),
any catalog source for AI Shopping Readiness, Search Console Optional.

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
gkhngyk added a commit that referenced this pull request Nov 2, 2026
…y to use (#1962)

* feat(chat): ask once what Chat should focus on, starting from the person's work areas (W2-22)

CHAT-24 §3: the focus picker opens once on the first Chat Home (marked
shown as it opens) with the areas the person's work areas suggest, Home's
pill reopens it, and Settings › General › Your focus keeps changes at
once. Focus only changes suggestions; no migration (00400 focus, 00408
focus_prompted_at).

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

* feat(chat): fit Chat Home to the person's focus: shortcuts, starter questions and a competitor's rise (W2-23a)

CHAT-24 §4: For you now takes the picked areas' shortcuts in turn (five
beside Ask anything, CHAT-08 v2's six chips; the three jobs keep their
counts and rules), Start with a question offers four in the workspace's
own competitor, topic and market or their general wording, the line under
the greeting says a competitor's mention rate rose 3+ points this week
when nothing needs the person, and the / menu lists the focus's skills
first. No migration.

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

* test(chat): keep the focus actions open in read-only, as the person's own settings

saveChatFocus, skipChatFocus and markFocusPrompted write only the person's
own chat_user_prefs row and cost nothing, like saveChatGeneralSettings, so
they join the read-only coverage test's open list with their reasons.

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

* feat(agents): add the Ready to use tab with the launch agents and Soon cards

Agent Center opens on Ready to use (?tab=ready|yours); Your agents keeps
the Mine, Workspace, Paused and Archived filters. Ready-to-use agents are
presets kept as data (lib/chat/agents/presets/*.json, read through
catalog.json): skills from the library, triggers New agent offers, a mode,
connections, and for Soon cards what they wait for. Use this agent opens
New agent filled in (?preset=); nothing is saved or turned on by itself.
A mode the plan keeps closed shows its lock (planGateLock), and opens on
Auto, ask before changes. Analysts and Agency partners see the cards with
the read-only line. Goal is the only filter until a preset carries a
business type, industry or role. Help article updated.

The presets ask for connections as #1909 defines them: any CMS (Required
for Ready to Publish, Optional for Citation Win-back and Task Finisher),
any catalog source for AI Shopping Readiness, Search Console Optional.

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

* feat(chat): add the focus areas' seven skills and New for you on Chat Home (W2-23b)

Adds /questions, /features, /gaps, /markets, /listings, /rivals and
/audit-fix (CHAT-24 §5) to the skills library, so it holds twenty-one.
Chat Home shows up to four of them under "New for you" for the picked
focus areas, and the / menu lists each area's new skills right after
its own.

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

* fix(chat): leave a focus as it was when the picker opened from Home's pill is cancelled

From the pill the picker's way out still saved an empty focus, so changing
your mind wiped the focus you had. Opened from the pill it now reads
Cancel and only closes; Skip for now stays the first opening's answer.

* feat(agents): let agents use the seven focus skills

New agent's skill step and its follow-on list offered only the fourteen
skills of W2-04. The focus areas' seven (W2-23b: Buyer questions, How AI
compares us, No clear leader, Who AI recommends by market, Listing gaps,
Rival brief and Site audit fixes) are in Chat's library, so an agent can
run them too.

- agent-skills.ts: the seven join ANSVISOR_SKILLS in the library's order
  (SKILL_ORDER). Their SKILL.md files read only Ansvisor's own data and
  public pages, and save page work as drafts, so none needs a connection:
  /listings reads the sites AI cites, not a catalog; /audit-fix writes a
  robots or CMS change for the person to make.
- en.json: their titles under chatAgents.skills, as their SKILL.md says.
- Tests: agent-skills.test.ts (every library skill, in order, titled as
  its SKILL.md, the seven with no connection), syncConnections, and the
  form's skill grid and follow-on list.
- Help: agents.md says which skills an agent can use.

Stacked on #1918 (W2-23b).

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

* feat(agents): add business-type and role packs to Agent Center's Ready to use

Ready to use offered the core agents only. AGENTS plan §8 adds packs by
business type (§8.1) and role helpers (§8.3), recommended to the person
on day one. This adds them as presets, with the brand's site type and the
person's work areas deciding what comes first.

- Presets: businessTypes are the brand's site types (b2b, ecommerce, b2c,
  as brands.site_type) plus app, which brand settings don't offer yet;
  roles are the work areas of Menu access (00374). The 12 business-type
  agents and 7 role helpers join the catalog: 10 ready, made of skills an
  agent can use today (the 14 and the 7 focus skills), and 9 Soon, each
  saying what it waits for (app store data, review site data, a catalog
  read, a seasonal, content plan or AI traffic skill, local listings).
  The §8.3 helpers that are core agents (Freshness, Prompt Portfolio,
  Crawler & Technical Fixer) get the role on their core preset instead of
  a copy. Reports and reads run on Auto, outreach and wrong-claim fixes
  on Ask me first.
- Ready to use: Business type and For your role filters beside Goal. The
  agents made for the site type of the brand on screen, or for one of the
  person's work areas, come first among the ready ones and among the Soon
  ones, marked For your site type or For your role. The page reads the
  person's work areas (profiles.work_areas).
- Tests: every preset's skills are ones an agent can use, Soon ones say
  what they need, no pack agent is a core agent's skills under another
  name, the tags follow the site types and work areas, the filters and
  the default order; the page passes the work areas.
- Help: agents.md covers the packs, the filters and the marks.

Stacked on feat/agents-focus-skills (on #1918) with #1917 merged in.

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

* fix(agents): wrap a ready-to-use card's skills and mode instead of cutting the mode off

A pack agent with three skills pushed the mode chip past the card's edge
("Auto, ask before chan…"). On a card the formula chips wrap to a second
line; the agent list's one-line rows are unchanged.

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

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Gökhan Geyik <[email protected]>
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