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
This commit is contained in:
2026-05-23 21:12:47 +01:00
parent fd97c60df2
commit bde3128dba
27 changed files with 345 additions and 117 deletions
+13
View File
@@ -41,6 +41,18 @@ func defaultHome() string {
// Name returns the harness identifier.
func (a *Adapter) Name() string { return name }
// Capabilities declares what crush harness-sync manages.
func (a *Adapter) Capabilities() adapter.HarnessCapabilities {
return adapter.HarnessCapabilities{
ManagesProviders: true,
ManagesModels: true,
ManagesMCP: true,
ManagesSkills: true,
ManagesInstructions: false,
HasBuiltInSub: false,
}
}
// Detect returns true when ~/.config/crush exists.
func (a *Adapter) Detect() bool {
_, err := os.Stat(filepath.Join(a.home, ".config", "crush"))
@@ -69,6 +81,7 @@ func (a *Adapter) Render(b *canonical.Bundle) (*adapter.FileSet, error) {
if roleModels := common.CrushRoleModels(&b.Profile); len(roleModels) > 0 {
overlay["models"] = roleModels
}
overlay["default_model"] = b.Profile.Gateway.DefaultModel
if mcp := common.BuildMCPMapStyled(&b.MCP, common.MCPCrushStyle); len(mcp) > 0 {
overlay["mcp"] = mcp
}
+2 -2
View File
@@ -53,8 +53,8 @@ func TestCrushRenderProducesExpectedTargets(t *testing.T) {
assert.Contains(t, models, "large")
assert.Contains(t, models, "small")
assert.Contains(t, models, "title")
// Must NOT write "default_model" or "mcpServers".
assert.NotContains(t, parsed, "default_model")
// Must write "default_model" (prevents Bedrock fallback) but NOT "mcpServers".
assert.Contains(t, parsed, "default_model")
assert.NotContains(t, parsed, "mcpServers")
}