mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 21:54:31 +00:00
fix(agents): avoid classifying reasoning-required errors as context overflow (#24593)
* Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
This commit is contained in:
@@ -35,6 +35,15 @@ describe("formatAssistantErrorText", () => {
|
||||
);
|
||||
expect(formatAssistantErrorText(msg)).toContain("Context overflow");
|
||||
});
|
||||
it("returns a reasoning-required message for mandatory reasoning endpoint errors", () => {
|
||||
const msg = makeAssistantError(
|
||||
"400 Reasoning is mandatory for this endpoint and cannot be disabled.",
|
||||
);
|
||||
const result = formatAssistantErrorText(msg);
|
||||
expect(result).toContain("Reasoning is required");
|
||||
expect(result).toContain("/think minimal");
|
||||
expect(result).not.toContain("Context overflow");
|
||||
});
|
||||
it("returns a friendly message for Anthropic role ordering", () => {
|
||||
const msg = makeAssistantError('messages: roles must alternate between "user" and "assistant"');
|
||||
expect(formatAssistantErrorText(msg)).toContain("Message ordering conflict");
|
||||
|
||||
Reference in New Issue
Block a user