fix(coding-agent): reuse session thinking for compaction closes #3438
This commit is contained in:
@@ -56,18 +56,58 @@ describe("generateSummary reasoning options", () => {
|
||||
completeSimpleMock.mockResolvedValue(mockSummaryResponse);
|
||||
});
|
||||
|
||||
it("sets reasoning=high for reasoning-capable models", async () => {
|
||||
await generateSummary(messages, createModel(true), 2000, "test-key");
|
||||
it("uses the provided thinking level for reasoning-capable models", async () => {
|
||||
await generateSummary(
|
||||
messages,
|
||||
createModel(true),
|
||||
2000,
|
||||
"test-key",
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
"medium",
|
||||
);
|
||||
|
||||
expect(completeSimpleMock).toHaveBeenCalledTimes(1);
|
||||
expect(completeSimpleMock.mock.calls[0][2]).toMatchObject({
|
||||
reasoning: "high",
|
||||
reasoning: "medium",
|
||||
apiKey: "test-key",
|
||||
});
|
||||
});
|
||||
|
||||
it("does not set reasoning when thinking is off", async () => {
|
||||
await generateSummary(
|
||||
messages,
|
||||
createModel(true),
|
||||
2000,
|
||||
"test-key",
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
"off",
|
||||
);
|
||||
|
||||
expect(completeSimpleMock).toHaveBeenCalledTimes(1);
|
||||
expect(completeSimpleMock.mock.calls[0][2]).toMatchObject({
|
||||
apiKey: "test-key",
|
||||
});
|
||||
expect(completeSimpleMock.mock.calls[0][2]).not.toHaveProperty("reasoning");
|
||||
});
|
||||
|
||||
it("does not set reasoning for non-reasoning models", async () => {
|
||||
await generateSummary(messages, createModel(false), 2000, "test-key");
|
||||
await generateSummary(
|
||||
messages,
|
||||
createModel(false),
|
||||
2000,
|
||||
"test-key",
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
"medium",
|
||||
);
|
||||
|
||||
expect(completeSimpleMock).toHaveBeenCalledTimes(1);
|
||||
expect(completeSimpleMock.mock.calls[0][2]).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user