[azure.ai.agents] maxOutputTokens is silently dropped for prompt agents (kind: prompt)

Đang mở Phù hợp với người mới
#10,924 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, go
Lĩnh vực
backend-api-design, cli

Hướng nghiên cứu

Bắt đầu với cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go và theo dõi cách CreatePromptAgentAPIRequest ánh xạ các trường prompt như Temperature và TopP. Kiểm tra định nghĩa tác nhân prompt và các bài kiểm thử ánh xạ hiện có, nếu có. Công việc hoàn tất khi maxOutputTokens: 4000 được giữ nguyên trong định nghĩa đã triển khai của tác nhân prompt hoặc CLI từ chối rõ ràng trường không được hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug customer-reported ext-agents

Output from azd version

azd version 1.37.3
azure.ai.agents 1.0.0 (relevant code unchanged in 1.1.0 and on main at 3b30d4a)

Describe the bug

When a kind: prompt service in azure.yaml sets maxOutputTokens, azd deploy succeeds but the deployed agent version has max_output_tokens: null. The value is dropped without a warning or error.

CreatePromptAgentAPIRequest in cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go copies Temperature, TopP, Text, Reasoning, Tools, ToolChoice and StructuredInputs into the prompt definition, but not MaxOutputTokens. MaxOutputTokens is only mapped for voice agents, and definitionOverlay only applies to voice agents, so there is no workaround inside azd.

To Reproduce

  1. azure.yaml:

    name: repro
    services:
      repro-agent:
        host: azure.ai.agent
        kind: prompt
        name: repro-agent
        model: <model deployment>
        instructions: You are a test agent.
        reasoning:
          effort: low
        maxOutputTokens: 4000
    
  2. azd deploy repro-agent --no-prompt (with AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP and the project endpoint set in the azd environment).

  3. Read the agent back: GET {project_endpoint}/agents/repro-agent?api-version=v1.

  4. Model, instructions, reasoning and tools are applied, but versions.latest.definition.max_output_tokens is null.

Expected behavior

max_output_tokens is 4000 in the deployed definition, or azd fails with a clear error saying the field isn't supported for prompt agents.

Environment

  • azd 1.37.3, azure.ai.agents 1.0.0, Linux GitHub Actions runner (ubuntu)
  • Microsoft Foundry project, agents API api-version=v1
  • IDE: not applicable (CI)

Additional context

The Foundry agents API accepts max_output_tokens in a prompt agent's definition and stores it. Prompt agents we create by calling the API directly all read back with max_output_tokens: 4000. We use it as a per-agent output limit. If we deploy the same agents with azd, the limit disappears, the deployment still reports success, and the deployed agent no longer matches the declared configuration.

Requests:

  1. Map maxOutputTokens for kind: prompt, the same way azd maps temperature and topP.
  2. Separately, fail or warn when a declared field can't be applied to the agent kind, rather than dropping it.
  3. If max_output_tokens isn't meant to be supported on prompt agents, say so in the prompt-agent definition docs and have azd reject the field for kind: prompt. (PromptAgentDefinition in the REST reference and in azure-ai-projects 2.10.0 doesn't list it today, although the service stores it.)
Ngôn ngữ chính
Go
Star
573
Fork
387
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
196

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-dev

Tất cả issue của Azure/azure-dev

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.