Private
Public Access
refactor(ai_client): migrate top-level SLOP_TOOL_PRESET env loader (Phase 11 site 11)
Site 11 at module level had:
if os.environ.get('SLOP_TOOL_PRESET'):
try:
set_tool_preset(os.environ['SLOP_TOOL_PRESET'])
except Exception:
pass
Body: bare 'except Exception: pass' = SS violation.
Migration: call the _set_tool_preset_result helper from Phase 11 site 5.
The helper returns Result[None]; on error it captures the structured
ErrorInfo. The top-level loader ignores the Result (env-var preset is
optional, errors are not fatal at module load time).
Audit: ai_client SS 3 -> 2.
This commit is contained in:
+1
-4
@@ -3332,10 +3332,7 @@ def _add_bleed_derived(d: dict[str, Any], sys_tok: int = 0, tool_tok: int = 0) -
|
||||
|
||||
# Check for tool preset in environment variable (headless mode)
|
||||
if os.environ.get("SLOP_TOOL_PRESET"):
|
||||
try:
|
||||
set_tool_preset(os.environ["SLOP_TOOL_PRESET"])
|
||||
except Exception:
|
||||
pass
|
||||
_set_tool_preset_result(os.environ["SLOP_TOOL_PRESET"])
|
||||
|
||||
#endregion: Session & Public API
|
||||
|
||||
|
||||
Reference in New Issue
Block a user