Add test for qwen/qwen3-32b maxTokens validation

Fixes #5136

- Added specific test to verify qwen/qwen3-32b model has correct maxTokens value of 40960
- This ensures the fix from commit c797c9a1d is properly tested and prevents regression
- The maxTokens limit of 40960 matches Groq API documentation requirements
This commit is contained in:
Roo Code 2025-06-30 07:53:38 +00:00
parent 3a8ba27615
commit 1307037926

View file

@ -52,6 +52,16 @@ describe("GroqHandler", () => {
expect(model.info).toEqual(groqModels[testModelId])
})
it("should return qwen/qwen3-32b model with correct maxTokens", () => {
const testModelId: GroqModelId = "qwen/qwen3-32b"
const handlerWithModel = new GroqHandler({ apiModelId: testModelId, groqApiKey: "test-groq-api-key" })
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(groqModels[testModelId])
// Verify that maxTokens is set to 40960 as per Groq API documentation
expect(model.info.maxTokens).toBe(40960)
})
it("completePrompt method should return text from Groq API", async () => {
const expectedResponse = "This is a test response from Groq"
mockCreate.mockResolvedValueOnce({ choices: [{ message: { content: expectedResponse } }] })