---
date: 2026-04-20
topic: remove-admin-connectors
---

# Remove Admin Connectors

## Problem Frame

The admin app at `apps/admin/src/routes/_authed/_tenant/connectors/` exposes a "Connectors" page that wraps the `connect_providers` + `webhooks` (target_type='task') tables — originally built so a tenant admin could enable an external task provider (external provider was the only real one), copy a signed webhook URL, and paste it into the provider's dashboard.

Two things have changed:

1. **The backend is already gone.** The REST endpoints the page calls (`/api/task-connectors`, `/api/task-connectors/:slug`, `/api/task-connectors/:slug/generate-secret`) were removed in commit `c4b92d2` ("Phase C: remove Task concept from ThinkWork backend") on 2026-04-18 as part of the SDK pivot. The terraform routes were stripped in commit `81406b5`, so external callers already 404 at API Gateway. The page itself errors on load — it is a zombie UI.
2. **The strategic direction moved on.** The internal Task concept was retired in favor of the `@thinkwork/react-native-sdk` direction, and per established preference (`feedback_user_opt_in_over_admin_config`), per-tenant integration setup belongs in mobile self-serve, not admin.

Continuing to ship the page is strictly negative: tenants see a broken admin surface, the sidebar suggests a capability that does not exist, and the underlying concept has been replaced.

## Requirements

**Admin UI removal**
- R1. Delete the two route files at `apps/admin/src/routes/_authed/_tenant/connectors/index.tsx` and `apps/admin/src/routes/_authed/_tenant/connectors/$slug.tsx`.
- R2. Remove the "Connectors" entry from the admin sidebar in `apps/admin/src/components/Sidebar.tsx`.
- R3. After R1, run `pnpm --filter admin build` (or start the admin dev server) so TanStackRouterVite regenerates `apps/admin/src/routeTree.gen.ts` with the connectors route removed; commit the regenerated file. (The file is auto-generated by the Vite plugin — do not hand-edit it.)

**Build + infra cleanup**
- R4. Remove the `task-connectors` Lambda entry (and any related references) from `scripts/build-lambdas.sh` so we stop trying to build a handler that no longer exists.
- R5. After the cleanup, `grep -rEi 'task-connectors|task_connectors|hasTaskConnector|activeTaskConnectors'` across `apps/`, `packages/`, `scripts/`, `terraform/`, and `docs/` returns no remaining matches outside historical plan archives. (`terraform/` was already stripped in commit `81406b5`; include it in the check for completeness.)

**Documentation**
- R6. Within `docs/src/content/docs/concepts/connectors/`, remove **only** `external-tasks.mdx`. Keep `integrations.mdx` (documents live OAuth/webhook integration model — Slack, GitHub, Google) and `mcp-tools.mdx` (documents MCP tooling, which remains live). The Astro build will regenerate `docs/dist/` automatically on the next CI publish; no manual `dist/` deletion required.
- R7. Remove `docs/src/content/docs/guides/external-tasks.mdx`, `docs/src/content/docs/applications/mobile/external-tasks.mdx`, and `docs/src/content/docs/applications/admin/connectors.mdx` (the admin-app page that documents the zombie routes and `/api/task-connectors` endpoints).
- R8. Sweep cross-references and nav: remove the `applications/admin/connectors` entry from `docs/astro.config.mjs`; update `docs/src/content/docs/concepts/connectors.mdx` (parent overview), `docs/src/content/docs/architecture.mdx`, `docs/src/content/docs/concepts/agents.mdx`, `docs/src/content/docs/concepts/threads/routing-and-metadata.mdx`, `docs/src/content/docs/index.mdx`, `docs/src/content/docs/applications/mobile/index.mdx`, `docs/src/content/docs/applications/mobile/threads-and-chat.mdx`, and `docs/src/content/docs/roadmap.mdx` so no live page links to a removed page.

**Schema documentation hygiene**
- R9. Update inline schema comments in `packages/database-pg/src/schema/webhooks.ts` (target_type `// agent | routine | task`) and `packages/database-pg/src/schema/webhook-deliveries.ts` (target_type `// agent | routine | task | null`) to drop `task` from the documented options, so the schema self-documentation stays truthful post-cleanup.

**Mobile dead-code cleanup**
- R10. Remove the dead task-connector branches in mobile: `hasTaskConnector` and `activeTaskConnectors` exports from `apps/mobile/lib/hooks/use-connections.ts`, and any UI in `apps/mobile/app/settings/integrations.tsx` (and the `apps/mobile/app/settings/connectors.tsx` re-export) that gates on them. After R6–R8 land in the docs and R1–R3 land in admin, these branches can never be true at runtime.

## Success Criteria

- Visiting `/connectors` in the admin app produces a 404 from the route tree (the route no longer exists), not a runtime fetch error.
- The admin sidebar no longer offers a Connectors entry.
- `pnpm build` (admin + lambdas) succeeds with no references to `task-connectors`.
- The docs site builds cleanly with no broken internal links to removed pages.
- The R5 grep returns no live-code matches.
- OAuth sign-in (Google) and existing mobile MCP server connections still work end-to-end after the PR merges.

## Scope Boundaries

- **Out of scope: data deletes of any kind.** Stale `webhooks` rows with `target_type='task'` and the `connect_providers` row(s) with `provider_type='task'` are left in place. They have no consumer (UI is being deleted, API Gateway already 404s, no runtime reads them), so they sit harmless. `webhook_deliveries` ages out via the existing 90-day retention sweep. A future opportunistic cleanup can drop them; this PR does not.
- **Out of scope: schema changes.** `connect_providers`, `connections`, `credentials` tables stay because OAuth + MCP depend on them.
- **Out of scope: any new replacement UI.** The current external-task ingress surface is being retired — see Key Decisions for the framing.
- **Out of scope: generic webhook admin** (`webhooks-admin.ts` and the `/webhooks` admin route) — that surface is unrelated and stays.
- **Out of scope:** `seeds/eval-test-cases/*.json` references to "connectors" — scenario fixtures, not runtime.
- **Out of scope:** archived plans under `docs/plans/archived/` — historical, stay as-is.

## Key Decisions

- **No data deletes.** Original draft proposed deleting stale `webhooks` and `connect_providers` rows. Reviewer pass surfaced an FK trap (`connect_providers.id` is referenced by `connections.provider_id`, `webhooks.connect_provider_id`, and `webhook_deliveries.provider_id` with no `onDelete` rule — Postgres default `NO ACTION` would block the DELETE). Combined with the fact that API Gateway already 404s the routes, deleting the rows is cosmetic, not a correctness or security fix. The cosmetic value does not justify running raw DELETEs against tables shared with OAuth + MCP. **Decision: do nothing to the data in this PR.**
- **External-task ingress is parked, not killed.** The current admin surface is removed because the backend is gone. We are *not* claiming the platform will never accept partner-initiated task ingestion again — if a partner like external provider re-enters the picture, the right home is mobile self-serve (per `feedback_user_opt_in_over_admin_config`) using the preserved `connect_providers`/`connections`/`credentials` schema, not a re-resurrected admin page. No design work is committed to here, but the door is left open.
- **Drop public docs as well as UI.** The concept is gone, not just the surface; leaving "Connectors" in the public docs site would confuse readers and leak into search results. This is a deliberate positioning move (the external-developer surface is the SDK, not an integration hub), not just hygiene.
- **No deprecation period.** The endpoints are already deleted; a deprecation banner on a page that already errors is meaningless.

## Dependencies / Assumptions

- Assumes the admin sidebar entry is statically defined in `Sidebar.tsx` and not dynamically derived from a config — confirmed by file path in repo.
- Assumes no production tenant is currently relying on a external provider webhook delivery (memory: dev-only PAT integration). Even if one were, they already get 404s from API Gateway today, so this PR does not change their reality.

## Outstanding Questions

### Resolve Before Planning

(none — proceed to `/ce:plan`)

### Deferred to Planning

- [Affects R8][Needs research] Confirm during planning whether `docs/src/content/docs/guides/connectors.mdx` (a generic connectors guide) was task-connector-specific or covers Slack/GitHub/Google connectors generically. If task-connector-specific, add it to R7's deletion list; otherwise leave it.
- [Affects R10][Technical] Confirm whether `apps/mobile/app/settings/connectors.tsx` is a re-export of `integrations.tsx` (per earlier exploration) or has its own implementation. Adjust the deletion accordingly.

## Next Steps

-> `/ce:plan` for structured implementation planning
