Skip to content

fix(azure.ai.agents): suggest azd ai project set, not the removed command - #9365

Merged
trangevi merged 1 commit into
mainfrom
glharper/fix-9331-project-set-suggestion
Jul 30, 2026
Merged

fix(azure.ai.agents): suggest azd ai project set, not the removed command#9365
trangevi merged 1 commit into
mainfrom
glharper/fix-9331-project-set-suggestion

Conversation

@glharper

Copy link
Copy Markdown
Member

Fixes #9331

Problem

When azure.ai.agents can't resolve a Foundry project endpoint, noProjectEndpointError() returned a suggestion telling the user to run:

azd ai agent project set <endpoint>

That command no longer exists — it moved to the azure.ai.projects extension as azd ai project set. A user following the suggestion hits unknown command, with no path forward.

This was a missed spot when the command moved. Every peer extension already emits 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

This extension's own project_context_store.go:19 already describes the command as removed, so only the user-facing string was stale.

Fix

One-line change to the suggestion text.

The new suggestion is also functionally correct here, not just cosmetically: azd ai project set persists to extensions.ai-projects.context, and getProjectContext (project_context_store.go) already reads that key as the canonical source, ahead of the legacy fallback. So a user who follows the corrected suggestion actually unblocks themselves.

Regression coverage

TestNoProjectEndpointError previously asserted only the error code and category, which is why this drifted unnoticed. It now also asserts the suggestion names azd ai project set and does not contain azd ai agent project set.

Verified the assertion is meaningful — "azd ai agent project set" does not contain "azd ai project set" as a substring, so the new assert.Contains fails against the old string.

Validation

From cli/azd/extensions/azure.ai.agents:

  • go build ./... — clean
  • go test ./internal/cmd/ -count=1 — ok (full package, 22.0s)
  • gofmt -s -l ./internal — no output
  • golangci-lint run ./internal/cmd/... — 0 issues

Notes

  • Extension-only change; no core cli/azd changes, so this needs no core release.
  • No go.mod / go.sum changes.
  • Per cli/azd/AGENTS.md, CHANGELOG.md is intentionally left to the release/version-bump PR.

…ommand

The `missing_project_endpoint` error told users to run
`azd ai agent project set <endpoint>`, which no longer exists. That command
moved to the azure.ai.projects extension as `azd ai project set`.

This was a missed spot when the command moved: every peer extension
(azure.ai.projects, azure.ai.connections, azure.ai.toolboxes,
azure.ai.skills) already emits the correct text, and this extension's own
project_context_store.go already documents the command as removed.

The new suggestion is also functionally correct here: `azd ai project set`
writes `extensions.ai-projects.context`, which getProjectContext already
reads as the canonical key.

Adds a regression assertion on the suggestion string so this cannot drift
again silently.

Fixes #9331

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e7ba2e0e-80cf-4226-b56e-ac7cbbc7338f
Copilot AI review requested due to automatic review settings July 30, 2026 14:35
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Corrects the agents extension’s recovery guidance for missing Foundry project endpoints.

Changes:

  • Replaces the removed command with azd ai project set.
  • Adds regression assertions for the supported and removed commands.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/cmd/project_endpoint.go Corrects the suggested command.
internal/cmd/project_endpoint_test.go Prevents stale command guidance from returning.

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 30, 2026
@trangevi
trangevi merged commit 22d0da7 into main Jul 30, 2026
30 checks passed
trangevi added a commit that referenced this pull request Jul 30, 2026
…leases (#9371)

* chore: prepare azure.ai.agents 1.0.0-beta.8 release

Bump version and add changelog for 10 PRs since beta.7:
- Features: max_stalls early-stopping (#9314), invocations protocol 2.0.0 default (#9327)
- Bug fixes: #9365, #9328, #9291, #9290, #9212, #9211, #9280, #9237

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* chore: prepare azure.ai.projects 1.0.0-beta.4 release

Bump version and add changelog for 1 PR since beta.3:
- Bug fix: cap Foundry ARM deployment names to 64 chars (#9292)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* chore: add imatiach to cspell contributor aliases

Fix cspell-ext CI gate failure for the azure.ai.agents CHANGELOG entry
referencing @imatiach-msft (PR #9314).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants