Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 1 deletion shell/agents/Microsoft.Azure.Agent/ChatSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ namespace Microsoft.Azure.Agent;

internal class ChatSession : IDisposable
{
private const string ACCESS_URL = "https://copilotweb.production.portalrp.azure.com/api/access?api-version=2024-09-01";
// TODO: production URL not yet working for some regions.
// private const string ACCESS_URL = "https://copilotweb.production.portalrp.azure.com/api/access?api-version=2024-09-01";
private const string ACCESS_URL = "https://copilotweb.canary.production.portalrp.azure.com/api/access?api-version=2024-09-01";

private const string DL_TOKEN_URL = "https://copilotweb.production.portalrp.azure.com/api/conversations/start?api-version=2024-11-15";
private const string CONVERSATION_URL = "https://directline.botframework.com/v3/directline/conversations";

Expand Down
7 changes: 6 additions & 1 deletion shell/agents/Microsoft.Azure.Agent/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ internal async static Task EnsureSuccessStatusCodeForTokenRequest(this HttpRespo
if (!response.IsSuccessStatusCode)
{
string responseText = await response.Content.ReadAsStringAsync(CancellationToken.None);
string message = $"{errorMessage} HTTP status: {response.StatusCode}, Response: {responseText}";
if (string.IsNullOrEmpty(responseText))
{
responseText = "<empty>";
}

string message = $"{errorMessage} HTTP status: {response.StatusCode}, Response: {responseText}.";
Telemetry.Trace(AzTrace.Exception(message));
throw new TokenRequestException(message);
}
Expand Down