Skip to content

fix: address Copilot PR review comments (high & medium priority)#256

Closed
Ashwal-Microsoft wants to merge 12 commits into
devfrom
Ash-devtomainCC
Closed

fix: address Copilot PR review comments (high & medium priority)#256
Ashwal-Microsoft wants to merge 12 commits into
devfrom
Ash-devtomainCC

Conversation

@Ashwal-Microsoft

@Ashwal-Microsoft Ashwal-Microsoft commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This pull request includes several improvements across the codebase, focusing on robust data parsing, better error handling, and enhanced logging. The most significant changes are grouped below:

Data Parsing Consistency and Robustness:

  • Updated all price and number parsing in src/App/src/lib/textParsers.ts to replace all commas (not just the first) before parsing, ensuring correct handling of numbers with thousands separators. This affects the parseOrderItem, parsePrice, and parseProductSection functions. [1] [2] [3]

Error Handling Improvements:

  • In the E2E test test_28907_golden_path_demo_script, improved handling of the E2E_WARMUP_MS environment variable by adding a try/except block to default to 5000ms and log a warning if the value is invalid.
  • In the E2E test test_28935_new_session_clears_previous_data, added logging for exceptions during fallback force-click attempts, aiding debugging when the "New Session" button is not clickable.

Logging Configuration:

  • Fixed the logger configuration in src/api/app/main.py to use the correct logger name (agent_framework.foundry) for error suppression.

API Consistency:

  • In infra/scripts/agent_scripts/01_create_agents.py, updated create_or_update_prompt_agent to return the agent name directly instead of the result's name, simplifying the return value.- Return base agent name instead of version-scoped ID in create_or_update_prompt_agent
  • Use global regex replace for comma removal in price parsing (textParsers.ts)
  • Fix logger name from 'agent_framework_foundry' to 'agent_framework.foundry'
  • Add defensive parsing for E2E_WARMUP_MS env var
  • Replace empty except with logged debug message in test_byocc.py

Purpose

  • ...

Does this introduce a breaking change?

  • Yes
  • No

What to Check

Verify that the following are valid

  • ...

Other Information

- Return base agent name instead of version-scoped ID in create_or_update_prompt_agent
- Use global regex replace for comma removal in price parsing (textParsers.ts)
- Fix logger name from 'agent_framework_foundry' to 'agent_framework.foundry'
- Add defensive parsing for E2E_WARMUP_MS env var
- Replace empty except with logged debug message in test_byocc.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
main.py952969%57, 69, 71–74, 92, 102, 107, 125–126, 129–131, 134–137, 139–146, 149, 232–233
TOTAL240025889% 

Tests Skipped Failures Errors Time
402 0 💤 0 ❌ 0 🔥 9.892s ⏱️

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 addresses prior review feedback by tightening up parsing logic, improving test resiliency/diagnostics, and aligning logging/agent-script behavior with how the system is expected to run (Foundry agents by base name, correct logger namespace for suppression).

Changes:

  • Make numeric/price parsing robust to multiple thousands separators by replacing all commas before parseFloat.
  • Improve E2E test robustness: defensively parse E2E_WARMUP_MS and log exceptions during fallback click attempts.
  • Fix Foundry logger suppression to target agent_framework.foundry, and simplify agent creation script return values to the base agent name.

Reviewed changes

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

File Description
tests/e2e-test/tests/test_byocc.py Adds defensive env var parsing and improves logging around fallback click behavior in E2E tests.
src/App/src/lib/textParsers.ts Uses global comma removal to correctly parse prices/numbers with multiple separators.
src/api/app/main.py Updates the suppressed logger name to the correct Foundry logger namespace.
infra/scripts/agent_scripts/01_create_agents.py Returns the base agent name after version creation (rather than a version-scoped result name).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e-test/tests/test_byocc.py Outdated
Copilot AI review requested due to automatic review settings June 15, 2026 11:12

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 7 out of 7 changed files in this pull request and generated 4 comments.

fi

# Trim whitespace from environment variables to avoid issues with leading/trailing spaces
SUBSCRIPTION_ID=$(trim "${AZURE_SUBSCRIPTION_ID}")
Comment thread infra/main.bicep Outdated
Comment on lines +894 to +916
scriptContent: '''
param([string]$resourceGroupName, [string]$accountName)
$maxRetries = 60
$retryCount = 0
do {
try {
$account = Get-AzCognitiveServicesAccount -ResourceGroupName $resourceGroupName -Name $accountName -ErrorAction SilentlyContinue
if ($account -and $account.ProvisioningState -eq 'Succeeded') {
Write-Output "AI Services provisioning completed with state: $($account.ProvisioningState)"
break
}
} catch {
Write-Output "Error checking provisioning state: $_"
}
$retryCount++
if ($retryCount -ge $maxRetries) {
Write-Output "Warning: AI Services did not reach terminal state within expected time, proceeding anyway (attempt $retryCount/$maxRetries)"
break
}
Write-Output "Waiting for AI Services provisioning... (attempt $retryCount/$maxRetries)"
Start-Sleep -Seconds 5
} while ($true)
'''
Comment thread infra/main.bicep Outdated
Comment on lines +889 to +891
identity: {
type: 'SystemAssigned'
}
Comment on lines +547 to +548
echo "AZURE_ENV_GPT_MODEL_CAPACITY=${AVAILABLE_CAPACITY:-10}" >> $GITHUB_ENV
echo "AZURE_ENV_GPT_MODEL_CAPACITY=${AVAILABLE_CAPACITY:-10}" >> $GITHUB_OUTPUT
Copilot AI review requested due to automatic review settings June 15, 2026 11:35

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 7 out of 7 changed files in this pull request and generated 4 comments.

Comment on lines +85 to +86
CURRENT_VALUE=$(az cognitiveservices usage list --location "$REGION" --query "[?name.value=='$MODEL'].currentValue | [0]" -o tsv 2>/dev/null)
LIMIT=$(az cognitiveservices usage list --location "$REGION" --query "[?name.value=='$MODEL'].limit | [0]" -o tsv 2>/dev/null)
Comment thread infra/main.bicep Outdated
Comment on lines +900 to +903
properties: {
azPowerShellVersion: '12.0'
scriptContent: '''
param([string]$resourceGroupName, [string]$accountName)
Comment thread infra/main.bicep Outdated
Comment on lines +908 to +912
$account = Get-AzCognitiveServicesAccount -ResourceGroupName $resourceGroupName -Name $accountName -ErrorAction SilentlyContinue
if ($account -and $account.ProvisioningState -eq 'Succeeded') {
Write-Output "AI Services provisioning completed with state: $($account.ProvisioningState)"
break
}
Comment on lines +523 to +524
echo "AZURE_ENV_GPT_MODEL_CAPACITY=${AVAILABLE_CAPACITY:-10}" >> $GITHUB_ENV
echo "AZURE_ENV_GPT_MODEL_CAPACITY=${AVAILABLE_CAPACITY:-10}" >> $GITHUB_OUTPUT
Copilot AI review requested due to automatic review settings June 15, 2026 12:22

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 7 out of 7 changed files in this pull request and generated 4 comments.

Comment on lines 123 to 126
echo " - $MODEL: ${MIN_CAPACITY[$MODEL]}"
done
echo "QUOTA_FAILED=true" >> "$GITHUB_ENV"
exit 0
Comment on lines +554 to +556
echo "🔍 Checking subscription-wide $SEARCH_TIER tier Azure Search service count..."
TOTAL_SERVICES=$(az search service list --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} \
--query "[?sku.name=='${SEARCH_TIER}'] | length(@)" -o tsv 2>/dev/null || echo "0")
Comment on lines +558 to +561
# Subscription limits: basic=12, standard=12 (typical defaults)
# Use 12 as safe upper bound for both tiers
SUBSCRIPTION_LIMIT=12
REMAINING=$((SUBSCRIPTION_LIMIT - TOTAL_SERVICES))
Comment thread infra/main.json
],
"webServerFarmResourceName": "[format('asp-{0}', variables('solutionSuffix'))]",
"reactAppLayoutConfig": "{\n \"appConfig\": {\n \"CHAT_CHATHISTORY\": {\n \"CHAT\": 70,\n \"CHATHISTORY\": 30\n }\n }\n }\n}",
"reactAppLayoutConfig": "{\r\n \"appConfig\": {\r\n \"CHAT_CHATHISTORY\": {\r\n \"CHAT\": 70,\r\n \"CHATHISTORY\": 30\r\n }\r\n }\r\n }\r\n}",
@Ashwal-Microsoft

Copy link
Copy Markdown
Contributor Author

Working on a different issue now, dev to main was resolved earlier

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.

2 participants