Skip to content

[ai-projects] v2.6.0 - #39782

Open
Glenn Harper (glharper) wants to merge 20 commits into
mainfrom
feature/ai-projects/2.6.0
Open

[ai-projects] v2.6.0#39782
Glenn Harper (glharper) wants to merge 20 commits into
mainfrom
feature/ai-projects/2.6.0

Conversation

@glharper

@glharper Glenn Harper (glharper) commented Aug 28, 2026

Copy link
Copy Markdown
Member

Packages impacted by this PR

  • @azure/ai-projects

Issues associated with this PR

Describe the problem that is addressed by this PR

The package was generated from an older TypeSpec revision and lacked the latest AI Foundry contracts.

  • API surface
    • Add Agent Insights monitors, runs, and insights with pollers that retain the run ID.
    • Add Microsoft 365 publishing operations and digital-worker metadata.
    • Add A2A tools and protocol configuration, toolbox shell tools, and Model Router contracts.
    • Add hosted-agent session configuration and routine dispatch authorization options.
    • Add draft agent-version creation and listing support.
  • Customization
    • Preserve hand-maintained client behavior while incorporating generated model additions and intentional removals.
    • Keep customized paging imports and poller helpers intact.
  • Developer experience
    • Update samples and skipped test scaffolds for the supported API surface.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Use standard TypeSpec emission for generated/, then surgically reconcile src/ to retain protected customizations and the existing public client shape.

Are there test cases added in this PR? (If not, why?)

The package build, API extraction, lint, formatting, and focused post-emitter regression tests validate the regenerated and customized surface. Service-backed tests remain skipped until recordings are available.

Provide a list of related PRs (if any)

Command used to generate this PR:(Applicable only to SDK release request PRs)

�ash npm run generate:client

Checklists

  • Added impacted package name to the issue description
  • Added a changelog
  • Does this PR need any fixes in the SDK Generator? (No generator fix identified)

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 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

Regenerates @azure/ai-projects with newer Foundry contracts, including voice-agent generation, conversation protocols, and additional tool models.

Changes:

  • Adds voice-agent generation and supporting models.
  • Incorporates generated conversation/WebSocket protocol code while preserving the customized client surface.
  • Adds a voice-agent sample and skipped test scaffold.

Reviewed changes

Copilot reviewed 21 out of 40 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sdk/ai/ai-projects/tsp-location.saved.yaml Updates the TypeSpec revision and voice-agent source path.
sdk/ai/ai-projects/test/voiceAgent.spec.ts Adds a skipped voice-agent test scaffold.
sdk/ai/ai-projects/src/models/index.ts Exports newly generated model types.
sdk/ai/ai-projects/src/index.ts Exposes new public models and generation options.
sdk/ai/ai-projects/src/classic/voiceAgentWebSocket/index.ts Wraps internal WebSocket operations.
sdk/ai/ai-projects/src/classic/agents/index.ts Adds generateAgent to agent operations.
sdk/ai/ai-projects/src/classic/agentEndpointConversations/index.ts Wraps internal conversation operations.
sdk/ai/ai-projects/src/api/voiceAgentWebSocket/options.ts Defines WebSocket request options.
sdk/ai/ai-projects/src/api/voiceAgentWebSocket/operations.ts Implements the WebSocket handshake request.
sdk/ai/ai-projects/src/api/voiceAgentWebSocket/index.ts Re-exports WebSocket protocol APIs.
sdk/ai/ai-projects/src/api/agents/options.ts Adds generation operation options.
sdk/ai/ai-projects/src/api/agents/operations.ts Implements generateAgent.
sdk/ai/ai-projects/src/api/agents/index.ts Re-exports agent generation APIs.
sdk/ai/ai-projects/src/api/agentEndpointConversations/options.ts Defines conversation operation options.
sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts Implements conversation and audio operations.
sdk/ai/ai-projects/src/api/agentEndpointConversations/index.ts Re-exports conversation protocol APIs.
sdk/ai/ai-projects/scripts/post-emitter.mjs Removes the obsolete API-version workaround.
sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts Adds a voice-agent generation sample.
sdk/ai/ai-projects/review/ai-projects-react-native.api.diff.md Updates the React Native API delta.
sdk/ai/ai-projects/review/ai-projects-browser.api.diff.md Updates the browser API delta.
sdk/ai/ai-projects/generated/models/index.ts Adds generated model exports.
sdk/ai/ai-projects/generated/index.ts Adds generated top-level exports.
sdk/ai/ai-projects/generated/classic/voiceAgentWebSocket/index.ts Adds the generated WebSocket wrapper.
sdk/ai/ai-projects/generated/classic/index.ts Exports generated operation groups.
sdk/ai/ai-projects/generated/classic/agents/index.ts Adds generated agent generation support.
sdk/ai/ai-projects/generated/classic/agentEndpointConversations/index.ts Adds generated conversation wrappers.
sdk/ai/ai-projects/generated/api/voiceAgentWebSocket/options.ts Adds generated WebSocket options.
sdk/ai/ai-projects/generated/api/voiceAgentWebSocket/operations.ts Adds generated WebSocket operations.
sdk/ai/ai-projects/generated/api/voiceAgentWebSocket/index.ts Exports generated WebSocket APIs.
sdk/ai/ai-projects/generated/api/agents/options.ts Adds generated generation options.
sdk/ai/ai-projects/generated/api/agents/operations.ts Adds generated generateAgent.
sdk/ai/ai-projects/generated/api/agents/index.ts Exports generated agent APIs.
sdk/ai/ai-projects/generated/api/agentEndpointConversations/options.ts Adds generated conversation options.
sdk/ai/ai-projects/generated/api/agentEndpointConversations/operations.ts Adds generated conversation operations.
sdk/ai/ai-projects/generated/api/agentEndpointConversations/index.ts Exports generated conversation APIs.
sdk/ai/ai-projects/generated/aiProjectClient.ts Adds generated protocol operation groups.
sdk/ai/ai-projects/.github/skills/apply-post-emitter-edits/SKILL.md Removes obsolete API-version guidance.

Comment thread sdk/ai/ai-projects/test/voiceAgent.spec.ts Outdated
Comment thread sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts Outdated
Comment thread sdk/ai/ai-projects/src/classic/agents/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts

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

Copilot reviewed 22 out of 41 changed files in this pull request and generated no new comments.

Suppressed comments (5)

Previously missed (2) — in code that hasn't changed since the last review.

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:488

  • These responses paginate with has_more/last_id, not nextLink. Without the cursor fields, iteration stops after the first page; if continuation is enabled, the follow-up request must also retain the required preview header.

This issue also appears in the following locations of the same file:

  • line 571
  • line 714
  • line 891
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/src/index.ts:536

  • The PR is titled v2.6.0 and adds customer-visible API, but package.json, src/constants.ts, and the released top CHANGELOG entry all remain at 2.5.0. Add a 2.6.0 (Unreleased) changelog entry and synchronize both version literals before merge.

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:571

  • These responses paginate with has_more/last_id, not nextLink. Without the cursor fields, iteration stops after the first page; if continuation is enabled, the follow-up request must also retain the required preview header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:714

  • These responses paginate with has_more/last_id, not nextLink. Without the cursor fields, iteration stops after the first page; if continuation is enabled, the follow-up request must also retain the required preview header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:891

  • These responses paginate with has_more/last_id, not nextLink. Without the cursor fields, iteration stops after the first page; if continuation is enabled, the follow-up request must also retain the required preview header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

Copilot AI review requested due to automatic review settings August 31, 2026 12:55

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

Copilot reviewed 22 out of 41 changed files in this pull request and generated 5 comments.

Suppressed comments (5)

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:571

  • This cursor-based response exposes only last_id/has_more, not a nextLink, so the iterator currently stops after the first page. Configure those cursor fields and carry the required preview header into follow-up requests; otherwise iteration over more than limit items either terminates early or loses the opt-in header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:714

  • This cursor-based response exposes only last_id/has_more, not a nextLink, so the iterator currently stops after the first page. Configure those cursor fields and carry the required preview header into follow-up requests; otherwise iteration over more than limit responses either terminates early or loses the opt-in header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/src/api/agentEndpointConversations/operations.ts:891

  • This cursor-based response exposes only last_id/has_more, not a nextLink, so the iterator currently stops after the first page. Configure those cursor fields and carry the required preview header into follow-up requests; otherwise iteration over more than limit conversations either terminates early or loses the opt-in header.
    { itemName: "data", apiVersion: context.apiVersion ?? "v1" },

sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts:8

  • The new samples-dev source was not published into the committed samples/v2 outputs. Run npm run generate-samples (the package's dev-tool samples publish -f wrapper) and commit the generated TypeScript/JavaScript sample plus README updates; otherwise customers browsing the published samples cannot discover this example.
/**
 * This sample demonstrates how to generate a voice agent from high-level inputs
 * using the AIProjectClient.
 *
 * @summary Generate a voice agent backed by a Foundry model deployment.

sdk/ai/ai-projects/src/index.ts:750

  • OmitPropertiesRealtimeResponse1 is an emitter-generated placeholder (including a collision suffix) leaking into the stable public API through VoiceAgentRealtimeResponse. Give this projected response base a meaningful explicit TypeSpec name and regenerate so customers are not locked into an implementation-detail symbol.

Comment thread sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts Outdated
Comment thread sdk/ai/ai-projects/src/classic/agents/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
### Packages impacted by this PR`@azure/ai-projects`### Issues
associated with this PRLinked automatically.### Describe the problem
that is addressed by this PRUpdates `@azure/ai-projects` to `2.6.0` and
regenerates it from TypeSpec commit
`9d2bce8fe225635c1a9b192f8d1d18ae1637271b` against
`feature/ai-projects/2.6.0`.- **TypeSpec inputs:** Updates the pinned
commit and retains the expanded `additionalDirectories`.- **API
surface:** Refreshes generated models, operations, serializers, exports,
and API reports.- **Customizations:** Reconciles Agent Insights and
relocated beta Voice/Conversation APIs while preserving paging,
preview-header, poller, and stream behavior.- **CI cleanup:** Applies
lint autofixes for type-only imports, removes stray post-emitter
artifacts, and fixes generated shadowing/runtime-import errors.### What
are the possible designs available to address the problem? If there are
more than one possible design, why was the one in this PR chosen?Uses
the package’s TypeSpec regeneration and post-emitter reconciliation
workflow rather than manually transcribing schema changes. This keeps
the SDK aligned with the pinned specification while retaining
handwritten customizations.### Are there test cases added in this PR?
_(If not, why?)_No focused tests were added; this change refreshes
generated contracts and existing client wiring. Existing Node and
browser suites cover the regenerated client paths.### Provide a list of
related PRs _(if any)_None.### Command used to generate this
PR:**_(Applicable only to SDK release request PRs)_N/A — this is a
TypeSpec regeneration PR.### Checklists- [ ] Added impacted package name
to the issue description- [ ] Does this PR need any fixes in the SDK
Generator? _(If so, create an Issue in the
[typespec-azure](https://github.com/Azure/typespec-azure) repository and
link it here)_- [x] Added a changelog (if necessary)<!-- START COPILOT
CODING AGENT SUFFIX -->- Fixes #39785

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: glharper <64209257+glharper@users.noreply.github.com>
Co-authored-by: Glenn Harper <glharper@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: da906d50-380f-43e0-bfe1-a5d82afd7ac6
Copilot AI review requested due to automatic review settings August 31, 2026 15:59

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

Copilot reviewed 34 out of 69 changed files in this pull request and generated 7 comments.

Suppressed comments (6)

sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:571

  • This response uses last_id/has_more cursor pagination, so the current iterator has no next page link and stops after page one. Configure the cursor fields and preserve the required preview header for follow-up requests.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:714
  • The deserialized list exposes last_id and has_more, not nextLink; without cursor configuration this iterable silently ends after its first page. The next-page request also needs the voice preview feature header.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:903
  • Conversation lists are cursor-paged, but this configuration looks only for a nextLink; any result with has_more: true is truncated to one page. Add the cursor field names and carry the required feature header to subsequent requests.
    sdk/ai/ai-projects/test/voiceAgent.spec.ts:13
  • This skipped test contributes no coverage for the new public generateAgent path, and it is not recording-ready: it never starts/stops a Recorder, uses the production credential directly, and does not inject the recorder HTTP client. Add an active recorder-backed test (including cleanup) before releasing this feature.
    sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts:9
  • Only the samples-dev source was added; the committed TypeScript/JavaScript outputs under samples/v2 are missing, so package consumers and sample publishing will not see this example. Run the package's pnpm generate-samples script (package.json:100) and commit the generated outputs.
    sdk/ai/ai-projects/src/classic/beta/index.ts:61
  • The new Agent Insights CRUD, cursor paging, and LRO surface is public but has no test coverage. Add recorder-backed happy/error cases plus item/page/continuation tests and a create-run poll-to-completion test.

Comment thread sdk/ai/ai-projects/tsp-location.saved.yaml Outdated
Comment thread sdk/ai/ai-projects/src/api/beta/voiceAgentWebSocket/operations.ts Outdated
Comment thread sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts Outdated
Comment thread sdk/ai/ai-projects/src/index.ts
Comment thread sdk/ai/ai-projects/src/classic/beta/agentInsightMonitors/index.ts
Comment thread sdk/ai/ai-projects/src/classic/beta/index.ts Outdated
Comment on lines +137 to +141
/**
* Returns default and previously-published values used to pre-populate a Microsoft 365 publish
* request for a Foundry agent.
*/
getMicrosoft365PublishDefaults: (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

FYI for this missing test comment: still discussing testing pre-reqs for this feature, requires a backing bot service resource.

### Packages impacted by this PR

`@azure/ai-projects`

### Issues associated with this PR

Follow-up coverage for #39797.

### Describe the problem that is addressed by this PR

The Microsoft 365 publishing APIs added in #39797 did not receive the
package's post-regeneration sample and test authoring passes.

- Adds a runnable sample that retrieves publish defaults, generates a
Microsoft Teams app package, and publishes an existing agent at the
least-privileged `Personal` scope.
- Documents the optional Azure Bot Service ARM resource ID in
`sample.env`.

The existing `2.6.0` changelog entry already documents the Microsoft 365
publishing feature, so no additional release-note entry is needed.

### Are there test cases added in this PR? _(If not, why?)_

### Provide a list of related PRs _(if any)_

- #39797

### Validation

- `npm run build:samples`
- `npm run check-format`

---------

Copilot-Session: da906d50-380f-43e0-bfe1-a5d82afd7ac6
Copilot AI review requested due to automatic review settings August 31, 2026 17:43

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

Copilot reviewed 36 out of 71 changed files in this pull request and generated 1 comment.

Suppressed comments (12)

Previously missed (3) — in code that hasn't changed since the last review.

sdk/ai/ai-projects/src/classic/beta/index.ts:59

  • This exposes the conversation protocol through the public project.beta surface, contrary to the PR requirement that protocol-only conversation operations remain internal. Remove this property and its public exports/changelog entry, or revise the stated API requirement if public exposure is intentional.
    sdk/ai/ai-projects/src/classic/beta/index.ts:63
  • This exposes the protocol-only WebSocket handshake through project.beta, contrary to the PR requirement that WebSocket operations remain internal. The method also returns Promise<void> rather than a usable socket, so it should not be advertised as a public connection API.
    sdk/ai/ai-projects/src/classic/beta/index.ts:61
  • This public Agent Insights operation group has no tests. Add recorded coverage for CRUD, cursor pagination, and the createRun poller so the new public surface is exercised.

sdk/ai/ai-projects/tsp-location.saved.yaml:2

  • The saved generation pin does not match the revision named in the PR and linked issue: this records 9d2bce8... (the later realtime-model-name fix), while both specify 082ad463... (publish approval status). Please either regenerate from the stated revision or update the PR/issue metadata so the provenance is accurate.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:488
  • This response paginates with last_id/has_more, but the helper is left at its nextLink defaults, so iteration stops after the first page. Next-page requests would also omit the required VoiceAgents preview header. Configure cursor fields and forward that header, as the Agent Insights list operations do.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:571
  • This cursor-based list has no nextLink, so the default paging configuration stops after page one; a resumed request would also lose the required VoiceAgents feature header. Add the cursor metadata and next-page header.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:714
  • The deserialized page exposes last_id and has_more, not nextLink; without configuring those fields this iterator cannot advance beyond the first response. Forward the preview header on the synthesized next-page request as well.
    sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/operations.ts:903
  • This list uses cursor pagination (last_id/has_more), so the current helper options end iteration after the first page. The follow-up request also needs the hardcoded VoiceAgents preview header.
    sdk/ai/ai-projects/test/voiceAgent.spec.ts:13
  • This skipped case provides no regression coverage and is not recording-ready: it bypasses the package's createRecorder/createProjectsClient utilities, does not inject the recorder transport, and never stops the recorder. Convert it to the established recorded-test pattern and enable it before release.
    sdk/ai/ai-projects/src/classic/agents/index.ts:141
  • The new Microsoft 365 publishing surface has no tests anywhere under this package; the sample does not validate request serialization, binary package handling, or service errors. Add recorded coverage for defaults, package generation, and publishing.
    sdk/ai/ai-projects/src/index.ts:206
  • The generated contract adds digitalWorkerType to both create-agent and create-version options and serializes it as digital_worker_type, but the customized src options and request bodies omit it. Exporting this type alone therefore does not let users set the new digital-worker metadata; carry the field through both public options and serializers.
    sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts:8
  • The source sample was added without its committed TypeScript and JavaScript outputs under samples/v2. Repository sample generation guidance requires running dev-tool samples publish -f after samples-dev changes (documentation/steps-after-generations.md:124-130; package.json:100).

Comment thread sdk/ai/ai-projects/src/api/beta/agentEndpointConversations/index.ts Outdated
@glharper

Copy link
Copy Markdown
Member Author

Copilot resolve merge conflicts

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Glenn Harper (@glharper) Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 1b239458-5e52-46c9-a1d9-b5f4a866139a

Sorry for the inconvenience!

….6.0

Co-authored-by: glharper <64209257+glharper@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 1, 2026 22:09

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve merge conflicts

Resolved in ca5ec18df4 by merging the latest main; the merge completed cleanly with no remaining unmerged paths.

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.

🔵 Needs a closer look

The promised voice-agent test scaffold and published TypeScript/JavaScript sample outputs are missing.

Review details

Suppressed comments (2)

sdk/ai/ai-projects/src/classic/agents/index.ts:516

  • The new public generateAgent path still has no matching reference anywhere under test/, although the PR description says a skipped voice-agent test scaffold was added. Add the promised skipped Vitest scaffold so request serialization and the preview header are at least compile-checked and ready for recording.
    sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts:23
  • This samples-dev addition was not published into either samples/v2/typescript or samples/v2/javascript, and neither generated samples README lists it. The repository workflow requires running npx dev-tool samples publish -f after editing samples-dev (documentation/steps-after-generations.md:111-130); without those committed outputs, package consumers cannot discover or run the voice-agent sample.
  • Files reviewed: 45/80 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

…fbc043948212bb25616416 (#39820)

### Packages impacted by this PR

- `@azure/ai-projects`

### Issues associated with this PR



### Describe the problem that is addressed by this PR

Refreshes the AI Projects client against TypeSpec commit
`2041c47aa75ad834eefbc043948212bb25616416` on
`feature/ai-projects/2.6.0`.

- Regenerated client surface and updated the pinned TypeSpec commit.
- Applied required customizations and synchronized changelog, samples,
and tests with the emitted API changes.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?

- Regenerate from the assigned pinned TypeSpec commit to preserve
alignment with the release branch.

### Are there test cases added in this PR? _(If not, why?)_

- Updated tests where required by the regenerated API surface.

### Provide a list of related PRs _(if any)_



### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

```powershell
npm run generate:client
```

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR need any fixes in the SDK Generator? _(If so, create
an Issue in the
[typespec-azure](https://github.com/Azure/typespec-azure) repository and
link it here)_
- [x] Added a changelog (if necessary)

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #39819

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: glharper <64209257+glharper@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 1, 2026 22:22
### Packages impacted by this PR

`@azure/ai-projects`

### Issues associated with this PR

Follow-up to the Agent Insights API regeneration in #39797 and the
cross-language customization in Azure/azure-sdk-for-python#48795.

### Describe the problem that is addressed by this PR

Agent Insights `createRun` is emitted as an LRO that resolves to
`AgentInsightRunResult`. That terminal result omits the initial
`AgentInsightRun.id`, even though callers need the ID for the paired
`getRun` and `cancelRun` operations.

The feature branch already routes this operation through `JobPoller`,
following the job LRO work in #39237 and #39455, but that exposes an
Agent Insights run as `operationState.jobId`. This PR adds the
run-specific public shape while keeping the shared implementation
generic:

- Adds `RunOperationState<TResult>` and `RunPoller<TResult>`, exposing
`operationState.runId` after `submitted()` resolves.
- Changes `project.beta.agentInsightMonitors.createRun` to return
`RunPoller<AgentInsightRunResult>`.
- Refactors `JobPoller` and `RunPoller` through one identity-preserving
wrapper covering `operationState`, `poll()`, `onProgress()`,
serialization, and resume.
- Adds focused unit coverage for run IDs, serialized poller restoration,
resource-location fallback, and existing `JobPoller` behavior.
- Records the customization in the package's post-emitter workaround
documentation and skill so regeneration does not remove it.

The Agent Insights API is new in the unreleased `2.6.0` feature branch,
so replacing its temporary `JobPoller` return type does not break a
published API.

### Are there test cases added in this PR? _(If not, why?)_

Yes. `test/public/pollingHelpers.spec.ts` covers the new run poller and
regression coverage for job pollers.

### Provide a list of related PRs _(if any)_

- Azure/azure-sdk-for-python#48795
- #39237
- #39455
- #39797

### Validation

- `npm run check-format`
- ESLint on all changed TypeScript files
- `tsc -p tsconfig.src.json --noEmit`
- `tsc -p tsconfig.test.json --noEmit`
- `TEST_MODE=playback npm run test:node`
- `TEST_MODE=playback npm run test:browser`
- `turbo build --filter=@azure/ai-projects... --token 1`
- `check-package-version ai -packages azure-ai-projects`

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: da906d50-380f-43e0-bfe1-a5d82afd7ac6

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.

🟡 Changes recommended

Draft listing support, generation provenance, voice-agent coverage, and published sample outputs remain incomplete.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

sdk/ai/ai-projects/src/classic/agents/index.ts:349

  • No test under test/ references generateAgent, although the PR description says a skipped voice-agent scaffold was added. Add coverage for the generated request, required VoiceAgents=V1Preview header, response deserialization, and service errors; this can use a mocked HTTP client while a live recording is unavailable.
    sdk/ai/ai-projects/samples-dev/agents/voiceAgent.ts:23
  • This new source sample has no published TypeScript/JavaScript counterpart or generated README entry under samples/v2. Repository guidance requires running dev-tool samples publish -f after changing samples-dev (documentation/steps-after-generations.md:124-130), otherwise package consumers do not receive the advertised voice-agent sample.
  • Files reviewed: 40/67 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +342 to +343
/** (Preview) Whether this agent version is a draft (candidate) rather than a release. The service defaults to `false` if a value is not specified by the caller. Draft versions are recorded but excluded from default 'latest' resolution and are not auto-promoted. */
draft?: boolean;
Comment thread sdk/ai/ai-projects/CHANGELOG.md Outdated
Comment thread sdk/ai/ai-projects/tsp-location.saved.yaml Outdated
## Summary

- add an AST-based synchronizer for TypeSpec-backed model removals while
preserving unrelated customized declarations
- extend post-emitter parity checks to distinguish valid generated
removals from destructive source replacement
- enforce the customized `src/index.ts` paging imports and reject
references to the nonexistent `src/restorePollerHelpers.ts`
- document the removal and barrel-preservation workflow in the skill and
workaround references
- remove Voice Agents classes, (functional test of skill update
efficacy)

## Testing

- `node --test
.github/skills/apply-post-emitter-edits/scripts/sync-generated-model-removals.test.mjs
.github/skills/apply-post-emitter-edits/scripts/check-generated-member-parity.test.mjs`
(9 passed)
- repository Prettier check for all seven changed files
- `git diff --check`

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 21:40

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.

🟡 Changes recommended

A critical model-removal bug and unresolved TypeSpec and public API inconsistencies must be fixed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (4)

sdk/ai/ai-projects/CHANGELOG.md:8

  • Every changelog bullet must link its associated PR or issue, but this entry has no reference. Append the same PR link used by the related Agent Insights entry.
- Add `RunOperationState` and `RunPoller` types, exposing the `runId` of an Agent Insights run on the poller returned by `project.beta.agentInsightMonitors.createRun`.

sdk/ai/ai-projects/review/ai-projects-browser.api.diff.md:10

  • This package's post-emitter cleanup explicitly requires removing review/ai-projects-browser.api.diff.md as a stray generated artifact (sdk/ai/ai-projects/.github/skills/apply-post-emitter-edits/SKILL.md:348-362). Updating its hunk offset leaves that cleanup incomplete; delete the file instead.
    sdk/ai/ai-projects/review/ai-projects-react-native.api.diff.md:10
  • The same cleanup rule requires removing review/ai-projects-react-native.api.diff.md before the regeneration is complete (sdk/ai/ai-projects/.github/skills/apply-post-emitter-edits/SKILL.md:348-362). Do not commit the regenerated line-number offset; delete this artifact.
    sdk/ai/ai-projects/src/classic/agents/index.ts:138
  • This new non-beta public feature has no authoritative snippet in test/snippets.spec.ts and no package README reference; the standalone sample does not participate in the repository's snippet synchronization. Add a named snippet covering the Microsoft 365 publishing flow and reference it from the package README.
  • Files reviewed: 43/68 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment on lines +121 to +125
const dependsOnRemoval = [...entry.references].some((name) => plannedNames.has(name));
const supportsOnlyRemoval = entry.names.some(
(name) => removedReferences.has(name) && !survivingReferences.has(name),
);
if (dependsOnRemoval || supportsOnlyRemoval) {
Comment on lines +429 to +430
/** Optional parameters. */
export interface AgentsGenerateAgentOptionalParams extends OperationOptions {}
Comment thread sdk/ai/ai-projects/src/index.ts Outdated
Comment on lines +576 to +580
VoiceItemAudioResponse,
VoiceAudioRole,
VoiceAudioContainerFormat,
VoiceAudioCodec,
VoiceRecordingResponse,
Comment thread sdk/ai/ai-projects/tsp-location.saved.yaml
Comment thread sdk/ai/ai-projects/CHANGELOG.md Outdated
….6.0

# Conflicts:
#	sdk/ai/ai-projects/CHANGELOG.md
#	sdk/ai/ai-projects/package.json
#	sdk/ai/ai-projects/src/constants.ts
Copilot AI review requested due to automatic review settings September 2, 2026 21:51
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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.

🔵 Needs a closer look

The advertised generateAgent API is missing, model-removal tooling is unsafe, and changelog issues remain.

Review details

Suppressed comments (6)

sdk/ai/ai-projects/.github/skills/apply-post-emitter-edits/scripts/sync-generated-model-removals.mjs:125

  • This reverse dependency check can delete unrelated public custom models. For example, the accompanying test schedules exported CustomSupport for removal merely because RemovedModel extends it; CustomSupport does not depend on the removed declaration and may still be consumed directly. This also contradicts the documented behavior of removing aliases/helpers that depend on removed declarations. Only close over declarations whose own references point to an already planned removal.
      const dependsOnRemoval = [...entry.references].some((name) => plannedNames.has(name));
      const supportsOnlyRemoval = entry.names.some(
        (name) => removedReferences.has(name) && !survivingReferences.has(name),
      );
      if (dependsOnRemoval || supportsOnlyRemoval) {

sdk/ai/ai-projects/CHANGELOG.md:8

  • This changelog entry is the only user-visible entry without a PR or issue link. Add the same PR reference used by the surrounding 2.6.0 feature entries.
- Add `RunOperationState` and `RunPoller` types, exposing the `runId` of an Agent Insights run on the poller returned by `project.beta.agentInsightMonitors.createRun`.

sdk/ai/ai-projects/CHANGELOG.md:3

  • Adding 2.6.0 (Unreleased) leaves the empty 2.5.1 (Unreleased) section immediately below it, so the changelog now claims two simultaneous unreleased package versions. Remove the superseded empty 2.5.1 section (or date it if it was actually released) before preparing 2.6.0.
## 2.6.0 (Unreleased)

sdk/ai/ai-projects/src/api/agents/options.ts:430

  • The PR advertises project.agents.generateAgent(...) as the voice-agent generation API, but this is an orphan options type: there is no generateAgent function in the operations barrel, no member on AgentsOperations, and the extracted API report contains no callable method. As written, customers cannot use the headline feature or the example in the PR description. Add the generated/customized operation through the protocol and classic layers (plus the stated sample), or remove this type and correct the PR scope.
    sdk/ai/ai-projects/src/classic/agents/index.ts:138
  • These new public Microsoft 365 methods are absent from both the package README and test/snippets.spec.ts. Add a named README snippet (for example, ReadmeSampleMicrosoft365Publishing) and reference it from the README so the new API has a compile-checked usage example; the standalone generated sample does not participate in the snippet synchronization system.
    sdk/ai/ai-projects/src/index.ts:633
  • The advertised project.agents.generateAgent(...) API is absent: this options type is the only GenerateAgent symbol in src, and there is no implementation, client member, voice-agent sample, or test. The pinned TypeSpec commit explicitly disables the voice-agents/routes.tsp import, and the current generated/ tree does not contain this type either, so the example in the PR description cannot compile. Either restore the operation from an appropriate TypeSpec revision with its sample/coverage, or remove the stale option/voice exports and update the PR description.
  • Files reviewed: 43/68 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 3, 2026 00:56

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.

🟡 Changes recommended

A critical unsafe model-removal synchronizer and a draft-pagination header bug remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

sdk/ai/ai-projects/CHANGELOG.md:11

  • The release notes omit the newly added draft agent-version creation and listing support (draft, includeDrafts, and the preview opt-in), even though it is a user-visible part of this release. Add it to the 2.6.0 feature list so consumers can discover the new workflow.
- Add hosted-agent session configuration and routine dispatch authorization options. [#39797](https://github.com/Azure/azure-sdk-for-js/pull/39797)

sdk/ai/ai-projects/src/classic/agents/index.ts:138

  • These new Microsoft 365 operations have no corresponding example in test/snippets.spec.ts or snippet reference in the package README. The standalone sample does not update the package's compiled, synchronized README examples; add a snippet covering defaults/package generation/publishing and reference it from README.md.
    sdk/ai/ai-projects/src/classic/beta/index.ts:55
  • The newly public Agent Insights subclient has no corresponding example in test/snippets.spec.ts or snippet reference in the package README. Add a snippet demonstrating monitor creation and run polling (including operationState.runId) and reference it from README.md so the new API is documented with compile-checked usage.
  • Files reviewed: 42/67 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +52 to +53
if (ts.isIdentifier(node) && allNames.has(node.text)) {
references.add(node.text);
Comment on lines +1225 to +1230
headers: {
...(options?.foundryFeatures !== undefined
? { "foundry-features": options?.foundryFeatures }
: {}),
accept: "application/json",
...options.requestOptions?.headers,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ai-projects] regen from 3c4aab72901077a0fc50da18f4aef6832d36d60f against main

4 participants