open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

unrecognizedProperty cache_control

Open denniskniep opened this issue 4 months ago • 2 comments

OpenCodeReview Version

v1.8.5 (582953937) linux/amd64

Operating System

Linux (x86_64)

Installation Method

npm (global)

LLM Provider

Anthropic (Claude)

Bug Description

[ocr] Subtask error for pom.xml: LLM completion error: POST "<redacted>": 400 Bad Request {"errorCode":"INVALID_ARGUMENT","errorName":"LanguageModelService:InvalidRequest","errorInstanceId":"b5d73937-d0f4-4dbc-b5ce-1eb5bb3bd40c","parameters":{"unsafeParams":"{unrecognizedProperty=cache_control}","message":"Request contained an unrecognized field"}}

Is it possible to remove this cache_control via configuration?

BTW: ocr llm test was successful

Source: OCR environment
URL:    <redacted>
Model:  <redacted>
I am Open-Code-Review, a command-line code review assistant developed by Alibaba, designed to help analyze and review code directly in your terminal environment.
✓ Connection test successful

Steps to Reproduce

Expected Behavior

Logs / Error Output


Additional Context

No response

denniskniep avatar Aug 03 '26 11:08 denniskniep

Thanks for reporting this! This is a valid issue — when using a proxy/gateway that doesn't support Anthropic's prompt caching, the cache_control field in the request causes a 400 error.

We plan to support disabling the cache_control field via configuration, for example:

  • ocr config set llm.prompt_caching false
  • Interactive provider setup (ocr config setup) will also include an option to toggle this

This should give users full control over whether prompt caching headers are sent, making OCR compatible with proxies that don't recognize this field.

lizhengfeng101 avatar Aug 04 '26 12:08 lizhengfeng101

I'd like to take this — add a config switch (e.g. llm.prompt_caching) so cache_control can be disabled for proxies that reject the field, including the interactive setup toggle.

AI disclosure: I'll use Cursor Cloud Agent (model: grok-4.7) to help; I'll review every line myself before opening the PR.

Octopus-98 avatar Oct 28 '26 12:10 Octopus-98