embabel-agent icon indicating copy to clipboard operation
embabel-agent copied to clipboard

Thread safe recording of llm invocations in concurrent mode

Open stefanks-px opened this issue 7 months ago • 4 comments

Using embabel in mode embabel.agent.platform.process-type=CONCURRENT, LLM calls might run in parallel. The LlmInvocation is recorded in the AgentProcess using ToolLoopOperations.recordUsage. The backing List is a ArrayList and therefore not thread safe. _history also uses a ArrayList

stefanks-px avatar Apr 14 '26 09:04 stefanks-px

linked to issue #1604 @stefanks-px please consider using sub-issues for grouping issues @azanux -FYI

igordayen avatar Apr 16 '26 16:04 igordayen

would be good to have design for all connected issues and address them from a common perspective.

igordayen avatar Apr 17 '26 00:04 igordayen

@igordayen , I think #1602 can be handled independently - while @stefanks-px clarifies his thoughts on other Issues and linked to #1604

azanux avatar Apr 18 '26 22:04 azanux

@igordayen , I think #1602 can be handled independently - agreed. suggesting to consider: private val _llmInvocations = CopyOnWriteArrayList() thanks.

igordayen avatar Apr 19 '26 03:04 igordayen