fix(ci): pin acp <0.9 and update retry-exhaust test (#3320)

Two remaining CI failures:

1. agent-client-protocol 0.9.0 removed AuthMethod (replaced with
   AuthMethodAgent/EnvVar/Terminal). Pin to <0.9 until the new API
   is evaluated — our usage doesn't map 1:1 to the new types.

2. test_429_exhausts_all_retries_before_raising expected pytest.raises
   but the agent now catches 429s after max retries, tries fallback,
   then returns a result dict. Updated to check final_response.
This commit is contained in:
Teknium
2026-03-26 19:21:34 -07:00
committed by GitHub
parent 22cfad157b
commit 03396627a6
2 changed files with 11 additions and 4 deletions

View File

@@ -217,10 +217,17 @@ def test_529_overloaded_is_retried_and_recovers(monkeypatch):
def test_429_exhausts_all_retries_before_raising(monkeypatch):
"""429 must retry max_retries times, not abort on first attempt."""
"""429 must retry max_retries times, then return a failed result.
The agent no longer re-raises after exhausting retries — it returns a
result dict with the error in final_response. This changed when the
fallback-provider feature was added (the agent tries a fallback before
giving up, and returns a result dict either way).
"""
agent_cls = _make_agent_cls(_RateLimitError) # always fails
with pytest.raises(_RateLimitError):
_run_with_agent(monkeypatch, agent_cls)
result = _run_with_agent(monkeypatch, agent_cls)
resp = str(result.get("final_response", ""))
assert "429" in resp or "retries" in resp.lower()
def test_400_bad_request_is_non_retryable(monkeypatch):