| 1 | package anthropic |
| 2 | |
| 3 | import ( |
| 4 | "bytes" |
| 5 | "context" |
| 6 | "encoding/json" |
| 7 | "reasonix/internal/provider" |
| 8 | "testing" |
| 9 | ) |
| 10 | |
| 11 | func TestOpenCodeGoDeepSeekWireKeepsReasoningAndStableHistory(t *testing.T) { |
| 12 | for _, model := range []string{"deepseek-v4-flash", "deepseek-v4-pro", "deepseek-v4-flash-vision-exp"} { |
| 13 | p, err := New(provider.Config{BaseURL: "https://opencode.ai/zen/go", Model: model, Extra: map[string]any{"request_url": "https://opencode.ai/zen/go/v1/messages", "thinking": "enabled", "effort": "max"}}) |
| 14 | if err != nil { |
| 15 | t.Fatal(err) |
| 16 | } |
| 17 | c := p.(*client) |
| 18 | req := provider.Request{Messages: []provider.Message{{Role: provider.RoleUser, Content: "fixture"}, {Role: provider.RoleAssistant, ReasoningContent: "provider-reasoning", ToolCalls: []provider.ToolCall{{ID: "call-1", Name: "read_file", Arguments: "{}"}}}, {Role: provider.RoleTool, ToolCallID: "call-1", Content: "tool-result"}}, MaxTokens: 128} |
| 19 | first, _ := json.Marshal(c.buildRequest(context.Background(), req)) |
| 20 | second, _ := json.Marshal(c.buildRequest(context.Background(), req)) |
| 21 | if !bytes.Equal(first, second) || !bytes.Contains(first, []byte(`"effort":"max"`)) || !bytes.Contains(first, []byte(`"thinking":"provider-reasoning"`)) { |
| 22 | t.Fatalf("%s lost effort/replay/cache stability: %s", model, first) |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |