Repository navigation
feat: add max_tool_concurrency to core Agent and restore compatibility aliases - #366
Merged
Merged
Conversation
…oads Bring back bub.tape, bub.tools, bub.store, bub.sidecars, bub.builtin.commands and bub.builtin.context as aliases of their bub.core modules, and keep the LlmCallRequest / LlmCallResult / LlmCallDecision names in bub.hooks.interception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Limit how many tool calls from one model response run at once. ToolExecutor holds the limiter: a Semaphore, or nullcontext when unlimited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bub | ae6c877 | Commit Preview URL Branch Preview URL |
Oct 16 2026, 08:53 AM |
frostming
added a commit
that referenced
this pull request
Oct 18, 2026
agent = Agent(model=model, tools=[...], max_tool_concurrency=2) Limit how many tool calls from one model response run at once. `None` (the default) runs them all concurrently; `1` runs them one at a time, in order; values below 1 raise ValueError. `ToolExecutor` takes `max_concurrency` and holds the limiter: an `asyncio.Semaphore`, or `nullcontext()` when unlimited.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Two focused commits:
1.
fix:restore compatibility aliases0.6.0a2 removed modules and names that plugins written against 0.5.x / 0.6.0a1 still import. This restores them as aliases:
sys.moduleslike 0.6.0a1 did, sobub.tape is bub.core.tape:bub.tape,bub.tools,bub.store,bub.sidecars→bub.core.*bub.builtin.commands,bub.builtin.context→bub.core.commands,bub.core.contextbub.hooks.interception.LlmCallRequest/LlmCallResult/LlmCallDecision→LLMCall*. This is where plugins import them from;bub.coregets no aliases.The four top-level aliases need only the kernel's dependencies.
2.
feat:max_tool_concurrencyonbub.core.AgentNone(the default) keeps today's behavior: all calls run concurrently.1runs them one at a time, in order. Values below 1 raiseValueError.ToolExecutorgets amax_concurrencyargument and keeps the limiter on the instance: anasyncio.Semaphore, ornullcontext()when unlimited. The agent creates one executor per step, so the limit applies within one model response.Impacted modules
bub.core.agent,bub.core.tools,bub.hooks.interception, the new alias modules,tests/test_compat_aliases.py,tests/test_core_agent.py, SDK docs (en + zh-cn).Verification
uv run ruff check src tests: cleanuv run mypy src: cleanuv run pytest -q: 660 passed, 1 skippedNone/2/1, and calls still start in order🤖 Generated with Claude Code