fix(codex): restore cached tool call fields (#4160)

* fix(codex): restore cached tool call fields

* refactor(codex): merge duplicate enrich loops in chat history

enrich_call_item_from_cache copied the fill-if-empty loop for
reasoning_content/reasoning. The two loops are identical and key
order is irrelevant, so fold both key sets into a single loop.

Pure refactor, no behavior change; codex_chat_history tests pass.

---------

Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
chen-985211
2026-06-16 10:59:16 +08:00
committed by GitHub
parent 3e38889ccc
commit 36b557b2e6
2 changed files with 57 additions and 6 deletions
+1 -1
View File
@@ -1350,7 +1350,7 @@ impl RequestForwarder {
.await;
if restored > 0 {
log::debug!(
"[Codex] Restored {restored} cached function call(s) for Chat upstream"
"[Codex] Restored or enriched {restored} cached function call item(s) for Chat upstream"
);
}
super::providers::apply_codex_chat_upstream_model(provider, &mut mapped_body);