fix(providers): tighten tool calls and compatibility fallbacks

Require structured tool calls and explicit unsupported-feature errors.
Preserve supported SDK compaction requests and add compatibility coverage.

Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
This commit is contained in:
chengyongruandXubin Ren authored and Xubin Ren committed 2026-10-31 11:55:13 +08:00
1 parent 3e40684112
commit 8b37976d36
16 files changed
+406 -168

No files matched your search

@@ -313,8 +313,9 @@ async def test_codex_request_non_200_populates_http_metadata(monkeypatch) -> Non
@pytest.mark.asyncio
@pytest.mark.parametrize("unsupported", [False, True])
async def test_codex_request_marks_rejected_compaction_without_retaining_raw_body(
monkeypatch,
monkeypatch, unsupported,
) -> None:
original_client = httpx.AsyncClient
secret = "PRIVATE PROMPT MUST NOT BE RETAINED"
@@ -324,7 +325,10 @@ async def test_codex_request_marks_rejected_compaction_without_retaining_raw_bod
400,
json={
"error": {
"message": f"Unknown input type compaction_trigger; {secret}",
"message": (
f"Unknown input type compaction_trigger; {secret}" if unsupported
else f"Invalid compaction_trigger: input exceeds context window; {secret}"
),
},
},
request=request,
@@ -349,7 +353,7 @@ async def test_codex_request_marks_rejected_compaction_without_retaining_raw_bod
)
error = caught.value
assert error.compaction_unsupported is True
assert error.compaction_unsupported is unsupported
assert secret not in str(error)
assert not hasattr(error, "body")