core.tools_consumer module
Tool-execution stream consumer for the dedicated tools service.
ToolExecConsumer mirrors core.stream_consumer.InboundStreamConsumer
— blocking XREADGROUP on sg:stream:tools under the sg:tools group,
an autoclaim sweep, and DLQ on repeated failure — but with two deliberate
differences:
No per-channel distributed lock. Tool execution must run fully in parallel and load-balance across
toolsinstances; user-visible message ordering is already enforced downstream by the gateway’s per-channel outbound lock.The injected
process_fnis expected to always reply (it pushes the result, or an error envelope, onto the caller’s reply stream) and to swallow tool-level exceptions. Only infrastructure failures propagate to the DLQ.