Skip to content

[Issue] azure.ai.agents suggests removed azd ai agent project set command #9331

Description

@huimiu
  • Make sure you've installed the latest version using instructions

Output from azd version

N/A — found by code inspection on main.

Describe the bug

When the azure.ai.agents extension can't resolve a Foundry project endpoint, it returns a missing_project_endpoint error whose suggestion tells the user to run:

azd ai agent project set <endpoint>

That command no longer exists. It was moved to the azure.ai.projects extension as azd ai project set. The agents extension's own code acknowledges the removal — internal/cmd/project_context_store.go:18-19 describes projectContextConfigPath as "the legacy UserConfig path used by the removed azd ai agent project set command" — but the user-facing suggestion string was never updated.

Source: cli/azd/extensions/azure.ai.agents/internal/cmd/project_endpoint.go:126-134

func noProjectEndpointError() error {
	return exterrors.Dependency(
		exterrors.CodeMissingProjectEndpoint,
		"no Foundry project endpoint resolved",
		"persist a workspace default with `azd ai agent project set <endpoint>`, "+
			"or set FOUNDRY_PROJECT_ENDPOINT in the active azd environment, "+
			"or export FOUNDRY_PROJECT_ENDPOINT in your shell",
	)
}

This looks like a missed spot when the command moved. Every other extension emitting the same suggestion already has the correct text:

File Suggested command
azure.ai.projects/internal/cmd/project_endpoint.go:135 azd ai project set
azure.ai.connections/internal/foundry/projectctx/validator.go:108 azd ai project set
azure.ai.toolboxes/internal/foundry/projectctx/validator.go:108 azd ai project set
azure.ai.skills/internal/cmd/endpoint.go:191 azd ai project set
azure.ai.agents/internal/cmd/project_endpoint.go:130 azd ai agent project set

To Reproduce

  1. Install the azure.ai.agents extension.
  2. Make sure no project endpoint can be resolved — no FOUNDRY_PROJECT_ENDPOINT in the active azd environment or shell, and no persisted workspace default.
  3. Run an agents command that resolves the project endpoint (for example azd ai agent eval without --project-endpoint).
  4. Read the suggestion in the error output and run the command it names.

Expected behavior

The suggestion names a command that exists, so copy-pasting it works:

persist a workspace default with `azd ai project set <endpoint>`, or set
FOUNDRY_PROJECT_ENDPOINT in the active azd environment, or export
FOUNDRY_PROJECT_ENDPOINT in your shell

Actual behavior

The suggestion names the removed azd ai agent project set. A user who follows it hits an unknown-command error and has no working path forward from that message.

Why this matters

missing_project_endpoint is part of the largest Invalid Input bucket on azd deploy for agent services ("required project or environment configuration is missing", ~1.4% of deploys). The suggestion string is the main recovery path we give users for that failure, so pointing it at a removed command turns a recoverable error into a dead end.

Environment

N/A — affects all platforms.

Additional context

Fix is a one-line change to the suggestion string in noProjectEndpointError(), matching the wording already used by the other four extensions. project_endpoint_test.go:99-108 covers the error code and category but not the suggestion text, so a short assertion on the suggestion would keep the five copies from drifting again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions