Skip to content

feat(integrations): let a host publish adapter-only connectors it drives itself - #3450

Merged
kwakayama merged 1 commit into
mainfrom
fix/promoted-adapter-integrations
Aug 7, 2026
Merged

feat(integrations): let a host publish adapter-only connectors it drives itself#3450
kwakayama merged 1 commit into
mainfrom
fix/promoted-adapter-integrations

Conversation

@kwakayama

@kwakayama kwakayama commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Hiding adapter-only connectors from every lookup removed the connector definitions out from under hosts that do implement the adapter.

veryfront-api ships a full Salesforce client (usecases/integrations/salesforce/api-client.ts — resolves instance_url from the token bundle, handles auth retry) and names salesforce in its promoted set. After 0.1.1209:

  • getConnector('salesforce') returns undefined even with the host's flag set
  • isKnownIntegrationToolName('salesforce__…') is false, so tool names stop resolving
  • requiresOAuthConnectionBinding('salesforce') silently becomes false

The integration stays connectable and the adapter still works, but it has no tools. A user who connected Salesforce and called a case tool two weeks ago cannot do so now.

What is not changing

The scaffolding guard is correct and stays exactly where it is. I initially tried widening isExperimentalIntegrationEnabled and it broke cli/commands/init/catalog.test.ts and cli/templates/integration-loader.test.ts — which is the guard doing its job. Generated routes run on the generic OAuth runtime, and that is precisely what cannot serve these connectors.

Unchanged, still refusing adapter-only connectors:

  • cli/commands/init/catalog.ts, cli/templates/integration-loader.ts, cli/mcp/tools/catalog-tools.ts
  • src/oauth/providers/common.ts visible-service filtering
  • the OAuthProvider constructor guard on runtimeSupport: "provider-adapter-required"

Those CLI tests pass unmodified in this PR, which is the clearest evidence the seam is right.

The change

Catalog lookup was the part that was too narrow, so it gets its own predicate.

getConnector, listConnectors and getIcon now use isCatalogVisibleIntegration, which is isVisibleIntegration plus isHostAdapterIntegration. The latter reads a new VERYFRONT_HOST_ADAPTER_INTEGRATIONS env var.

Deliberate properties:

  • Explicit names only. Blanket values (1, true, all, *) are ignored, so a sweep can never widen the surface by accident. Covered for all four forms.
  • Adapter-only connectors only. The predicate returns false for anything not in INTEGRATIONS_REQUIRING_PROVIDER_ADAPTER, so it cannot become a second general-purpose visibility flag.
  • Catalog only. Scaffolding and the generic OAuth runtime never consult it.

Tests

  • host-declared connector stays out of scaffolding visibility
  • host-declared connector is visible to catalog lookup, and an undeclared adapter-only connector (pipedrive) is not
  • blanket values ignored, all four forms
  • getConnector("salesforce") and getConnectorNames() include it under the declaration

Each confirmed to actually execute rather than silently skip.

Verification

  • deno task test:unit: 3811 passed, 0 failed
  • deno task verify:quick: exit 0 (full 22-task chain)

Follow-up

Consumers still need to opt in. veryfront-api will set VERYFRONT_HOST_ADAPTER_INTEGRATIONS=salesforce and restore its catalog expectations once this publishes. The other 11 adapter-only connectors stay hidden everywhere until some host declares an adapter for them.

Summary by CodeRabbit

  • New Features
    • Added support for explicitly declared host adapter integrations.
    • Declared integrations can now appear in catalog lookups and connector listings.
    • Catalog entries can be found by integration ID or name.
  • Bug Fixes
    • Prevented blanket environment values such as all, *, true, and 1 from enabling integrations.
    • Maintained scaffolding visibility rules so host-only integrations are not shown there.

…ves itself

Hiding adapter-only connectors from every lookup removed the connector
definitions out from under hosts that do implement the adapter. veryfront-api
ships a Salesforce client (instance_url resolution, auth retry) and names
salesforce in its promoted set, but 0.1.1209 stopped returning the connector, so
tool names no longer resolved and OAuth connection binding stopped being
required. The integration stayed connectable with no working tools.

The scaffolding guard itself is correct and stays exactly where it was.
`veryfront init` and the template loader must keep refusing these: generated
routes run on the generic OAuth runtime, which is precisely what cannot serve
them. The generic OAuthProvider constructor guard is untouched too.

Catalog lookup is the seam that was too narrow, so it gets its own predicate.
`getConnector`, `listConnectors` and `getIcon` now use
`isCatalogVisibleIntegration`, which additionally honours
`VERYFRONT_HOST_ADAPTER_INTEGRATIONS`. A host names each connector it actually
implements; blanket values are ignored, so a sweep can never widen the
scaffolding surface by accident.

Tested: full unit suite 3811 passed, 0 failed; verify:quick exit 0. The CLI
scaffolding tests that pin the guard pass unmodified, which is the point.
@kwakayama
kwakayama requested a review from kojiwakayama as a code owner August 7, 2026 06:24
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Host-declared adapter integrations can be explicitly enabled for catalog lookup and connector listing. Scaffolding visibility remains unchanged. Blanket environment values do not enable integrations. Tests cover feature flags and catalog APIs.

Changes

Host adapter catalog visibility

Layer / File(s) Summary
Adapter visibility rules
src/integrations/feature-flags.ts, src/integrations/feature-flags.test.ts
Adds explicit host adapter declarations, catalog visibility helpers, filtering by ID or name, and tests for declared and blanket values.
Catalog API integration
src/integrations/index.ts, src/integrations/index.test.ts
Updates connector lookup, listing, and icon retrieval to use catalog visibility. Tests verify declared Salesforce and undeclared Pipedrive behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: kojiwakayama

Sequence Diagram(s)

sequenceDiagram
  participant HostEnvironment
  participant FeatureFlags
  participant IntegrationCatalog
  HostEnvironment->>FeatureFlags: provide explicit adapter names
  FeatureFlags->>IntegrationCatalog: check catalog visibility
  IntegrationCatalog->>IntegrationCatalog: filter visible integrations
  IntegrationCatalog-->>HostEnvironment: return declared connector
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: allowing hosts to publish adapter-only connectors they implement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/promoted-adapter-integrations

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/index.test.ts`:
- Around line 57-62: Add an assertion in the host-declared integration test
around getConnector("salesforce") that getIcon("salesforce") returns a defined
icon, while retaining the existing connector and undeclared-adapter assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cfaead4-63e6-4452-b470-d2dd166a4f60

📥 Commits

Reviewing files that changed from the base of the PR and between 234efea and 3e6f1d7.

📒 Files selected for processing (4)
  • src/integrations/feature-flags.test.ts
  • src/integrations/feature-flags.ts
  • src/integrations/index.test.ts
  • src/integrations/index.ts

Comment on lines +57 to +62
Deno.env.set(HOST_ADAPTER_INTEGRATIONS_ENV, "salesforce");
try {
assertEquals(getConnector("salesforce") !== undefined, true);
assertEquals(getConnectorNames().includes("salesforce"), true);
// Adapter-only and not declared by the host, so still absent.
assertEquals(getConnector("pipedrive"), undefined);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Test host-declared icon lookup.

This test does not assert getIcon("salesforce"). A regression that keeps getIcon on generic visibility passes this test while declared host adapters cannot load their icon.

Proposed test update
     try {
       assertEquals(getConnector("salesforce") !== undefined, true);
+      assertEquals(getIcon("salesforce"), icons.salesforce);
       assertEquals(getConnectorNames().includes("salesforce"), true);

As per coding guidelines, "When public behavior changes, update the relevant documentation, examples, generated references, command help, and tests."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Deno.env.set(HOST_ADAPTER_INTEGRATIONS_ENV, "salesforce");
try {
assertEquals(getConnector("salesforce") !== undefined, true);
assertEquals(getConnectorNames().includes("salesforce"), true);
// Adapter-only and not declared by the host, so still absent.
assertEquals(getConnector("pipedrive"), undefined);
Deno.env.set(HOST_ADAPTER_INTEGRATIONS_ENV, "salesforce");
try {
assertEquals(getConnector("salesforce") !== undefined, true);
assertEquals(getIcon("salesforce"), icons.salesforce);
assertEquals(getConnectorNames().includes("salesforce"), true);
// Adapter-only and not declared by the host, so still absent.
assertEquals(getConnector("pipedrive"), undefined);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/integrations/index.test.ts` around lines 57 - 62, Add an assertion in the
host-declared integration test around getConnector("salesforce") that
getIcon("salesforce") returns a defined icon, while retaining the existing
connector and undeclared-adapter assertions.

Source: Coding guidelines

@kwakayama
kwakayama added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 5913778 Aug 7, 2026
31 checks passed
@kwakayama
kwakayama deleted the fix/promoted-adapter-integrations branch August 7, 2026 06:43
@kwakayama kwakayama mentioned this pull request Aug 7, 2026
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.

1 participant