feat(agents): dynamic tool-loader with bundle-gated activation for #688#958
feat(agents): dynamic tool-loader with bundle-gated activation for #688#958theonlychant wants to merge 6 commits intoamd:mainfrom
Conversation
…d#688 Signed-off-by: theonlychant <sacehenry@gmail.com>
Signed-off-by: theonlychant <sacehenry@gmail.com>
Signed-off-by: theonlychant <sacehenry@gmail.com>
Signed-off-by: theonlychant <sacehenry@gmail.com>
Signed-off-by: theonlychant <sacehenry@gmail.com>
itomek
left a comment
There was a problem hiding this comment.
Three of the prior #854 review items this PR's description claims are fixed are still present in the code. Inline comments mark each spot. Two ways forward: (A) land the fixes the prior review asked for; (B) update the PR description to match what actually shipped. I'd push for A — the regex false positives in particular will mis-route real conversations.
Generated by Claude Code
…t_session Signed-off-by: theonlychant <sacehenry@gmail.com>
I did that for both this PR and the other one in #854 to be honest I'm not sure if I need this PR right now or do I need to close this but I'll keep this for now if things get messy again |
Summary
Implements dynamic tool-loader with bundle-gated activation for GAIA's
agent system, reducing token usage by only exposing tools relevant to
the current conversation context.
Why
The full tool registry is passed to the LLM on every turn, consuming
tokens for tools that are unlikely to be used. Bundle-gated activation
loads tools on-demand based on keyword matching and activation policies
(always, session, keyword), reducing context window pressure and
improving response quality.
Linked issue
Closes #688
Changes
src/gaia/agents/base/tool_loader.py-ToolLoaderwith bundleregistration, keyword-based activation, and session/always/keyword policies
force_activate(bundle_name)public method to avoid direct_stateaccessreset_session()into conversation-start path inChatAgentsrc/gaia/agents/base/tool_loader.pyunit testsTest plan
pytest tests/unit/test_tool_loader.py- all passingpython util/lint.py --all- no failuresactivate based on conversation context
Checklist
Closes #688).