Pixir.Subagents.DelegationContext (pixir v0.1.6)

Copy Markdown View Source

Builds late-bound Delegation Context for Subagent child Turns.

Delegation Context is model-visible operational metadata for one child Turn. It stays out of Pixir's stable prompt prefix: callers pass the returned map to Pixir.Turn.run/3, which renders it into the late developer-context input item. The map is string-keyed so it can be tested, logged later if a future ADR accepts a durable event, and rendered deterministically without leaking Elixir struct details.

Summary

Functions

Build a compact string-keyed context map from a live Subagent record.

Merge Workflow or caller metadata into a base Delegation Context map.

Functions

from_agent(agent)

@spec from_agent(map()) :: map()

Build a compact string-keyed context map from a live Subagent record.

merge_metadata(base, metadata)

@spec merge_metadata(map(), term()) :: map()

Merge Workflow or caller metadata into a base Delegation Context map.