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

未关闭 适合新手
#10,924 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
azure, go

调研方向

从 cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go 开始,追踪 CreatePromptAgentAPIRequest 如何映射 Temperature 和 TopP 等提示字段。检查提示代理定义以及现有的映射测试(如果有)。当 maxOutputTokens: 4000 在提示代理的已部署定义中得到保留,或者 CLI 明确拒绝不支持的字段时,即为完成。

由索引模型根据 Issue 内容生成。

描述

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.)
主要语言
Go
星标
573
派生
387
平均合并
2 天 20 小时
30 天内合并 PR
196

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/azure-dev 的其他 Issue

查看 Azure/azure-dev 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。