mirror of
https://github.com/lukaszraczylo/harness-sync.git
synced 2026-10-12 00:45:22 +00:00
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
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/lukaszraczylo/harness-sync/internal/adapter"
|
|
"github.com/lukaszraczylo/harness-sync/internal/canonical"
|
|
)
|
|
|
|
type detectableAdapter struct {
|
|
name string
|
|
detect bool
|
|
}
|
|
|
|
func (d *detectableAdapter) Name() string { return d.name }
|
|
func (d *detectableAdapter) Detect() bool { return d.detect }
|
|
func (d *detectableAdapter) Render(_ *canonical.Bundle) (*adapter.FileSet, error) {
|
|
return adapter.NewFileSet(), nil
|
|
}
|
|
func (d *detectableAdapter) Import(_ string) (*adapter.ImportResult, error) {
|
|
return &adapter.ImportResult{}, nil
|
|
}
|
|
func (d *detectableAdapter) Capabilities() adapter.HarnessCapabilities {
|
|
return adapter.HarnessCapabilities{ManagesMCP: true}
|
|
}
|
|
|
|
func TestDetectCommandPrintsList(t *testing.T) {
|
|
reg := adapter.NewRegistry()
|
|
reg.Register(&detectableAdapter{name: "yes", detect: true})
|
|
reg.Register(&detectableAdapter{name: "no", detect: false})
|
|
|
|
var buf bytes.Buffer
|
|
cmd := NewDetect(reg)
|
|
cmd.SetOut(&buf)
|
|
require.NoError(t, cmd.Execute())
|
|
|
|
out := buf.String()
|
|
assert.Contains(t, out, "yes")
|
|
assert.Contains(t, out, "no")
|
|
assert.Contains(t, out, "detected")
|
|
assert.Contains(t, out, "not detected")
|
|
}
|