fix: log warnings on silently swallowed agent and endpoint failures (#2367)

get_builtin_overrides() was swallowing all exceptions with a bare
`except Exception: pass`, so misconfigured tool-description overrides
would silently produce wrong agent behaviour with no log trace.

The background endpoint refresh loop had the same pattern: any probe
failure was silently ignored, giving operators no signal that the
refresh was broken.

Also removes a circular self-import (`from src.agent_loop import
_build_base_prompt`) inside _build_system_prompt; the function is
already in scope and the import created a latent circular reference risk.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Giuseppe
2026-06-04 13:29:31 +02:00
committed by GitHub
parent d25052e43f
commit f6a5f6592f
2 changed files with 5 additions and 5 deletions

View File

@@ -993,8 +993,8 @@ def setup_model_routes(model_discovery):
db.close()
if changed:
_invalidate_models_cache()
except Exception:
pass
except Exception as e:
logger.warning('Background endpoint refresh failed: %s', e)
finally:
for st in _refresh_state.values():
st["inflight"] = False