Skip to content

Remote invocations fail with 500 Internal Server Error when running azd ai agent invoke --protocol invocations #724

@Menghua1

Description

@Menghua1

Description:
When testing Scenario 1: Hello World (Python, Invocations), Scenario 3: LangGraph Toolbox (Responses), and Scenario 6: existing Foundry project, remote invoke fails in all cases. Running azd ai agent invoke --protocol invocations returns 500 Internal Server Error.
Image

Running azd ai agent monitor --tail 20 to check the logs showed that the service starts successfully and /readiness returns 200, but handling POST /invocations fails with the following exception: AttributeError: 'InvocationAgentServerHost' object has no attribute 'request_span'.
Image
Image

Steps to Reproduce:

  1. mkdir py-hello-invocations and cd py-hello-invocations
  2. Run azd ai agent init --manifest "https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/bring-your-own/invocations/hello-world/agent.manifest.yaml" and select location northcentralus.
  3. Run azd up.
  4. Run azd ai agent invoke --protocol invocations '{"message": "Hello from hosted agent"}'.
  5. Run azd ai agent monitor --tail 20.

Environment:

  • Azd version: azd version 1.26.0-beta.1-daily.6335418 (commit 84dd634326889128cfc0b605e3956cf515be42a8) (daily).
  • AI Agent Extension version: 0.1.32-preview
  • Manifest URL:
Scenario 1: Hello World (Python, Invocations): https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/bring-your-own/invocations/hello-world/agent.manifest.yaml
Scenario 3: LangGraph Toolbox (Responses): https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/bring-your-own/responses/langgraph-toolbox/agent.manifest.yaml
  • OS: Windows
  • Location: northcentralus.

Expected Behavior:
Remote invoke should succeed.

@JeffreyCA and @rajeshkamal5050 for notification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions