| 1 | package responses |
| 2 | |
| 3 | import ( |
| 4 | "bytes" |
| 5 | "encoding/json" |
| 6 | "reasonix/internal/provider" |
| 7 | "testing" |
| 8 | ) |
| 9 | |
| 10 | func TestOpenCodeGoDeepSeekWireKeepsReasoningAndStableHistory(t *testing.T) { |
| 11 | for _, model := range []string{"deepseek-v4-flash", "deepseek-v4-pro", "deepseek-v4-flash-vision-exp"} { |
| 12 | c := New(Config{BaseURL: "https://opencode.ai/zen/go/v1", RequestURL: "https://opencode.ai/zen/go/v1/responses", Model: model, Effort: "max", Mode: "stateless"}).(*client) |
| 13 | 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} |
| 14 | a, _, _ := c.buildRequestBody(req) |
| 15 | b, _, _ := c.buildRequestBody(req) |
| 16 | first, _ := json.Marshal(a) |
| 17 | second, _ := json.Marshal(b) |
| 18 | if !bytes.Equal(first, second) || !bytes.Contains(first, []byte(`"effort":"max"`)) || !bytes.Contains(first, []byte(`provider-reasoning`)) { |
| 19 | t.Fatalf("%s lost effort/replay/cache stability: %s", model, first) |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 |