Parity gap surfaced comparing tool/agenttool against .NET/Python.
Gap
agenttool hardcodes a single query string argument and runs the sub-agent with an independent context, returning only resp.String(). It cannot:
- Propagate the parent session to the sub-agent (so a sub-agent-as-tool starts stateless every call).
- Customize the argument name/description.
Note: the tool name/description defaults and the query arg name already match .NET (AgentExtensions.cs), so those are intentionally aligned — only session propagation and arg customization are missing.
Reference
- Python
Agent.as_tool(arg_name="task", arg_description=..., propagate_session=..., ...) (_agents.py).
- .NET
AsAIFunction(this AIAgent, options, session) accepts a session (AgentExtensions.cs).
Proposed shape (needs maintainer input)
Add optional config to the agenttool constructor, e.g.:
agenttool.New(a, agenttool.Config{
ArgName: "task", // default "query" (matches .NET)
ArgDescription: "...",
PropagateSession: true, // thread the caller's *agent.Session into the sub-run
})
Open questions:
- How to obtain the caller session at
Call time — thread it via context, or capture from the invoking run? (Go tool Call(ctx, argsJSON) has no session param today.)
- Should session propagation be opt-in (default off, matching a stateless tool) or default on (matching Python's common usage)?
- Whether to also surface sub-agent approval/user-input requests (Python raises
UserInputRequiredException; .NET returns .Text — Go currently matches .NET).
Filing issue-first per CONTRIBUTING (new public API). Happy to implement once the direction is settled.
Parity gap surfaced comparing
tool/agenttoolagainst .NET/Python.Gap
agenttoolhardcodes a singlequerystring argument and runs the sub-agent with an independent context, returning onlyresp.String(). It cannot:Note: the tool name/description defaults and the
queryarg name already match .NET (AgentExtensions.cs), so those are intentionally aligned — only session propagation and arg customization are missing.Reference
Agent.as_tool(arg_name="task", arg_description=..., propagate_session=..., ...)(_agents.py).AsAIFunction(this AIAgent, options, session)accepts asession(AgentExtensions.cs).Proposed shape (needs maintainer input)
Add optional config to the
agenttoolconstructor, e.g.:Open questions:
Calltime — thread it via context, or capture from the invoking run? (Go toolCall(ctx, argsJSON)has no session param today.)UserInputRequiredException; .NET returns.Text— Go currently matches .NET).Filing issue-first per CONTRIBUTING (new public API). Happy to implement once the direction is settled.