fix(batches): place mutable-ok tags on the lines the discipline gate flags

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yucheng 2026-09-24 01:03:31 +00:00
parent fe1125111d
commit 05d6977052
3 changed files with 13 additions and 8 deletions

View file

@ -307,9 +307,7 @@ async def _emit_line_event(
custom_llm_provider=custom_llm_provider,
)
for secret_key in _SECRET_PARAM_KEYS:
child.litellm_params.pop(
secret_key, None
) # mutable-ok: model_call_details holds this same dict # pyright: ignore[reportUnknownMemberType] # Logging.litellm_params is untyped upstream
child.litellm_params.pop(secret_key, None) # pyright: ignore[reportUnknownMemberType] # Logging.litellm_params is untyped upstream
now: Final = datetime.now() # noqa: DTZ005 # naive to match the logging pipeline start_time
if result is None:

View file

@ -2798,8 +2798,9 @@ def anthropic_message_to_model_response(result: Mapping[str, object], speed: str
return AnthropicConfig().transform_parsed_response(
completion_response=pydantic_result.model_dump(),
raw_response=httpx.Response(
status_code=200, headers={}
), # mutable-ok: httpx.Response wants a plain dict of headers
status_code=200,
headers={}, # mutable-ok: httpx.Response wants a plain dict of headers
),
model_response=ModelResponse(id=result_id if isinstance(result_id, str) and result_id else None),
json_mode=None,
speed=speed,

View file

@ -106,9 +106,15 @@ def bedrock_batch_line_to_response(
embedding: Final = model_output.get("embedding")
return EmbeddingResponse(
model=model,
data=[
{"object": "embedding", "index": 0, "embedding": embedding if isinstance(embedding, list) else []}
], # mutable-ok: EmbeddingResponse takes a plain data list
data=[ # mutable-ok: EmbeddingResponse takes a plain data list
{ # mutable-ok: plain row dict for EmbeddingResponse.data
"object": "embedding",
"index": 0,
"embedding": embedding
if isinstance(embedding, list)
else [], # mutable-ok: empty fallback for the row
}
],
usage=titan_embedding_usage_from_batch_output(model_output),
)
if "output" in model_output: