From b0d5d63d9da4e5b14a91178504dffa6fef2410d9 Mon Sep 17 00:00:00 2001 From: "Brian D. Evans" <252620095+briandevans@users.noreply.github.com> Date: Fri, 24 Apr 2026 17:47:31 -0700 Subject: [PATCH] =?UTF-8?q?log:=20clarify=20credential-rotation=20messages?= =?UTF-8?q?=20=E2=80=94=20HTTP=20%s=20instead=20of=20"Credential=20%s"=20(?= =?UTF-8?q?Copilot=20#15414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot's review on #15414 flagged that the rotation log lines read ``"Credential %s (billing) — rotated to pool entry %s"`` where the first ``%s`` is bound to ``rotate_status`` (an HTTP status code, e.g. 429), not a credential ID. Reading the literal log line — ``"Credential 429 (billing) — rotated to pool entry cred-2"`` — would suggest "credential 429" was rotated, which is meaningless and actively confusing during incident debugging. Same issue existed on the three sibling branches (billing, rate_limit, auth refresh-failed) plus the new overloaded branch this PR adds. Drive-by fix all four with the same ``HTTP %s (reason) — rotated credential to pool entry %s`` shape so: HTTP 429 (provider overloaded) — rotated credential to pool entry cred-2 reads correctly as "we got HTTP 429, classified it as provider overloaded, rotated to credential cred-2". No behaviour change. 145/145 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- run_agent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run_agent.py b/run_agent.py index 0e86b5228..26bfd3f4d 100644 --- a/run_agent.py +++ b/run_agent.py @@ -5565,7 +5565,7 @@ class AIAgent: next_entry = pool.mark_exhausted_and_rotate(status_code=rotate_status, error_context=error_context) if next_entry is not None: logger.info( - "Credential %s (billing) — rotated to pool entry %s", + "HTTP %s (billing) — rotated credential to pool entry %s", rotate_status, getattr(next_entry, "id", "?"), ) @@ -5580,7 +5580,7 @@ class AIAgent: next_entry = pool.mark_exhausted_and_rotate(status_code=rotate_status, error_context=error_context) if next_entry is not None: logger.info( - "Credential %s (rate limit) — rotated to pool entry %s", + "HTTP %s (rate limit) — rotated credential to pool entry %s", rotate_status, getattr(next_entry, "id", "?"), ) @@ -5598,7 +5598,7 @@ class AIAgent: next_entry = pool.mark_exhausted_and_rotate(status_code=rotate_status, error_context=error_context) if next_entry is not None: logger.info( - "Credential %s (provider overloaded) — rotated to pool entry %s", + "HTTP %s (provider overloaded) — rotated credential to pool entry %s", rotate_status, getattr(next_entry, "id", "?"), ) @@ -5618,7 +5618,7 @@ class AIAgent: next_entry = pool.mark_exhausted_and_rotate(status_code=rotate_status, error_context=error_context) if next_entry is not None: logger.info( - "Credential %s (auth refresh failed) — rotated to pool entry %s", + "HTTP %s (auth refresh failed) — rotated credential to pool entry %s", rotate_status, getattr(next_entry, "id", "?"), )