From 051d9220f4a7091511be486c63981250c1eef51e Mon Sep 17 00:00:00 2001 From: Claude Code Agent Date: Wed, 13 May 2026 12:53:28 +0800 Subject: [PATCH] fix(d2p): remove dangling logger.info refs in seeded_router MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E4-v4 forensic: 1235/1285 requests failed with NameError: name 'logger' is not defined When commit b9b0cf0 added agentic-side D→P orchestration, the post-call diagnostic was written as logger.info(...). But src/agentic_pd_hybrid/replay.py doesn't import the logging module nor define a module-level `logger`. v3 didn't hit it because config.enable_d_to_p_sync was always False (plumbing bug fixed in af966f2). v4 with sync enabled tripped the NameError on EVERY reseed-path request → 96% failure rate. Fix is to remove the redundant logger.info — the structural log (`structural/d-to-p-sync.jsonl`, added in e729d62) already captures every prepare/dump/finalize decision. --- src/agentic_pd_hybrid/replay.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/agentic_pd_hybrid/replay.py b/src/agentic_pd_hybrid/replay.py index 4410c78..f77c32d 100644 --- a/src/agentic_pd_hybrid/replay.py +++ b/src/agentic_pd_hybrid/replay.py @@ -2356,19 +2356,10 @@ async def _invoke_kvcache_seeded_router( prefill_url=prefill_url, decode_session=decode_session, ) - if sync_result is not None and sync_result.get("status") != "ok": - logger.info( - "d_to_p_sync sid=%s rid=%s skipped: %s", - request.session_id, request.request_id, sync_result, - ) - elif sync_result and sync_result.get("status") == "ok": - logger.info( - "d_to_p_sync sid=%s rid=%s pushed=%d ingested_prefix=%d", - request.session_id, - request.request_id, - sync_result.get("bytes_pushed", 0), - sync_result.get("inserted_prefix_len", 0), - ) + # NB: every outcome of _attempt_d_to_p_sync is already captured in + # structural/d-to-p-sync.jsonl via _structural_emit. No need for an + # additional logger.info here (and `logger` isn't imported at module + # scope, so it would NameError if reached). decode_session_newly_opened = False try: