Skip to content

Remove allow_preview=True when it's not needed#47797

Open
dargilco wants to merge 9 commits into
mainfrom
dargilco/remove-allow-preview-flags-from-hosted-agents-samples
Open

Remove allow_preview=True when it's not needed#47797
dargilco wants to merge 9 commits into
mainfrom
dargilco/remove-allow-preview-flags-from-hosted-agents-samples

Conversation

@dargilco

@dargilco dargilco commented Jul 1, 2026

Copy link
Copy Markdown
Member

No description provided.

@dargilco dargilco self-assigned this Jul 1, 2026
Copilot AI review requested due to automatic review settings July 1, 2026 20:33

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

This PR removes allow_preview=True from AIProjectClient construction (and create_client/create_async_client test helpers) in samples and tests where the underlying feature no longer requires it. It follows the 2.3.0 changelog note that Hosted Agent methods are now stable, and reflects that .beta.* subclient methods (skills, memories, optimization) never required allow_preview. Two OpenAI-endpoint unit tests are renamed to drop the _and_allow_preview suffix.

Changes:

  • Drop unnecessary allow_preview=True from hosted-agent, skills, memories, optimization, and toolbox samples.
  • Update sync/async get_openai_client endpoint tests and test_prompt_agent_endpoint_responses tests to no longer pass allow_preview=True.
  • In two workflow telemetry tests (which still keep allow_preview=True), tighten kwargs.get("foundry_model_name") to kwargs["foundry_model_name"] with a str annotation.

Note (out of scope for this diff): the get_openai_client docstrings in azure/ai/projects/_patch.py and aio/_patch.py still state that agent_name requires allow_preview=True and may raise ValueError; these were not updated here and now diverge from actual behavior — a follow-up may be warranted.

Reviewed changes

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

Show a summary per file
File Description
tests/responses/test_openai_client_endpoint.py Renamed test and removed allow_preview=True; verifies agent base_url without preview flag
tests/responses/test_openai_client_endpoint_async.py Async counterpart of the same rename/removal
tests/agents/test_agents_crud.py Dropped allow_preview=True from create_client in prompt-agent endpoint test
tests/agents/test_agents_crud_async.py Async counterpart of the same removal
tests/agents/telemetry/test_responses_instrumentor.py Kept allow_preview=True (workflow agent); tightened foundry_model_name kwargs access + type annotation
samples/skills/sample_skills_crud.py / _async.py Removed allow_preview=True (uses .beta.skills)
samples/skills/sample_skills_upload_and_download.py / _async.py Removed allow_preview=True (uses .beta.skills)
samples/memories/sample_memory_basic.py / _async.py Removed allow_preview=True (uses .beta.memory_stores)
samples/hosted_agents/sample_create_hosted_agent.py / _async.py Removed allow_preview=True (stable .agents.create_version)
samples/hosted_agents/sample_toolbox_with_skill.py Removed allow_preview=True (stable agents/toolboxes + .beta.skills)
samples/agents/tools/sample_agent_toolbox_skill.py Removed allow_preview=True (stable agents/toolboxes + .beta.skills)
samples/agents/optimization/sample_optimization_job_basic.py / _basic_async.py / _cancel.py / _list_get_delete.py Removed allow_preview=True (uses .beta.agents optimization)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants