13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/legion/llm/pipeline/steps/tool_history.rb', line 13
def step_tool_history_inject
return unless sticky_enabled? && @request.conversation_id
state = ConversationStore.read_sticky_state(@request.conversation_id)
history = state[:tool_call_history] || []
return if history.empty?
@enrichments['tool:call_history'] = {
content: format_history(history),
data: { entry_count: history.size },
timestamp: Time.now
}
rescue StandardError => e
@warnings << "tool_history_inject error: #{e.message}"
handle_exception(e, level: :warn, operation: 'llm.pipeline.step_tool_history_inject')
end
|