Private
Public Access
Regression fix: session_logger.log_tool_call was partially migrated to return Result[data=str(ps1_path) | None] but the call site in _offload_entry_payload still did Path(ref_path).name on the Result object, raising TypeError. The fix wraps the call to log_tool_call in an isinstance(ref_result, Result) guard and unwraps .ok / .data to produce the [REF:filename] reference. On errors, a logging.debug is emitted (per Heuristic #19) and the payload is preserved unchanged. Also adds import logging to the module top and rom src.result_types import Result, ErrorInfo, ErrorKind to support the convention's 'AND over OR' pattern at this call site. The log_tool_output call site is unchanged because log_tool_output still returns Optional[str] (not Result); applying the unwrap pattern there would crash. The spec's illustrative code treated both functions as Result-based, but only log_tool_call was actually half-migrated. Refs: conductor/tracks/result_migration_app_controller_20260618 (FR5) Refs: tests/test_app_controller_offloading.py:test_offload_entry_payload_tool_call_unwraps_result Refs: tests/test_app_controller_offloading.py:test_offload_entry_payload_preserves_script_on_log_tool_call_error