fix(tools): a tool call does not hold a monitor while it waits for another thread (one and two processors) #115

Merged
james.maes merged 1 commits from fix/tool-call-admission-does-not-pin into develop 2026-11-17 21:43:15 +00:00
1 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.2 f4b279b95d fix(tools): a tool call does not hold a monitor while it waits for another thread
maven / build (push) Successful in 9m40s
build / maven (push) Successful in 9m40s
A tool call is a virtual thread, and the first call of a turn works out what
the person is offered by waiting for another one. ToolCallService did that
inside synchronized(admission), which keeps the carrier thread: with two
processors a batch of tool calls, and with one processor every first tool
call of a turn, waited out toolCallTimeoutSeconds, and the person was then
offered no write and no process tool for that turn.

An admission is now guarded by a ReentrantLock. FewProcessorsTest runs in
JVMs with one and with two processors (two surefire executions) and fails
there without the fix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 13:26:08 -06:00