diff --git a/tests/test_lowering.py b/tests/test_lowering.py index d9224a23..e59f5338 100644 --- a/tests/test_lowering.py +++ b/tests/test_lowering.py @@ -126,6 +126,9 @@ def test_repair_synthesizes_trailing_orphan() -> None: "tool_call_id": "c1", "content": CANCELLED_TOOL_RESULT, "is_error": True, + # The unobserved synth carries the typed disposition (wire-invisible + # side channel, stripped by the translator before the provider wire). + "_effect_status": "unknown", } diff --git a/tests/test_session_mcp_dispatch_error.py b/tests/test_session_mcp_dispatch_error.py index 16fb729d..c1826053 100644 --- a/tests/test_session_mcp_dispatch_error.py +++ b/tests/test_session_mcp_dispatch_error.py @@ -105,7 +105,11 @@ def _record_outputs(session) -> list[tuple[str, str, str, bool]]: """Patch ``_report_tool_result`` to capture (call_id, name, output, is_error).""" captures: list[tuple[str, str, str, bool]] = [] - def _capture(call_id: str, name: str, output: str, *, is_error: bool = False) -> None: + def _capture( + call_id: str, name: str, output: str, *, is_error: bool = False, **_: object + ) -> None: + # ``**_`` swallows the typed ``status`` kwarg (and any future ones) so + # the stub stays signature-compatible with ``_report_tool_result``. captures.append((call_id, name, output, is_error)) session._report_tool_result = _capture # type: ignore[method-assign] diff --git a/turnstone/core/trajectory.py b/turnstone/core/trajectory.py index 93b324c6..d7c2b3c0 100644 --- a/turnstone/core/trajectory.py +++ b/turnstone/core/trajectory.py @@ -161,7 +161,10 @@ class Turn: return None try: return EffectStatus(raw) - except ValueError: + except (ValueError, TypeError): + # ValueError: not a known status string. TypeError: a corrupt + # non-string value (e.g. a dict survived into the meta). Mirror the + # meta decoders and degrade to None rather than crash a consumer. return None # -- construction helpers (blunt the wrapping cost of uniform block content) --