Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into feat/delete-session…
…-tui
  • Loading branch information
artem-obukhov committed Jun 27, 2025
commit e0f60021fa60991b8916861ac06d178e5ac24f7b
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ Thumbs.db
.opencode/

opencode
<<<<<<< HEAD
.aider*
=======
opencode.md
>>>>>>> upstream/main
6 changes: 3 additions & 3 deletions internal/llm/models/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func listLocalModels(modelsEndpoint string) []localModel {
"error", err,
"endpoint", modelsEndpoint,
)
return nil
return []localModel{}
}
defer res.Body.Close()

Expand All @@ -116,7 +116,7 @@ func listLocalModels(modelsEndpoint string) []localModel {
"status", res.StatusCode,
"endpoint", modelsEndpoint,
)
return nil
return []localModel{}
}

var modelList localModelList
Expand All @@ -125,7 +125,7 @@ func listLocalModels(modelsEndpoint string) []localModel {
"error", err,
"endpoint", modelsEndpoint,
)
return nil
return []localModel{}
}

var supportedModels []localModel
Expand Down
14 changes: 14 additions & 0 deletions internal/llm/models/models.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package models

import "maps"

type (
ModelID string
ModelProvider string
Expand Down Expand Up @@ -82,3 +84,15 @@ var SupportedModels = map[ModelID]Model{
CostPer1MOut: 15.0,
},
}

func init() {
maps.Copy(SupportedModels, AnthropicModels)
maps.Copy(SupportedModels, OpenAIModels)
maps.Copy(SupportedModels, GeminiModels)
maps.Copy(SupportedModels, GroqModels)
maps.Copy(SupportedModels, AzureModels)
maps.Copy(SupportedModels, OpenRouterModels)
maps.Copy(SupportedModels, XAIModels)
maps.Copy(SupportedModels, VertexAIGeminiModels)
maps.Copy(SupportedModels, CopilotModels)
}
10 changes: 9 additions & 1 deletion internal/llm/provider/anthropic.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,16 @@ func (a *anthropicClient) stream(ctx context.Context, messages []message.Message
var sessionId string
requestSeqId := (len(messages) + 1) / 2
if cfg.Debug {
if sid, ok := ctx.Value(toolsPkg.SessionIDContextKey).(string); ok {
sessionId = sid
}
jsonData, _ := json.Marshal(preparedMessages)
logging.Debug("Prepared messages", "messages", string(jsonData))
if sessionId != "" {
filepath := logging.WriteRequestMessageJson(sessionId, requestSeqId, preparedMessages)
logging.Debug("Prepared messages", "filepath", filepath)
} else {
logging.Debug("Prepared messages", "messages", string(jsonData))
}
}
attempts := 0
eventChan := make(chan ProviderEvent)
Expand Down
30 changes: 26 additions & 4 deletions opencode-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"azure.o3-mini",
"azure.gpt-4.1-mini",
"openrouter.gpt-4.1-mini",
"openrouter.o1-pro",
"openrouter.claude-3.7-sonnet",
"claude-3.5-sonnet",
"gemini-2.5-flash",
Expand All @@ -79,7 +78,19 @@
"claude-3.7-sonnet",
"qwen-qwq",
"openrouter.deepseek-r1-free",
"gemini-2.0-flash-lite"
"gemini-2.0-flash-lite",
"openrouter.o1-pro",
"copilot.gpt-4o",
"copilot.gpt-4o-mini",
"copilot.gpt-4.1",
"copilot.claude-3.5-sonnet",
"copilot.claude-3.7-sonnet",
"copilot.claude-sonnet-4",
"copilot.o1",
"copilot.o3-mini",
"copilot.o4-mini",
"copilot.gemini-2.0-flash",
"copilot.gemini-2.5-pro"
],
"type": "string"
},
Expand Down Expand Up @@ -169,7 +180,6 @@
"azure.o3-mini",
"azure.gpt-4.1-mini",
"openrouter.gpt-4.1-mini",
"openrouter.o1-pro",
"openrouter.claude-3.7-sonnet",
"claude-3.5-sonnet",
"gemini-2.5-flash",
Expand All @@ -180,7 +190,19 @@
"claude-3.7-sonnet",
"qwen-qwq",
"openrouter.deepseek-r1-free",
"gemini-2.0-flash-lite"
"gemini-2.0-flash-lite",
"openrouter.o1-pro",
"copilot.gpt-4o",
"copilot.gpt-4o-mini",
"copilot.gpt-4.1",
"copilot.claude-3.5-sonnet",
"copilot.claude-3.7-sonnet",
"copilot.claude-sonnet-4",
"copilot.o1",
"copilot.o3-mini",
"copilot.o4-mini",
"copilot.gemini-2.0-flash",
"copilot.gemini-2.5-pro"
],
"type": "string"
},
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.