mirror of
https://github.com/lukaszraczylo/harness-sync.git
synced 2026-10-18 01:17:50 +00:00
feat: URL-derived provider keys (hs-<hostname>) + dedup providers sharing same gateway URL
- GatewayProviderKey() derives stable key from gateway URL hostname e.g. https://llmgw.h.raczylo.com/v1 → hs-llmgw-h-raczylo-com - AbsorbDuplicateProviders() merges providers sharing the same baseURL into our canonical entry; user-crafted model metadata wins for overlaps - kilo: renders to opencode.jsonc (primary config), deep-merges providers, deletes enabled_providers filter that was hiding our gateway - opencode: absorbs duplicate providers from existing config - All adapters use GatewayProviderKey() instead of hardcoded string - Fix goose URL doubling (was /v1/v1/chat/completions → /chat/completions) - Fix token propagation: api_key written directly (not env var ref) - Zed: adds prompt_cache_key capability, deletes context_servers key to avoid ContextServerSettingsContent serde untagged-enum parse error
This commit is contained in:
@@ -89,11 +89,9 @@ func (a *Adapter) Render(b *canonical.Bundle) (*adapter.FileSet, error) {
|
||||
mcps[s.Name] = e
|
||||
}
|
||||
|
||||
provKey := common.GatewayProviderKey(b.Profile.Gateway.URL)
|
||||
// inline model shorthand: "providerID/modelID"
|
||||
modelRef := ""
|
||||
if b.Profile.Gateway.DefaultModel != "" {
|
||||
modelRef = "harness-sync-gateway/" + b.Profile.Gateway.DefaultModel
|
||||
}
|
||||
modelRef := common.KiloModelString(&b.Profile)
|
||||
|
||||
cfg := map[string]any{
|
||||
"version": 8,
|
||||
@@ -108,8 +106,8 @@ func (a *Adapter) Render(b *canonical.Bundle) (*adapter.FileSet, error) {
|
||||
},
|
||||
"providers": common.ProvidersAsCagentMap(&b.Profile),
|
||||
"models": map[string]any{
|
||||
"harness-sync-gateway": map[string]any{
|
||||
"provider": "harness-sync-gateway",
|
||||
provKey: map[string]any{
|
||||
"provider": provKey,
|
||||
"model": b.Profile.Gateway.DefaultModel,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user