mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
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:
@@ -993,8 +993,8 @@ def setup_model_routes(model_discovery):
|
|||||||
db.close()
|
db.close()
|
||||||
if changed:
|
if changed:
|
||||||
_invalidate_models_cache()
|
_invalidate_models_cache()
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
logger.warning('Background endpoint refresh failed: %s', e)
|
||||||
finally:
|
finally:
|
||||||
for st in _refresh_state.values():
|
for st in _refresh_state.values():
|
||||||
st["inflight"] = False
|
st["inflight"] = False
|
||||||
|
|||||||
+3
-3
@@ -375,7 +375,8 @@ def get_builtin_overrides() -> dict:
|
|||||||
from src.settings import get_setting
|
from src.settings import get_setting
|
||||||
ov = get_setting("builtin_tool_overrides", {})
|
ov = get_setting("builtin_tool_overrides", {})
|
||||||
return ov if isinstance(ov, dict) else {}
|
return ov if isinstance(ov, dict) else {}
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
logger.warning('Failed to load builtin tool overrides: %s', e)
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
@@ -611,8 +612,7 @@ def _build_system_prompt(
|
|||||||
# Skill index is user-editable (name + description), so it must never
|
# Skill index is user-editable (name + description), so it must never
|
||||||
# live in the trusted system role and is NOT cached. Always recompute
|
# live in the trusted system role and is NOT cached. Always recompute
|
||||||
# when the cache hits.
|
# when the cache hits.
|
||||||
from src.agent_loop import _build_base_prompt as _bbp_recompute
|
_, _skill_index_block = _build_base_prompt(
|
||||||
_, _skill_index_block = _bbp_recompute(
|
|
||||||
disabled_tools, mcp_mgr, needs_admin, relevant_tools,
|
disabled_tools, mcp_mgr, needs_admin, relevant_tools,
|
||||||
mcp_disabled_map=mcp_disabled_map, compact=compact,
|
mcp_disabled_map=mcp_disabled_map, compact=compact,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user