Add OpenPaths provider by lee101 · Pull Request #244 · autohandai/code-cli · GitHub
Skip to content

Add OpenPaths provider#244

Open
lee101 wants to merge 1 commit into
autohandai:mainfrom
lee101:openpaths-provider
Open

Add OpenPaths provider#244
lee101 wants to merge 1 commit into
autohandai:mainfrom
lee101:openpaths-provider

Conversation

@lee101

@lee101 lee101 commented Jun 16, 2026

Copy link
Copy Markdown

What

Adds OpenPaths as a first-class named provider. OpenPaths is an OpenAI-compatible model gateway (like OpenRouter), so it slots into the existing provider architecture and reuses the generic OpenAI-compatible client.

  • Base URL: https://openpaths.io/v1
  • Models endpoint: https://openpaths.io/v1/models
  • Default model: openpaths/auto (also openpaths/auto-code, -fast, -reasoning)
  • API key: OPENPATHS_API_KEY (key page: https://openpaths.io/account)

Changes

Additive and minimal — mirrors the OpenRouter wiring exactly across every parallel provider list.

  • src/types.ts: add 'openpaths' to ProviderName, add OpenPathsSettings, add openpaths? to AutohandConfig.
  • src/providers/OpenPathsProvider.ts: new provider (reuses the generic OpenAI-compatible client at the OpenPaths base URL; lists models from /v1/models with a static fallback).
  • src/providers/ProviderFactory.ts: case 'openpaths' + entries in getProviderNames() / isValidProvider().
  • src/config.ts: validProviders, isModernConfig, getProviderConfig (Record + api-key validation branch), defaultBaseUrlFor.
  • src/onboarding/setupWizard.ts & src/core/agent/ProviderConfigManager.ts: add openpaths entries to the exhaustive Record<ProviderName, ...> maps (required to keep typecheck green).
  • tests/providers/ProviderFactory.test.ts: coverage for openpaths (create configured / unconfigured, isValidProvider, updated getProviderNames ordering).

Testing

  • tsc --noEmit (typecheck): passes.
  • eslint on changed files: passes, no warnings.
  • vitest ProviderFactory + config suites: 41 passed.

Note: I've reviewed CONTRIBUTING.md and COMMERCIAL.md — there's no CLA/DCO requirement and the changes are additive under Apache-2.0. If you do require a contributor agreement, I'm happy to sign your CLA.

🤖 Generated with Claude Code

Add OpenPaths (https://openpaths.io), an OpenAI-compatible model gateway,
as a named provider. Mirrors the OpenRouter wiring exactly across the
parallel provider lists (types, factory, config arrays) and reuses the
generic OpenAI-compatible client.

- types: add 'openpaths' to ProviderName, OpenPathsSettings, AutohandConfig.openpaths
- providers: new OpenPathsProvider (base URL https://openpaths.io/v1, models endpoint /v1/models)
- factory: openpaths case + getProviderNames/isValidProvider entries
- config: validProviders, isModernConfig, getProviderConfig, defaultBaseUrlFor
- tests: ProviderFactory coverage for openpaths

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 047147c948

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat OpenPaths as an API-key provider during onboarding

When a new user selects OpenPaths in the setup wizard, requiresApiKey() still excludes openpaths, so onboarding skips promptApiKey()/validation and complete() writes only a model/baseUrl config. getProviderConfig() now requires an API key for openpaths, so the generated config is incomplete and OpenPaths requests run without authorization until the user hand-edits the config.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire OpenPaths into the interactive provider configurator

Adding openpaths to getProviderNames() exposes it in the interactive provider picker, but checked ProviderConfigManager.configureProvider() and there is no openpaths case; selecting it when unconfigured prints the setup message and then returns without prompting for a key/model. The same manager also omits it from the cloud/API-key provider checks, so a partial model-only config is treated as configured and never offers an API-key action.

Useful? React with 👍 / 👎.

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