mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-01 00:27:30 +00:00
feat(opencode): add OpenCode platform with Zen and GO account types
Keep the internal platform ID opencode_go. Product surface is OpenCode with account_mode zen|go, model-aware routing across Chat Completions, Responses, and Anthropic Messages, and X-OpenCode-Session derived from prompt_cache_key / metadata.user_id so prompt cache can hit. Unmatched models fall back to /v1/chat/completions. Related to #6742.
This commit is contained in:
@@ -270,7 +270,7 @@ func TestDatabaseConnectionUsesConfiguredTargetBeforeBootstrapDatabase(t *testin
|
||||
if err != nil {
|
||||
t.Fatalf("sqlmock.New() error = %v", err)
|
||||
}
|
||||
defer targetDB.Close()
|
||||
defer func() { _ = targetDB.Close() }()
|
||||
|
||||
var opened []string
|
||||
openDatabase := func(_ *DatabaseConfig, dbName string) (*sql.DB, error) {
|
||||
@@ -292,12 +292,12 @@ func TestDatabaseConnectionUsesLegacyBootstrapOnlyForMissingTarget(t *testing.T)
|
||||
if err != nil {
|
||||
t.Fatalf("sqlmock.New() bootstrap error = %v", err)
|
||||
}
|
||||
defer bootstrapDB.Close()
|
||||
defer func() { _ = bootstrapDB.Close() }()
|
||||
targetDB, _, err := sqlmock.New()
|
||||
if err != nil {
|
||||
t.Fatalf("sqlmock.New() target error = %v", err)
|
||||
}
|
||||
defer targetDB.Close()
|
||||
defer func() { _ = targetDB.Close() }()
|
||||
|
||||
bootstrapMock.ExpectQuery(`SELECT EXISTS\(SELECT 1 FROM pg_database WHERE datname = \$1\)`).
|
||||
WithArgs(cfg.DBName).
|
||||
|
||||
Reference in New Issue
Block a user