fixup! Add pi support

This commit is contained in:
2026-07-22 11:00:04 +01:00
parent b5e3bcd301
commit 62debbfcda
5 changed files with 107 additions and 11 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ func zedLanguageModels(p *canonical.Profile) map[string]any {
for _, m := range p.Models {
me := map[string]any{
"name": m.ID,
"max_tokens": 200000,
"max_tokens": m.ContextLimit(),
"capabilities": map[string]any{
"tools": true,
"images": false,
+19
View File
@@ -63,6 +63,25 @@ func TestZedRenderProducesExpectedTargets(t *testing.T) {
assert.NotContains(t, parsed, "context_servers")
}
func TestZedRenderHonorsPerModelContext(t *testing.T) {
home := t.TempDir()
b := bundle()
b.Profile.Models = []canonical.Model{{ID: "big", Context: 262144}}
fs, err := New(WithHome(home)).Render(b)
require.NoError(t, err)
seen := map[string]adapter.File{}
fs.ForEach(func(f adapter.File) { seen[f.Dest] = f })
cfgDest := filepath.Join(home, ".config", "zed", "settings.json")
require.Contains(t, seen, cfgDest)
var parsed map[string]any
require.NoError(t, json.Unmarshal(seen[cfgDest].Content, &parsed))
models := parsed["language_models"].(map[string]any)["openai_compatible"].(map[string]any)["hs-llmgw-example-com"].(map[string]any)["available_models"].([]any)
assert.Equal(t, float64(262144), models[0].(map[string]any)["max_tokens"], "explicit context override should win")
}
func TestZedRenderMergesExistingKeys(t *testing.T) {
home := t.TempDir()
base := filepath.Join(home, ".config", "zed")