Skip to content

symfonic.agent.result_policy

result_policy

Public native Agent result-policy settings, without exposing policy services.

ResultPolicySettings dataclass

ResultPolicySettings(enabled: bool = False, size_chars: int = DEFAULT_SIZE_THRESHOLD_CHARS, keep_last_n: int = 1, offload_enabled: bool = False, large_offload_threshold_chars: int = DEFAULT_LARGE_OFFLOAD_THRESHOLD_CHARS, turn_boundary_index: int | None = None, model_name: str = '', expected_conversation_depth: int = 5, expected_recall_probability: float = 0.5)

Everything the policy needs to decide, read once.

enabled defaults to False. v8.7.1 (C1): the pre-T3.1.3 fallback used to default it True, so a dropped config key silently force-enabled compaction and pointed recall stubs at an unregistered recall tool — the payload was simply gone.

with_turn_boundary

with_turn_boundary(index: int | None) -> ResultPolicySettings

A copy carrying a derived boundary, when the caller had none.

Source code in src/symfonic/capabilities/tools/results/values.py
def with_turn_boundary(self, index: int | None) -> ResultPolicySettings:
    """A copy carrying a derived boundary, when the caller had none."""
    if self.turn_boundary_index is not None or index is None:
        return self
    return ResultPolicySettings(
        enabled=self.enabled,
        size_chars=self.size_chars,
        keep_last_n=self.keep_last_n,
        offload_enabled=self.offload_enabled,
        large_offload_threshold_chars=self.large_offload_threshold_chars,
        turn_boundary_index=index,
        model_name=self.model_name,
        expected_conversation_depth=self.expected_conversation_depth,
        expected_recall_probability=self.expected_recall_probability,
    )