Skip to main content

explain_agent_ctx

Function explain_agent_ctx 

Source
pub fn explain_agent_ctx(
    bp: &Blueprint,
    agent: &str,
) -> Option<BTreeMap<String, CtxKeyResolution>>
Expand description

Resolve agent’s effective static context (the 3-tier AgentInline > MetaRef > BpGlobal subset of the full cascade — see CtxTier’s doc) into a per-key winner table.

None when agent is not a name in bp.agents. A key present in more than one tier resolves to its highest-priority tier’s value. A tier whose declared value is not a JSON Object is skipped entirely — matching AgentContextMiddleware::merge_ctx_tiers’s warn-and-skip behavior (that malformed shape never fails a spawn); an explain view has no channel to surface the warning, so it silently omits the tier rather than failing the whole call. An unresolved AgentMeta.meta_ref (a name absent from bp.metas) is likewise skipped — same defensive contract as derive_agent_ctx’s own meta_ref resolution.