Skip to content

feat: upgrade to GPT-5.4 models, add default teams with per-user isolation, and ACR image build scripts#1082

Open
Roopan-Microsoft wants to merge 10 commits into
mainfrom
psl-mainChanges
Open

feat: upgrade to GPT-5.4 models, add default teams with per-user isolation, and ACR image build scripts#1082
Roopan-Microsoft wants to merge 10 commits into
mainfrom
psl-mainChanges

Conversation

@Roopan-Microsoft

@Roopan-Microsoft Roopan-Microsoft commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Purpose

This PR bundles three related deployment/runtime improvements:

1. GPT-5.4 model upgrade

Migrates all model references from gpt-4.1 / gpt-4.1-mini / o4-mini / o3 to gpt-5.4 / gpt-5.4-mini (reasoning). Updates app config defaults, .env.sample, agent team configs, bicep model name/version params (2026-03-05 / 2026-03-17), allowed-region quota usage names, docs, and tests.

2. Default teams & per-user data isolation

  • Adds is_default flag to TeamConfiguration; seed teams are marked default.
  • Cosmos queries now return only teams owned by the current user OR default teams (user_id=@user_id OR is_default=true).
  • Default teams are protected from deletion.
  • DatabaseFactory now caches the expensive Cosmos connection (client/database/container) once and returns lightweight per-request clients bound to the caller''s user_id, ensuring ownership filters stay correct under concurrent async execution.

3. Container image build scripts

  • Adds infra/scripts/Build-And-Push-Images.ps1 and build_and_push_images.sh to build and push backend/frontend/mcp_server images to ACR and point the apps at them, wired into azure.yaml post-deploy hooks.
  • Reworks Dockerfiles to avoid BuildKit --mount so they build with az acr build (classic builder). Adds bicep *DeploymentName alias params.

Does this introduce a breaking change?

  • Yes
  • No

What to Check

  • Deployments provision gpt-5.4 / gpt-5.4-mini and required region quota.
  • Users see only their own + default teams; default teams cannot be deleted.
  • Concurrent requests are correctly scoped to the right user_id.
  • az acr build builds succeed and post-deploy hooks run the image scripts.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
common/config
   app_config.py116793%162–168
common/database
   cosmosdb.py2561992%337, 340–342, 426–427, 458–459, 508, 510, 515–520, 523–524, 528
   database_factory.py250100% 
common/models
   messages_af.py1831392%223, 232–233, 235–242, 245–246
v4/common/services
   team_service.py280996%80, 330, 387–388, 478, 481, 493–495
TOTAL306138287% 

Tests Skipped Failures Errors Time
887 5 💤 0 ❌ 0 🔥 8.590s ⏱️

mock_config.COSMOSDB_CONTAINER = "test_container"
mock_config.get_azure_credentials.return_value = "mock_credentials"

instances = []

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 updates the backend’s CosmosDB access pattern to use a shared connection with per-request user scoping, adds “default” team visibility semantics, refreshes the template’s default model/deployment names, and introduces post-provision scripts to build/push container images to ACR and update the deployed services.

Changes:

  • Refactor DatabaseFactory to cache a shared CosmosDB connection while returning user-scoped client instances per request.
  • Add is_default to team configurations and update Cosmos queries to return default + user-owned teams; prevent deletion of default teams.
  • Update infra/docs/scripts to provision an ACR, parameterize deployment aliases, use placeholder images at deploy-time, and provide post-provision build/push scripts; update default model names to GPT-5.4 variants.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/tests/backend/common/database/test_database_factory.py Updates tests for shared-connection + per-request DB factory behavior.
src/tests/backend/common/database/test_cosmosdb.py Updates tests to reflect default-team visibility filtering and delete semantics.
src/tests/agents/test_foundry_integration.py Updates test deployment name defaults.
src/tests/agents/interactive_test_harness/foundry_agent_interactive.py Updates interactive harness model deployment name.
src/backend/v4/common/services/team_service.py Parses is_default into TeamConfiguration during upload validation.
src/backend/Dockerfile Removes BuildKit-only mounts; improves compatibility with classic builders.
src/backend/common/models/messages_af.py Adds is_default field to the persisted TeamConfiguration model.
src/backend/common/database/database_factory.py Implements shared Cosmos connection caching + per-request user-scoped instances.
src/backend/common/database/cosmosdb.py Adds default-team visibility predicates; blocks deletion of default teams.
src/backend/common/config/app_config.py Updates default OpenAI deployment/model names and reasoning model default.
src/backend/.env.sample Updates sample env defaults for new model/deployment names.
src/App/Dockerfile Removes BuildKit-only mounts for broader build compatibility.
infra/scripts/Build-And-Push-Images.ps1 Adds PowerShell post-provision build/push + service update automation.
infra/scripts/build_and_push_images.sh Adds Bash post-provision build/push + service update automation.
infra/main.waf.parameters.json Adds parameters for deployment alias names.
infra/main.parameters.json Adds parameters for deployment alias names.
infra/main.bicep Adds ACR + managed-identity pulls; uses placeholder images; wires deployment aliases and outputs for scripts.
infra/main_custom.bicep Mirrors deployment-alias parameterization and wiring for the custom template variant.
docs/quota_check.md Updates default quota model/capacity guidance.
docs/DeploymentGuide.md Documents the new required post-provision image build/push step and updated model defaults.
docs/CustomizingAzdParameters.md Documents new deployment-alias parameters and updated model defaults.
data/agent_teams/rfp_analysis_team.json Updates deployment names; marks as default-visible.
data/agent_teams/retail.json Updates deployment names; marks as default-visible; updates reasoning agent deployment alias.
data/agent_teams/marketing.json Updates deployment names; marks as default-visible.
data/agent_teams/hr.json Updates deployment names; marks as default-visible.
data/agent_teams/contract_compliance_team.json Updates deployment names; marks as default-visible.
azure.yaml Updates postdeploy messaging to include the image build/push scripts.

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

Comment thread src/backend/common/database/cosmosdb.py
Comment thread src/backend/v4/common/services/team_service.py
Comment thread src/backend/common/database/database_factory.py
Comment thread infra/main.bicep Outdated
Comment thread infra/main.bicep
@Ayaz-Microsoft Ayaz-Microsoft changed the title Psl main changes feat: upgrade to GPT-5.4 models, add default teams with per-user isolation, and ACR image build scripts Jul 3, 2026
@Ayaz-Microsoft Ayaz-Microsoft marked this pull request as ready for review July 3, 2026 13:00
Copilot AI review requested due to automatic review settings July 6, 2026 05:05

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

Comment thread src/backend/v4/common/services/team_service.py
Comment thread src/backend/common/database/database_factory.py
Comment thread infra/scripts/checkquota.sh
Comment thread .github/workflows/deploy-waf.yml Outdated
Comment thread infra/main.bicep Outdated
Comment thread docs/DeploymentGuide.md Outdated
Comment thread azure.yaml

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

Comment thread src/backend/v4/common/services/team_service.py
Comment thread src/backend/common/database/database_factory.py
Comment thread infra/scripts/checkquota.sh
Comment thread infra/main.bicep Outdated
Comment thread infra/main.bicep
Comment thread infra/main.bicep
Comment thread .github/workflows/deploy-waf.yml Outdated
Copilot AI review requested due to automatic review settings July 6, 2026 10:07

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

Comment thread src/backend/v4/common/services/team_service.py
Comment thread src/backend/common/database/database_factory.py
Comment thread src/backend/common/database/cosmosdb.py
Comment thread src/backend/.env.sample
Comment thread infra/main.parameters.json
Comment thread infra/main.waf.parameters.json
Comment thread infra/main.waf.parameters.json
Comment thread infra/main.bicep
Comment thread infra/main.bicep
Comment thread infra/main.bicep
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.

4 participants