symfonic.capabilities.delegation.tools¶
tools ¶
Tool exposure: what the parent's model is offered, and what it reads back.
Two tools, and one rule that governs both: a refusal is a return value. Depth reached, name unknown, child raised — each is a message the model reads and routes around, never an exception that ends the parent's run. The parent asked a question; the framework answered it. That the answer was "no" does not make it a failure of the parent.
The one exception to the exception rule is cancellation. A cancelled child means the run is going away, not that the delegation failed, and turning that into a chatty tool message would keep a model talking inside a run somebody already stopped.
What is new here is that the refusal is also a value. The shipped tool
returned prose and nothing else, so anything wanting to know whether delegation
had been refused had to pattern-match English. :meth:DelegationTools.delegate
returns the record; :meth:DelegationTools.run_agent returns its message.
DelegationTools ¶
DelegationTools(*, roster: DelegationRoster, depth: DepthPolicy, context: DelegationContext | None = None, record: bool = True)
The run_agent / list_agents surface over a roster.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
bool
|
Whether a delivered hand-off is noted on the active run. On by default; switchable because the tally is observability, and a deployment must be able to turn observability off without losing the capability it observes. |
True
|
Source code in src/symfonic/capabilities/delegation/tools.py
delegate
async
¶
Attempt one hand-off and report what happened.
The order of the checks is load-bearing. Depth is checked before the name, so a run at the ceiling is refused for the reason that actually applies rather than being told the child does not exist; and the child is never reached at all, which is the point of a ceiling.
Source code in src/symfonic/capabilities/delegation/tools.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |