Skip to content

fix(ai-agents): honor uv.lock during local run#9237

Merged
trangevi merged 1 commit into
mainfrom
glharper/9226-honor-uv-lock
Jul 23, 2026
Merged

fix(ai-agents): honor uv.lock during local run#9237
trangevi merged 1 commit into
mainfrom
glharper/9226-honor-uv-lock

Conversation

@glharper

Copy link
Copy Markdown
Member

Summary

  • use uv sync --locked when a Python agent project contains both pyproject.toml and uv.lock
  • treat the lock file as authoritative instead of applying additional requirements.txt installs afterward
  • require uv for locked projects while preserving the existing pip fallback for unlocked projects

Testing

  • go test ./internal/cmd -count=1
  • go build ./...
  • golangci-lint run ./internal/cmd/...
  • exercised uv sync --locked --python <venv-python> --quiet against a temporary uv project and confirmed the lock file was unchanged

Fixes #9226

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fed9e97b-e79b-4889-ac76-0d9a428599cd
Copilot AI review requested due to automatic review settings July 21, 2026 20:54
@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.

@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.

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

Updates local Python agent runs to honor uv.lock.

Changes:

  • Uses uv sync --locked for locked projects.
  • Preserves pip fallback for unlocked projects.
  • Adds coverage for command selection and missing uv.

Reviewed changes

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

File Description
internal/cmd/run.go Implements lock-aware dependency installation.
internal/cmd/run_test.go Tests locked and fallback behavior.

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 21, 2026

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Honoring uv.lock via uv sync --locked is the right call, and requiring uv only for locked projects while keeping the pip fallback for unlocked ones is a clean split. Tests cover the lock-authoritative, pyproject-only, requirements-only, and missing-uv paths. CI is green.

@trangevi
trangevi merged commit e6f0357 into main Jul 23, 2026
30 checks passed
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.

[azure.ai.agents] Honor uv.lock in azd ai agent run

4 participants