Back to Onyx

Part 5: Demo Data & Connector Cleanup — Implementation Plan

docs/craft/features/search/5-demo-data-cleanup.md

4.0.0-cloud.26.9 KB
Original Source

Part 5: Demo Data & Connector Cleanup — Implementation Plan

Parent design: search-design.md (Part 4 follow-up)

Objective

Remove the demo data feature and the Craft-specific connector configuration UI. Users connect data sources via the standard admin connectors page. Ships as a single PR.

Parts 1–4 are complete. The sandbox now uses onyx-cli search for knowledge access (Part 4). The old file-sync infrastructure is removed (PR 3). User library files are delivered via S3 sync (PR 4). What remains is cleanup: the demo data toggle, the Craft connector config UI, and the FILE_SYSTEM processing mode bug.


Current State

  • Craft connector UI: The configure page has its own OAuth/credential flow (ConfigureConnectorModal, CredentialStep, ConnectorCard, etc.) that creates connectors with FILE_SYSTEM processing mode. These connectors are not searchableFILE_SYSTEM bypasses Vespa indexing.
  • Demo data: demo_data.zip was deleted from the Docker image in PR 3, but the frontend toggle ("Use Demo Dataset"), cookie (build_demo_data_enabled), and the demo_data_enabled column on BuildSession still exist. The only remaining backend effect of use_demo_data is gating org_info/ setup and excluding user context from AGENTS.md.
  • org_info/: Created when use_demo_data=True with demo persona info (user identity, org structure). Backed by persona_mapping.py and the onboarding flow that collects user_work_area/user_level.
  • Path sanitizer: Test cases reference files/ paths that no longer exist in sessions.

Decisions

DecisionRationale
Drop demo_data_enabled column in the same PR as code removalAccepted rolling deploy risk. Deploy atomically.
Keep onboarding persona flow (craft/onboarding/, persona_mapping.py)Useful for personalization. Decouple from demo data — always pass user_work_area/user_level.
Keep user_work_area/user_level on APIStill used by onboarding, no longer gated behind demo flag.
Remove GET /api/build/connectors endpointOnly served the Craft connector UI being deleted.
Leave FILE_SYSTEM in ProcessingMode enum with deprecation commentExisting rows may reference it. Separate cleanup script later.
Old FILE_SYSTEM connectors out of scopeDozens on cloud. Prefer deletion over conversion. Separate script.

Implementation

1. Remove Craft connector UI

Replace the connector configuration section with a "Connect your data" link to the admin connectors page.

ActionFile
Deletecraft/v1/configure/components/ConfigureConnectorModal.tsx
Deletecraft/v1/configure/components/ConnectorCard.tsx
Deletecraft/v1/configure/components/ConnectorConfigStep.tsx
Deletecraft/v1/configure/components/CredentialStep.tsx
Deletecraft/v1/configure/components/CreateCredentialInline.tsx
Deletecraft/v1/configure/components/ComingSoonConnectors.tsx
Deletecraft/v1/configure/components/RequestConnectorModal.tsx
Deletecraft/v1/configure/components/ConfigureOverlays.tsx
Deletecraft/v1/configure/utils/createBuildConnector.ts
Deletecraft/hooks/useBuildConnectors.ts
Modifycraft/v1/configure/page.tsx — remove connector cards, keep LLM + user library + persona. Add "Connect your data" link. Add standalone User Library trigger (was on CraftFile connector card).
Modifycraft/components/ConnectDataBanner.tsx — replace with link to admin connectors page
Modifycraft/components/ConnectorBannersRow.tsx — same
Modifycraft/services/apiServices.ts — remove deleteConnector()
Modifyweb/src/lib/swr-keys.ts — remove buildConnectors key

2. Remove Craft connector backend

ActionFile
Delete or gutbackend/onyx/server/features/build/api/api.py — remove GET /api/build/connectors
Modifybackend/onyx/server/features/build/api/models.py — remove BuildConnectorStatus, BuildConnectorInfo, BuildConnectorListResponse
Modifybackend/onyx/db/enums.py — add deprecation comment to FILE_SYSTEM
Modifyweb/src/lib/types.ts — remove FILE_SYSTEM from TS ProcessingMode type

3. Remove demo data frontend

ActionFile
Deletecraft/v1/configure/components/DemoDataConfirmModal.tsx
Modifycraft/v1/constants.ts — remove cookie functions
Modifycraft/v1/configure/page.tsx — remove demo data state, toggle, auto-enable
Modifycraft/services/apiServices.ts — remove demoDataEnabled from session creation
Modifycraft/components/InputBar.tsx — remove demoDataEnabled from callback, remove pill
Modifycraft/components/ChatPanel.tsx — remove unused demoDataEnabled param
Modifycraft/components/BuildWelcome.tsx — remove demoDataEnabled from callback
Modifycraft/hooks/useBuildSessionStore.ts — remove demoDataEnabled from state

4. Remove demo data backend

Decouple org_info/ from demo data: always set up when user_work_area is provided.

ActionFile
Modifysandbox/base.py — remove use_demo_data from setup_session_workspace(), restore_snapshot()
Modifysandbox/kubernetes/kubernetes_sandbox_manager.py — remove use_demo_data, always set up org_info when work_area provided
Modifysandbox/local/local_sandbox_manager.py — same
Modifysandbox/manager/directory_manager.py — remove use_demo_data from setup_agent_instructions()
Modifysandbox/util/agent_instructions.py — remove use_demo_data, include_org_info. Always include user context.
Modifysession/manager.py — remove demo_data_enabled. Always pass user_work_area/user_level.
Modifyapi/sessions_api.py — remove demo_data_enabled gating
Modifyapi/models.py — remove demo_data_enabled from SessionCreateRequest
Modifydb/build_session.py — remove demo_data_enabled from create/query
Modifydb/models.py — remove demo_data_enabled from BuildSession
Migrationalembic/ — drop demo_data_enabled column

Keep: persona_mapping.py, craft/onboarding/, user_work_area/user_level.

5. Path sanitizer cleanup

ActionFile
Modifycraft/utils/pathSanitizer.test.ts — replace files/ paths with user_library/
Modifycraft/utils/pathSanitizer.ts — update stale comment

File changes summary

~40 files: ~12 deletions, ~25 modifications, 1 migration.

Tests

  • New connectors use REGULAR processing mode and are searchable
  • Session creation works without demo_data_enabled
  • org_info/ created when user_work_area provided (no demo flag)
  • Configure page renders: LLM selection, user library, "Connect your data" link
  • Banners link to admin connectors page
  • Path sanitizer tests pass