Skip to content

[Export Audit] Dead re-exports in containers/api-proxy/providers/index.js: 5 individual adapter factories exported but never imported from ther [Content truncated due to length] #2775

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export

Summary

  • File: containers/api-proxy/providers/index.js
  • Symbols: createOpenAIAdapter, createAnthropicAdapter, createCopilotAdapter, createGeminiAdapter, createOpenCodeAdapter
  • Issue: Five individual adapter factory functions are re-exported from providers/index.js but no file ever imports them from that path. server.js imports only createAllAdapters, and every test file that needs individual adapters imports directly from the individual provider files.

Evidence

// containers/api-proxy/providers/index.js — current module.exports (lines 122–129)
module.exports = {
  createAllAdapters,        // ✅ used by server.js
  createOpenAIAdapter,      // ❌ nobody imports this from providers/index
  createAnthropicAdapter,   // ❌ nobody imports this from providers/index
  createCopilotAdapter,     // ❌ nobody imports this from providers/index
  createGeminiAdapter,      // ❌ nobody imports this from providers/index
  createOpenCodeAdapter,    // ❌ nobody imports this from providers/index
};
# server.js — only consumer of providers/index.js
containers/api-proxy/server.js:121:
  const { createAllAdapters } = require('./providers');

# Test files import individual adapters directly from provider files, NOT from index:
containers/api-proxy/server.test.js:
  const { createCopilotAdapter }   = require('./providers/copilot');
  const { createAnthropicAdapter } = require('./providers/anthropic');
  const { createOpenCodeAdapter }  = require('./providers/opencode');

containers/api-proxy/oidc-token-provider.test.js:220:
  const { createOpenAIAdapter } = require('./providers/openai');

# No file does: require('./providers').createOpenAIAdapter (etc.)
$ grep -rn "require.*['\"]\.\/providers['\"]" containers/api-proxy/ | grep -v node_modules
containers/api-proxy/server.js:121:const { createAllAdapters } = require('./providers');
# ← only one consumer, and it only destructures createAllAdapters

Recommended Fix

Narrow module.exports in providers/index.js to only expose createAllAdapters:

module.exports = {
  createAllAdapters,
};

Tests that need individual adapters should continue to import directly from the individual provider files (which is already what they do). This removes 5 dead re-exports without changing any production or test behaviour.

Impact

  • Dead code risk: Medium — the five extra exports widen the providers module's public contract, making it harder to safely rename or refactor individual adapter factories without worrying about external consumers of the index barrel.
  • Maintenance burden: Low — removing the re-exports is a one-line change with zero downstream impact given no file currently consumes them from providers/index.js.

Detected by Export Audit workflow. Triggered by push to main on 2026-05-08

Generated by API Surface & Export Audit · ● 886.6K ·

  • expires on Jun 7, 2026, 11:53 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions