Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
7904494
added skip-grammar flag for online translation tests
robgruen Jul 15, 2026
1a1e65b
added display name
robgruen Jul 15, 2026
585e108
Improved flakiness, restructured playerSchema a bit to accommodate ch…
robgruen Jul 16, 2026
6dd9ff1
regenerated keywords
robgruen Jul 16, 2026
9672f6d
Merge remote-tracking branch 'origin/main' into dev/robgruen/flakey
Copilot Jul 16, 2026
2a8c6e6
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 16, 2026
25742ee
docs: regenerate README.AUTOGEN.md for changed packages
typeagent-bot[bot] Jul 16, 2026
e6cfd5c
updated actions
robgruen Jul 16, 2026
b512d0e
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 16, 2026
bbefa21
Merge remote-tracking branch 'origin/main' into dev/robgruen/flakey
Copilot Jul 16, 2026
857253e
Updated with new action name.
robgruen Jul 16, 2026
a91c407
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 16, 2026
14e67e2
fix: sync variant grammar fixtures and benchmark with renamed player …
Copilot Jul 16, 2026
77dab63
Merge remote-tracking branch 'origin' into dev/robgruen/flakey
robgruen Jul 17, 2026
6263919
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 17, 2026
26827cd
replaced play* references with playMusic
robgruen Jul 17, 2026
c5d5f10
re-generated explantions for playMusic
robgruen Jul 17, 2026
8395d63
fix: change \"play despacito\" to \"play nocturne by chopin\" in cons…
Copilot Jul 17, 2026
6faf6e3
reduced list test flakiness
robgruen Jul 17, 2026
34649bf
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 17, 2026
2aad007
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 17, 2026
5cbf258
fix: make artist optional in player construction cache and training data
Copilot Jul 17, 2026
556e19a
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 17, 2026
4cfa900
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 17, 2026
18fb07d
fix: parse construction cache namespace hashes correctly
Copilot Jul 17, 2026
5529241
fix: tighten replay cache namespace parsing
Copilot Jul 17, 2026
3a3c1da
test: cover replay cache activity suffix parsing
Copilot Jul 17, 2026
047419d
style: clarify replay cache namespace parsing intent
Copilot Jul 17, 2026
ee4eba4
docs: clarify replay cache activity suffix handling
Copilot Jul 17, 2026
cb5f17e
docs: regenerate README.AUTOGEN.md for changed packages
typeagent-bot[bot] Jul 17, 2026
993af8c
Merge remote-tracking branch 'origin' into dev/robgruen/flakey
robgruen Jul 18, 2026
096d557
entity comparison update
robgruen Jul 18, 2026
18006d1
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 18, 2026
5678f90
updated to checkout V5 action (because of node20 in v4 is soon to be …
robgruen Jul 18, 2026
ad67987
allow various different formats on output string
robgruen Jul 18, 2026
e581949
added mcp_filesystem agent description to help disambiguate bad actio…
robgruen Jul 18, 2026
615c31a
less flakiness!?
robgruen Jul 18, 2026
6e46b18
removed action browser from git ignore since we have a workflow regen…
robgruen Jul 18, 2026
0346524
Merge remote-tracking branch 'origin' into dev/robgruen/flakey
robgruen Jul 18, 2026
5543786
fixed command reference generation failure
robgruen Jul 18, 2026
72be227
dispatcher: tolerant result-chaining + dedicated pendingRequests slot
robgruen Jul 18, 2026
5723cf3
more flakiness fixes
robgruen Jul 18, 2026
f91a97b
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 18, 2026
493ac56
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 18, 2026
6068e61
docs: regenerate README.AUTOGEN.md, command reference, and action bro…
typeagent-bot[bot] Jul 18, 2026
e5333ab
Fix lint ratchet failure in multipleActionSchema typing
Copilot Jul 19, 2026
7d91111
Update multiple action result reference comment
Copilot Jul 19, 2026
e5899f5
Merge branch 'dev/robgruen/flakey' of https://github.com/microsoft/Ty…
robgruen Jul 19, 2026
eea5d5a
updated heal trigger
robgruen Jul 19, 2026
a439158
Merge remote-tracking branch 'origin' into dev/robgruen/flakey
robgruen Jul 20, 2026
1868413
Fixed misroute from List.addItem.
robgruen Jul 21, 2026
19ee7ce
UPdated player manifest to eliminate some flakiness.
robgruen Jul 21, 2026
a1b5c1d
added "lastAction" to the translation history context to prevent doub…
robgruen Jul 21, 2026
0b45e46
fixed flakey attachment test
robgruen Jul 21, 2026
7351b3d
Updated schema commands to include memories as well.
robgruen Jul 21, 2026
80b075d
default model to GPT 4-1 matches CI
robgruen Jul 21, 2026
f75fa6a
added tolerance for exact match duplicates (pending future fix).
robgruen Jul 21, 2026
77e4fa5
translate tests: suite-wide reliability metric (MTTF-in-tokens) + tre…
robgruen Jul 22, 2026
006828e
small tweak to clarify action schema
robgruen Jul 22, 2026
8314f2d
dispatcher: add optional reason to reasoningAction schema
robgruen Jul 22, 2026
8af0262
reliability doc: record repeat=20 pre/post-fix runs
robgruen Jul 22, 2026
24e6189
added status_error guard for missing undefined check
robgruen Jul 22, 2026
8f66e0f
updated report
robgruen Jul 22, 2026
3e37ce5
Merge branch 'main' into dev/robgruen/flakey
robgruen Jul 22, 2026
8192acc
style: apply prettier formatting and policy fixes
typeagent-bot[bot] Jul 22, 2026
5ee6c9f
docs: regenerate README.AUTOGEN.md, command reference, and action bro…
typeagent-bot[bot] Jul 22, 2026
3849e13
ci: allow complexity hotspot in fetchWithPool
Copilot Jul 22, 2026
5d227ff
docs: regenerate README.AUTOGEN.md, command reference, and action bro…
typeagent-bot[bot] Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ts/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ examples/websiteAliases/cache
docs/overview/action-browser.html
docs/overview/action-browser.json

# Generated translation-test reliability doc (regenerated by
# reliability/report.ts; not hand-edited, so exclude to avoid table-alignment
# churn with the generator's own output).
packages/defaultAgentProvider/test/reliability/README.md

# VS Studio Files
.vs/**

10 changes: 5 additions & 5 deletions ts/packages/agents/player/README.AUTOGEN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- AUTOGEN:DOCS:START -->

<!-- AUTOGEN:DOCS:HASH:sha256=bdedf2df4ae25635fa55eb520cefcac37c2603ae4d134c5d8efa2167146c9bfd -->
<!-- AUTOGEN:DOCS:HASH:sha256=5db751d517695472ac1d263ab300fa96a23d48f59cbf1aec3f58eeab6d05b7d4 -->
<!-- AUTOGEN:DOCS:SOURCE: ./README.md (hand-written documentation; this file is the AI-generated companion) -->

# music — AI-generated documentation
Expand All @@ -16,11 +16,11 @@ The `music` package, located in `ts/packages/agents/player/`, is a TypeAgent app

## What it does

The `music` package provides a wide range of actions for interacting with Spotify. These actions are organized into several functional categories:
The `music` package provides a comprehensive set of actions for interacting with Spotify. These actions are grouped into several functional categories:

### Playback Control

The agent allows users to control playback on active Spotify devices. Key actions include:
The agent supports controlling playback on active Spotify devices. Key actions include:

- `playTrack`, `pause`, `resume`, `next`, `previous`: Basic playback controls.
- `setVolume`, `changeVolume`: Adjust playback volume.
Expand All @@ -36,7 +36,7 @@ Users can manage their playlists with actions such as:

### Search and Discovery

The agent supports searching Spotify's music catalog with actions like:
The agent allows users to search Spotify's music catalog with actions like:

- `searchTracks`, `searchForPlaylists`, `searchArtists`, `searchAlbums`, `searchGenres`: Search for tracks, playlists, artists, albums, or genres.

Expand Down Expand Up @@ -164,6 +164,6 @@ _3 environment variables referenced from `./src/` (set in `ts/.env` or your shel

---

_Auto-generated against commit `493ac5696974a3cab9c5528399a245063e7eb727` on `2026-07-18T23:55:00.731Z` by `docs-generate.yml`. Links validated at that commit; the working tree may have drifted by up to 24h. Re-run `pnpm --filter music docs:verify-links` to spot-check._
_Auto-generated against commit `8192acc149ab6f52296dcc71202b20253b6a3089` on `2026-07-22T05:16:33.340Z` by `docs-generate.yml`. Links validated at that commit; the working tree may have drifted by up to 24h. Re-run `pnpm --filter music docs:verify-links` to spot-check._

<!-- AUTOGEN:DOCS:END -->
2 changes: 1 addition & 1 deletion ts/packages/agents/player/src/agent/playerManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"emojiChar": "🎧",
"description": "Agent to play music",
"schema": {
"description": "Music Player agent that lets you search for, play and control music.",
"description": "Music Player agent to play and control music. Use it to play, start, put on, queue, or listen to a specific song, artist, album, genre, or playlist (named or described by mood, e.g. 'chill music for studying'); control playback (pause, resume, skip/next, previous, shuffle, repeat, volume); choose the playback device; and browse, search, or manage playlists and favorites.",
"originalSchemaFile": "./playerSchema.ts",
"schemaFile": "../../dist/agent/playerSchema.pas.json",
"grammarFile": "../../dist/agent/playerSchema.ag.json",
Expand Down
34 changes: 18 additions & 16 deletions ts/packages/aiclient/README.AUTOGEN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- AUTOGEN:DOCS:START -->

<!-- AUTOGEN:DOCS:HASH:sha256=b700ecd67acb598b3c80e4ec216b3339b9d5e9cd7d6647aaf5939841325549c9 -->
<!-- AUTOGEN:DOCS:HASH:sha256=460c00288db1689212dbb9bfba3e09ce7cbf4a072bf0f4e995a26c8aa285a565 -->
<!-- AUTOGEN:DOCS:SOURCE: ./README.md (hand-written documentation; this file is the AI-generated companion) -->

# @typeagent/aiclient — AI-generated documentation
Expand All @@ -12,38 +12,40 @@

## Overview

The `@typeagent/aiclient` package is a TypeScript library designed to interact with AI APIs, including OpenAI endpoints (both Azure-hosted and OpenAI-hosted) and Bing search APIs. It is primarily used within the TypeAgent project for sample agents and examples, providing tools to manage API settings, authentication, and multi-region endpoint pools.
The `@typeagent/aiclient` package is a TypeScript library designed to interact with AI APIs, including OpenAI (both Azure-hosted and OpenAI-hosted) and Bing. It is primarily used within the TypeAgent project for sample agents and examples. The library provides tools for API settings management, authentication, and multi-region endpoint pooling to ensure high availability and resilience.

## What it does

The `aiclient` package provides a range of capabilities for interacting with AI services:
The `aiclient` package offers the following capabilities:

- **OpenAI API Support**: Includes functionality for accessing OpenAI models hosted on Azure and OpenAI, such as GPT-4 and embedding models.
- **Bing API Support**: Provides tools for interacting with Bing search APIs.
- **Multi-region Endpoint Pools**: Implements a mechanism to distribute requests across multiple endpoints, mitigating throttling and ensuring high availability.
- **Environment-based Configuration**: Reads settings such as API keys and endpoints from environment variables, simplifying integration with existing infrastructure.
- **OpenAI API Integration**: Supports GPT-4, embeddings, and image generation models hosted on Azure and OpenAI.
- **Bing API Integration**: Provides tools for querying Bing search APIs.
- **Multi-region Endpoint Pools**: Implements a mechanism to distribute requests across multiple endpoints, handling throttling and regional outages.
- **Environment-based Configuration**: Automatically discovers API settings, such as endpoints and API keys, from environment variables.
- **Authentication**: Supports Azure identity-based authentication and API key-based authentication.
- **Debug Logging**: Offers detailed logging for endpoint selection, rotation, and retry behavior.

### Multi-region Endpoint Pools

The package's endpoint pool mechanism is designed to handle throttling and regional failures gracefully. It rotates requests among endpoints based on priority tiers and health status. Key features include:
The package's endpoint pooling mechanism ensures reliability and performance by:

- **Priority-based Selection**: Endpoints are grouped into priority tiers, with the lowest-priority tier containing healthy endpoints being selected.
- **Cooldown Mechanism**: Endpoints that return transient errors (e.g., 429, 5xx) are temporarily marked as unavailable and excluded from selection.
- **Custom Pool Configuration**: Users can override the default endpoint discovery and priority settings using environment variables.
- **Endpoint Discovery**: Scanning environment variables to build pools of endpoints for each model and region.
- **Priority-based Selection**: Grouping endpoints into priority tiers and selecting the lowest-priority tier with healthy endpoints.
- **Cooldown Mechanism**: Temporarily marking endpoints as unavailable after transient errors (e.g., 429, 5xx).
- **Custom Pool Configuration**: Allowing users to override default endpoint discovery and priority settings using JSON-based environment variables.

### Debugging and Logging

The package includes debug logging capabilities for monitoring endpoint selection, rotation, and retry behavior. Enabling the `typeagent:pool` namespace provides detailed logs for troubleshooting.
Debug logging can be enabled for monitoring endpoint selection, rotation, and retry behavior. Use the `typeagent:pool` namespace for detailed logs.

## Setup

To use the `@typeagent/aiclient` package, you need to configure the following environment variables:
To use the `@typeagent/aiclient` package, configure the following environment variables:

- **`COPILOT_ALLOW_GET_PROVIDER_ENDPOINT`**: Controls whether the Copilot SDK is allowed to retrieve provider endpoints dynamically.
- **`COPILOT_ALLOW_GET_PROVIDER_ENDPOINT`**: Determines whether the Copilot SDK can dynamically retrieve provider endpoints.
- **`TYPEAGENT_COPILOT_SDK_LOG_LEVEL`**: Sets the log level for the Copilot SDK. Valid values include `none`, `error`, `warning`, `info`, `debug`, and `all`.

Additionally, the package relies on a set of environment variables for endpoint pools and API keys. These are dynamically discovered based on the model and region. For example:
Additionally, the package relies on dynamically discovered environment variables for endpoint pools and API keys. Examples include:

- `AZURE_OPENAI_ENDPOINT_<MODEL>_<REGION>`: Specifies the endpoint for a given model and region.
- `AZURE_OPENAI_API_KEY_<MODEL>_<REGION>`: Specifies the API key for a given model and region.
Expand Down Expand Up @@ -142,6 +144,6 @@ _2 environment variables referenced from `./src/` (set in `ts/.env` or your shel

---

_Auto-generated against commit `5cbcf613f047f08749d0451296eb1cdc610ae414` on `2026-07-17T18:24:18.404Z` by `docs-generate.yml`. Links validated at that commit; the working tree may have drifted by up to 24h. Re-run `pnpm --filter @typeagent/aiclient docs:verify-links` to spot-check._
_Auto-generated against commit `3849e13a69115bff7c01ea3995c20bb2cf23343f` on `2026-07-22T05:45:45.787Z` by `docs-generate.yml`. Links validated at that commit; the working tree may have drifted by up to 24h. Re-run `pnpm --filter @typeagent/aiclient docs:verify-links` to spot-check._

<!-- AUTOGEN:DOCS:END -->
18 changes: 18 additions & 0 deletions ts/packages/aiclient/src/restClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ export type PoolCallOptions = {
signal?: AbortSignal | undefined;
};

// code-complexity-allow: endpoint-pool retry/cooldown flow needs explicit per-status handling.
async function fetchWithPool(
pool: EndpointPool,
method: "POST" | "GET",
Expand Down Expand Up @@ -741,6 +742,23 @@ async function fetchWithPool(
continue;
}

// callFetch can resolve to `undefined` (not only throw) on a dropped
// connection; the single-endpoint fetchWithRetry path guards this
// explicitly (throwing "fetch: No response"). Without the same guard
// here, `response.status` below would throw a raw TypeError ("Cannot
// read properties of undefined (reading 'status')") that
// isTransientRequestError does NOT match, so it would surface as a hard
// failure instead of rotating to the next pool member.
// NOTE: this is the suspected (not yet stack-confirmed) source of a rare
// intermittent "reading 'status'" failure seen in the translation
// reliability tests. If that error recurs, log `response`/`.stack` here
// to confirm this is the site.
if (response === undefined) {
markTransientFailure(member);
lastError = error("fetch error: No response");
continue;
}

if (response.status === 200 || response.status === 201) {
markSuccess(member);
return success(response);
Expand Down
Loading
Loading