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:
ed
2026-06-20 14:05:08 -04:00
parent 80eebfb83b
commit 48cca536a3
2 changed files with 27 additions and 4 deletions
+1 -4
View File
@@ -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