Skip to content

refactor(agents): remove dead Vercel AI Gateway model catalog file #2477

@alexey-pelykh

Description

@alexey-pelykh

Context

RemoteClaw is middleware that delegates LLM execution to CLI agents (Claude Code, Gemini, Codex, OpenCode); it does not dispatch LLM calls itself. The CLI agents manage their own provider/model selection. Prior cleanup PRs removed ~80 files of dead model-management surface left over from the pre-fork embedded execution path. This issue addresses a survivor.

Problem

src/agents/vercel-ai-gateway.ts exposes two functions:

  • getStaticVercelAiGatewayModelCatalog() — hard-coded fallback model list + cost metadata (lines 10-180)
  • discoverVercelAiGatewayModels() — HTTP discovery with static-catalog fallback (lines 186-207)

Neither has any external caller. getStaticVercelAiGatewayModelCatalog is called only from within discoverVercelAiGatewayModels. discoverVercelAiGatewayModels is not imported anywhere outside its own file.

Verification (run against current main):

rg "discoverVercelAiGatewayModels\(" src/ --type ts
# Only match: the declaration at src/agents/vercel-ai-gateway.ts:186

rg "getStaticVercelAiGatewayModelCatalog" src/ --type ts
# Only matches: within src/agents/vercel-ai-gateway.ts itself

Other "vercel-ai-gateway" string references in the codebase are unrelated to this file and must be preserved:

  • src/auth/provider-auth.ts:276 — provider-name → env-var lookup (AI_GATEWAY_API_KEY). Kept.
  • src/agents/provider-utils.ts:152 — model-ID formatting for provider strings. Kept.
  • src/plugins/bundled-plugin-metadata.generated.ts:3063+ — metadata describing the bundled npm package @remoteclaw/vercel-ai-gateway-provider (an external plugin package, not this file). Kept.
  • src/agents/model-auth-env-vars.ts:34 — env-var mapping. Kept.
  • Tests referencing "vercel-ai-gateway" as provider string (session-utils tests). Kept.

Tasks

  • Delete src/agents/vercel-ai-gateway.ts
  • Delete companion test file src/agents/vercel-ai-gateway.test.ts if present
  • Remove any re-exports from barrel files (search src/agents/index.ts and similar for references)
  • Verify no remaining imports: rg "from.*vercel-ai-gateway\"" src/ should only return plugin-metadata generated file and external package references
  • Run tsc --noEmit and full test suite

Acceptance Criteria

  • File src/agents/vercel-ai-gateway.ts no longer exists
  • rg "getStaticVercelAiGatewayModelCatalog|discoverVercelAiGatewayModels" src/ returns no hits
  • rg "from.*[\"']\..*vercel-ai-gateway" src/ returns no hits (the generated plugin-metadata file references the external npm package, not this local file — that's fine)
  • tsc --noEmit clean
  • Existing test suite passes with no new skips

Metadata

Metadata

Assignees

Labels

gutRemoving dead upstream subsystems

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions