Skip to content

cannot use --local with a named agent #7928

Description

@therealjohn

Goal

Specify an agent name when using --local so you don't have to use the interactive picker when in a multi-agent project.

Context

Azure.yaml can contain multiple host: azure.ai.agent which point to different agent.yaml files (multi-agent)

Current Behavior


(foundry-hostedagentframework-demo) foundry-hostedagentframework-demo % azd ai agent invoke hosted-agentframework-agent --local "what perksplus benefits are there?"

ERROR: cannot use --local with a named agent; named agents are always invoked remotely on Foundry

Suggestion: omit the agent name for local invocation, or remove --local for remote

--local currently requires you to do an interactive selection:

(foundry-hostedagentframework-demo) foundry-hostedagentframework-demo % azd ai agent invoke --local "what perksplus benefits are there?"? Select an agent service: hosted-agentframework-agent

  Filter: Type to filter list

  > hosted-agentframework-agent    
  > hosted-agentframework-workflow

Desired Behavior

azd ai agent invoke hosted-agentframework-agent --local "what perksplus benefits are there?" works in the same way that it works without --local so you don't have to use the interactive menu.

Acceptance Criteria

  • Unit tests added or updated
  • Existing test suite passes
  • Lint or format passes
  • Remote invoke and local invoke work for both responses and invocations endpoints

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingext-agentsazure.ai.agents extension

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions