[dotnet-port-api] agent-as-tool: session propagation and argument customization

Aperta
#1,139 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with the tool/agenttool constructor and its Call(ctx, argsJSON) entry point, then compare the referenced Python _agents.py and .NET AgentExtensions.cs behavior. Resolve the listed session, default, and approval questions with maintainers before implementation. Done means an agreed public API for argument customization and session propagation, with behavior matching the decision.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. Propagate the parent session to the sub-agent (so a sub-agent-as-tool starts stateless every call).
  2. 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:

  1. 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.)
  2. Should session propagation be opt-in (default off, matching a stateless tool) or default on (matching Python's common usage)?
  3. 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.

Lingua principale
Go
Stelle
671
Fork
68
Merge medio
18h 11m
PR unite (30g)
82

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/agent-framework-go

Tutte le issue di microsoft/agent-framework-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.