Skip to content

symfonic.agent.reply_presentation

reply_presentation

Opt-in run-only compatibility view from accepted invocation-local raw text.

Compose this runtime consumer in an AgentHost root, passing a factory which includes the supplied capability in a public Agent. It does not change native results, history, reflection, hooks or writes. Scope is a trusted composition binding, not caller authentication. Unsupported replies have no view: callers must not substitute native_result.text. Stream and typed output are refused.

Only observable incomplete reserved syntax is detected; the receipt has no provider finish_reason, so this is not a guarantee against provider truncation.

CompatibilityReply dataclass

CompatibilityReply(native_result: AgentResult[Any], final_response: str | None, unsupported_reason: str | None = None)

Separate view; native_result remains the exact successful native object.

ReceiptPresentedAgent

ReceiptPresentedAgent(scope: Any, factory: Any)

Runtime consumer for a trusted factory(provenance) -> Agent root.

The factory retains ordinary tools/memory/session configuration; this is not a second Agent constructor or an authorization/admission for those features. It is called once. No forwarding of other native entrypoints.

Source code in src/symfonic/agent/reply_presentation.py
def __init__(self, scope: Any, factory: Any) -> None:
    self._scope_path = scope.path
    self._frames: ContextVar[_Frame | None] = ContextVar("reply-presentation", default=None)
    capability = _PresentationCapability(scope, self._bind, self._receive)
    agent = factory(capability)
    if type(agent) is not Agent:
        raise ConfigurationError("reply presentation composition requires a public Agent")
    rows = agent.composition_manifest["stages"]
    ids = [row[1] for row in rows]
    if any(ids.count(stage) != 1 for stage in (_BIND, _PREPARE, _FINAL)) or ids.index(
        _BIND
    ) > ids.index(_PREPARE):
        raise ConfigurationError("reply presentation composition missing ordered provenance")
    self._agent = agent