fix(pages): make pages discoverable to agents — org-wide CLI list, search, recall guidance
Problem
A user published Superset Pages expecting a later agent session to read them back, and the agent could not find them.
Root causes (discovery path only; publish and permissions were fine)
- CLI
pages listwas silently workspace-scoped.packages/cli/src/commands/pages/list/command.tsdefaulted--workspaceto$SUPERSET_WORKSPACE_ID, which every Superset terminal sets (apps/desktop/src/main/lib/terminal/env.ts:485,packages/host-service/src/terminal/env.ts:265). Inside a workspace the agent only ever saw pages published from that workspace. The desktop Pages tab (PagesView.tsx:54,page.list.useQuery({})), the MCPpages_listtool, and the page skill all treat "no workspace" as the whole org, and the skill literally said# or omit --workspace for the whole org. So the user saw the page in the Pages tab and the agent's list came back without it. - Slugs cannot be guessed.
mintPageSlugappends a random 6-char suffix (packages/shared/src/page-slug.ts), sopages get <title-slug>returns "Page not found" for a page that exists. No tool description or skill text said to list first. - No search on
page.list. Recall meant scanning the whole org list.
Not a cause, but checked: visibility defaults to org at the app layer (publish.ts:551, page.ts:173; the DB-level just_me default in schema.ts:1385 is only reachable by rows created before #6932). The list's visibility filter includes the caller's own just_me pages, so a same-user agent always sees its user's private pages. Org scoping is correct: MCP API keys and host-service terminals are pinned to one org, so a multi-org user whose page lives in another org gets a FORBIDDEN "belongs to X" on get, and a list that simply lacks it.
Fix
- CLI
pages list: whole org by default,--workspaceonly when passed; new--search/-s; UPDATED column. Test added. - tRPC
page.list: optionalsearch, case-insensitive contains over title/description/slug, LIKE metacharacters escaped (search.ts+ test). - MCP
pages_list:searchparam, description says it is the only way to discover a page and to omitworkspaceIdwhen looking one up.pages_get/pages_pull/pages_versionsnow say slugs cannot be guessed and point atpages_list. - Skill
superset:page: "Find a page and read it back" section replaces the incorrect comment; troubleshooting row for the guessed-slug symptom. - Docs: "Find a Page Later" section in
pages.mdx;pages_listrow inmcp-server.mdx.
Verification
bun testoverpackages/trpc/src/router/page,packages/mcp,packages/cli/src/commands/pages: 88 pass.tsc --noEmitclean inpackages/trpc,packages/mcp,packages/cli.bun run check:pluginspasses (thesupersetplugin is bundled, not marketplace-published, so no version bump applies).- Biome clean on changed files.
Follow-ups not in this PR
- The Slack agent allows
pages_listbut its system prompt says nothing about pages; the improved tool description is what it will see. page.liststill returns every row with signed view/thumbnail tickets and nolimit; fine for current org sizes, worth alimitwhen the list grows.
Summary by cubic
Fixes agent recall of published pages by making pages list discover all pages the agent can read and by guiding agents to list before fetching. Previously the CLI silently scoped to $SUPERSET_WORKSPACE_ID, so pages published from another workspace, machine, or session were invisible to agents while visible to the user. Now the command is org-wide by default, supports --search, and only scopes to a workspace when --workspace is passed. Search (case-insensitive, escaped LIKE) was added to page.list and the MCP pages_list tool, and MCP, skill, and docs guidance now instructs agents to find pages by name via list because slugs end in a random suffix and can't be guessed.
Migration
- Scripts that relied on the old default workspace scoping must pass
--workspaceexplicitly.
Summary by CodeRabbit
-
New Features
- Added page search across titles, descriptions, and slugs using the CLI and MCP tools.
- Added optional workspace filtering and organization-wide page listing.
- CLI results now show when pages were last updated.
-
Documentation
- Clarified how to find pages by name, retrieve their IDs or slugs, and use pages across workspaces and sessions.
- Documented that slugs include random suffixes and should not be guessed.