Skip to content

symfonic.capabilities.tools.stages.role

role

Role-palette stage — the v7.11.0 role-aware tool gate, as a stage.

The resolver Protocol is unchanged and adopter implementations keep working; what moves here is the consumption of its answer, which used to be ninety inline lines in the react node.

RolePaletteStage

RolePaletteStage(*, resolver: Any = None, role: str = '')

Narrow to the palette a role resolver returns.

Three answers, three meanings:

  • None — no policy. Abstain (the safe default for an empty role_tools map or an unmapped role).
  • a non-empty list — the palette. It can only narrow; a resolver returning tools that were not offered is not honoured, because the framework constrains the choice set and never authors it.
  • [] — abstain with a warning. The Protocol has always documented that the consumer "will detect this and abstain to all_tools with a WARN"; before T3.1.2 nothing did, and an empty palette reached _bind_tools, which binds nothing for an empty list — silently dropping every tool AND any forced tool_choice.
Source code in src/symfonic/capabilities/tools/stages/role.py
def __init__(self, *, resolver: Any = None, role: str = "") -> None:
    self._resolver = resolver
    self._role = role