Commit Graph
9 Commits
Author SHA1 Message Date
lukaszraczylo 62debbfcda fixup! Add pi support 2026-07-22 11:00:04 +01:00
lukaszraczylo 6483eb8044 refactor: remove dead code, deduplicate defaultHome, simplify mcpEntry + kilo render
Dead code removed:
- BuildProviders, buildModels, ProviderEntry (no production callers)
- ZedLanguageModels (shadowed by adapter-local version, wrong schema)
- GatewayProviderID deprecated constant (zero references)
- Corresponding dead tests for BuildProviders

Deduplication:
- Extract common.DefaultHome() to internal/adapter/common/home.go
- All 7 adapters call common.DefaultHome() instead of local copies (-49 lines)

Simplification:
- mcp.go: merge MCPClaudeStyle/MCPCrushStyle branches (identical URL path,
  one-line difference in stdio path) — clearer intent, fewer lines
- kilo.go: extract opencode.jsonc merge to mergeOpenCodeJSONC() helper,
  Render() drops from 92 to ~55 lines
- goose.go: strings.IndexByte → strings.Cut in splitProviderModel
2026-05-23 21:22:49 +01:00
lukaszraczylo fb02b165d7 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
2026-05-23 21:13:16 +01:00
lukaszraczylo 77158d9f2b fix: propagate gateway token; kilo targets opencode.jsonc; goose URL + api_key fix 2026-05-23 21:12:47 +01:00
lukaszraczylo bde3128dba fix(zed): switch to language_models.openai_compatible for Agent panel visibility
The Zed Agent panel (new ACP-based UI) only discovers providers registered
under language_models.openai_compatible.<name>, not language_models.openai.
Each named entry appears as its own provider in the LLM Providers list.

- language_models.openai_compatible.harness-sync-gateway holds gateway URL + models
- agent.default_model.provider = 'harness-sync-gateway' (was 'openai')
- Model entries include capabilities {tools,images,parallel_tool_calls}
- Export common.GatewayProviderID so zed.go can reference it
- Fix staticcheck QF1001 (De Morgan's law) in io.go
- Fix struct field alignment in File (80→72 bytes)
- gofmt remaining files
2026-05-23 21:12:47 +01:00
lukaszraczylo fd97c60df2 fix(opencode/kilo): add top-level name + models Record to ProvidersAsMap
opencode/kilo require top-level 'name' and a 'models' Record<modelID,Model>
in each provider entry for the harness UI to enumerate and display models.
Without 'name', the gateway appears unlabelled; without 'models', the provider
shows no model list in the selector.
2026-05-23 21:12:46 +01:00
lukaszraczylo da49624b99 fix(adapters): emit correct provider/model schema per harness 2026-05-23 12:48:10 +01:00
lukaszraczylo 63bd976f4b fix(adapters): ground native schemas, merge-not-replace, add goose/cagent/zed
- common/mcp.go: MCPStyle enum + BuildMCPMapStyled for claude/crush/opencode/zed dialects
- common/jsonmerge.go: MergeJSONKeys (JSON-first, JSONC fallback) preserves user keys;
  fix: try plain json.Unmarshal before StripJSONComments to avoid mangling URLs with //
- common/yamlmerge.go: MergeYAMLKeys for YAML configs (goose)
- common/blocks.go: add ProvidersAsMap for opencode map-shaped provider key
- claudecode: merge settings.json (preserves hooks/permissions/env); MCPClaudeStyle (no type field)
- crush: fix mcp key (was mcpServers); MCPCrushStyle entries include type field; merge crush.json; fix import key mcp
- kilo: drop providers key (kilo has none); MCPOpencodeStyle (local/remote); merge kilo.json
- opencode: fix provider (singular map) + model (not default_model); MCPOpencodeStyle; merge jsonc; fix import key mcp
- goose: new adapter — YAML merge, extensions map, splitProviderModel, import reconstructs MCP from extensions
- cagent: new adapter — renders starter default.yaml, import returns empty
- zed: new adapter — merge settings.json, context_servers (MCPZedStyle) + agent.default_model
- docs: append Grounded harness schemas section to design spec
2026-05-23 03:23:02 +01:00
lukaszraczylo a18cb1a4b7 refactor(adapters): extract common helpers + fix kilo native schema 2026-05-23 03:06:35 +01:00