Skip to content

feat(config): AnthropicCompatible provider type + custom headers (#83)#299

Merged
quangdang46 merged 1 commit into
masterfrom
feat/anthropic-compatible-provider-type
May 24, 2026
Merged

feat(config): AnthropicCompatible provider type + custom headers (#83)#299
quangdang46 merged 1 commit into
masterfrom
feat/anthropic-compatible-provider-type

Conversation

@quangdang46
Copy link
Copy Markdown
Owner

Gap close: upstream PR 1jehuang/jcode#94 (open) added an AnthropicCompatible provider variant + custom headers field on NamedProviderConfig. Master had neither.

[providers.my-bedrock]
type = 'anthropic-compatible'
base_url = 'https://corp-bedrock.example/v1/messages'
headers = { 'X-Tenant' = 'team-foo', 'X-Project' = 'jcode' }

Schema additions

  • NamedProviderType::AnthropicCompatible (with kebab + snake-case aliases)
  • NamedProviderConfig.headers: BTreeMap<String, String>

Out of scope (#83 follow-up)

  • CLI flag jcode provider add --header KEY=VALUE (additive)
  • CLI flag jcode provider add --type anthropic-compatible
  • Wire AnthropicCompatible into provider dispatcher (needs Messages API client similar to anthropic.rs)
  • Header injection in AnthropicProvider request builder

Refs upstream PR 1jehuang/jcode#94, fork #83.

Gap close: upstream PR 1jehuang#94 (open) added an
AnthropicCompatible provider variant + custom headers field on
NamedProviderConfig. Master had neither.

This PR ports the schema-only minimal layer:

  [providers.my-bedrock]
  type = 'anthropic-compatible'
  base_url = 'https://corp-bedrock.example/v1/messages'
  headers = { 'X-Tenant' = 'team-foo', 'X-Project' = 'jcode' }

Schema additions:
- NamedProviderType::AnthropicCompatible
- NamedProviderConfig.headers: BTreeMap<String, String>

Out of scope (#83 follow-up):
- CLI flag  (additive)
- CLI flag
- Wire AnthropicCompatible into provider dispatcher (currently
  routes through OpenAI-compat path; new variant will need its own
  Messages API client similar to anthropic.rs)
- Header injection in AnthropicProvider request builder

Refs upstream PR 1jehuang#94, fork #83.
@quangdang46 quangdang46 merged commit b136c8a into master May 24, 2026
@quangdang46 quangdang46 deleted the feat/anthropic-compatible-provider-type branch May 24, 2026 22:10
quangdang46 added a commit that referenced this pull request May 24, 2026
After merging 13 PRs in sequence (#290 + #292-#303), two squash-merges
collided on shared schema state:

1. crates/jcode-provider-metadata/src/catalog.rs:
   - Both VERTEX_AI (#283, prior) and BIGMODEL (#297) added entries.
   - Both #19 (#263 GitLab Duo, prior) and #297 declared array size,
     each thinking they were +1 from baseline. Net actual: +2 from
     baseline but final declared count was off by 1.
   - Fixed: OPENAI_COMPAT_PROFILES 35→36, LOGIN_PROVIDERS 48→49 to
     match actual entry count.

2. src/cli/commands/provider_setup.rs:
   - PR #299 added headers: BTreeMap<String, String> field to
     NamedProviderConfig but didn't update this constructor (which
     pre-dated #299 in master).
   - Fixed: added headers: BTreeMap::new() in the configure
     constructor.

cargo check -p jcode --bin jcode now clean. No behavioral change
beyond what each PR brought.
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