fix(chatgpt): annotate the input coercion for the type-discipline gate

The LIT002 budget counts mutable-collection construction, and wrapping the
string input builds a list and a dict, which put the total two over its
ceiling. Both constructions are the wire payload this backend requires, so the
list cannot be replaced with an immutable equivalent; annotate the line with a
reason instead, matching the convention used elsewhere in the tree.

LIT005 freezes reasonless suppressions at zero, so the reason is required
rather than decorative.

Signed-off-by: Alexander Chernov <alexander@chernov.it>
This commit is contained in:
Alexander Chernov 2026-08-24 16:11:14 +01:00
parent 9aaf01d8ea
commit c9117ec6c1
No known key found for this signature in database

View file

@ -69,7 +69,7 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig):
# The Responses API accepts a string or a list, but this backend
# rejects a string with {"detail": "Input must be a list"}.
if isinstance(input, str):
input = [{"role": "user", "content": input}]
input = [{"role": "user", "content": input}] # mutable-ok: the wire payload this backend requires
request: Final = super().transform_responses_api_request(
model,
input,