Support lazy tool resolution for subagent profiles #320
FredKSchott
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
Subagent tool definitions are resolved when the agent harness is initialized and remain fixed afterward. This becomes difficult when a tool can only be constructed after asynchronous, invocation-time context is available.
The current workaround is to register a placeholder tool up front, then have its
executefunction load the required context, locate the real tool by name, and delegate to it. This duplicates tool registration concerns, introduces name-based indirection, and can create an advertised-but-unavailable state if the initialized and deferred tool catalogs diverge.This may be an API limitation rather than a runtime bug, but the required workaround is difficult to discover and reason about.
Expected Behavior
Subagent profiles should support lazy or asynchronous tool resolution, for example:
The resolver would run when the subagent task starts, using invocation-scoped context and cancellation, while static tool arrays remain supported. Tool definitions should then remain stable for that task.
An equivalent operation-scoped API would also work if model-invoked named subagents can receive those tools without placeholder registration.
Steps to Reproduce
Beta Was this translation helpful? Give feedback.
All reactions