Files
Dario Gabriel LipicarandClaude Opus 5 10b72e4be1 fix: make the caller's timeout bound the token handshake, not just the call
requestModule gains a timeoutMs parameter (defaulted to today's 20000, so every
existing caller is source-compatible and unchanged), and LogosAPIClient threads
its caller's Timeout through mintAndCacheToken into it.

The budget bounds the WHOLE handshake -- the capability_module acquire plus the
requestModule call on it share one deadline, rather than each getting a fresh
copy. Halving it would be arbitrary; giving each the full amount would make the
worst case twice what the caller asked for. What is left after the acquire is
never allowed to reach 0, because some transports read 0 as "no timeout" and an
exhausted budget must not silently become an unbounded wait.

Also corrects a comment that argued the handshake-refusal fallthrough was safe
because "capability_module passes 3000 ms". It does not: capability_module
reaches informModuleToken_module through its FOUR-argument overload
(capability_module_plugin.cpp:112), so timeoutMs takes the header's 20 s
default. The bound is real, it is just not short -- and the code should say the
true thing about why it is safe.

Not covered here: the ASYNC first-call path still acquires capability_module
through invokeRemoteMethodAsync without threading a budget. It does not block
the caller, so it is a different defect with a different fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 11:45:24 -03:00
..