Skip to content

Persist provider connections with recoverable legacy route projection #6367

Description

@atomantic

Decision: docs/plans/2026-09-06-provider-connections-and-harnesses.md (planning issue #6359). Retain executable provider IDs for all saved selections; durable connection IDs are management-only. This is implementation work, separate from the planning deliverable.

Implement DB-primary ai_connections, ai_harness_bindings and ai_route_bindings, using the preview adapters. Inject host persistence into the self-contained toolkit. Keep providers.json as a fully materialized executable compatibility artifact and existing flat APIs operational.

Areas: server/lib/aiToolkit/providers.js, server/services/providers.js, server/routes/providers.js, scripts/migrations/, DB schema/store adapters, docs/STORAGE.md.

Acceptance:

  • Input-gated migration imports all custom/disabled routes; proven siblings get OR enabled and union catalogs without altering pins, arguments, secrets, consent, defaults, activeProvider or fallback IDs.
  • No derived reference seed; protect any derived file through migrationOwnedPaths if introduced.
  • Serialize legacy and graph writes; pending projection snapshots/revisions recover interrupted DB/file writes without overwriting externally changed values.
  • Old-client connection edits detach affected bindings, mode edits remain route-specific, deletion does not resurrect records.
  • Downgrade-edit-reupgrade reconciliation runs independently of applied-list migration; test actual prior-release reader/writer behavior and partial backup restore.
  • Private DB records/snapshots remain machine-local and included in backup; sanitized DTOs and peer/status responses expose no graph secrets.
  • DB-backed tests use portos_test only; no generation on import/start/save.
  • Linking UI is excluded; service link/unlink validation and projection contracts are included.

Part of #6359
The parent is a completed planning deliverable, not an implementation epic; do not reopen it.

Blocked by #6366

Review clarifications: Bindings include revision and variantKey. Enforce unique (binding_id, mode) and (connection_id, harness_id, variant_key), with a partial uniqueness index for null-harness API bindings. Import custom same-mode routes as distinct labeled variants; never merge away executable IDs. Link validates revisions for binding, source connection and target connection; unlink validates binding and source. On downgrade reconciliation, remove route-binding rows for deleted providers without resurrecting them; saved pins remain unresolved and empty connections await explicit cleanup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on another issue/PR — skip in autonomous claim runsplanTracked by /do:replanplanner:gpt-6-astraPlan authored by the gpt-6-astra model

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions