Skip to content

feat: Modularity Enhancement and New use case for Content Generation - #1068

Merged
Roopan-Microsoft merged 312 commits into
mainfrom
dev
Jul 23, 2026
Merged

feat: Modularity Enhancement and New use case for Content Generation#1068
Roopan-Microsoft merged 312 commits into
mainfrom
dev

Conversation

@Dhruvkumar1-Microsoft

@Dhruvkumar1-Microsoft Dhruvkumar1-Microsoft commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Purpose

  • This pull request introduces significant improvements to the content pack system, updates deployment workflows for new branch and model support, and refines several CI/CD scripts. The most important changes are grouped below.

Content Pack System Enhancements:

  • Added a comprehensive, user-friendly guide for creating, structuring, and deploying content packs, including agent team design, data integration, and deployment checklist in .github/agents/speckit.contentpack.agent.md.
  • Introduced a new prompt definition file for the Speckit content pack agent in .github/prompts/speckit.contentpack.prompt.md.

Deployment and Workflow Updates:

  • Updated all workflow triggers and logic to use the dev branch instead of dev-v4, and incremented image tags from v4 to v5 to support the next major version. [1] [2] [3] [4] [5] [6]
  • Upgraded the default GPT model and version in deployment workflows to gpt-5.4-mini and 2026-03-17, respectively, to leverage the latest AI capabilities.

Script and Path Refactoring:

  • Moved and updated references for quota checking and team config selection scripts to the infra/scripts/pre-provision/ and infra/scripts/post-provision/ directories for better organization and maintainability. [1] [2] [3] [4] [5]

Configuration and Security Improvements:

  • Changed the source of the Azure Container Registry (ACR) login server from secrets to vars in deployment jobs for improved security and flexibility. [1] [2]

Dependency and Coverage Updates:

  • Added and updated multiple dependencies in .github/requirements.txt to support new features and testing tools.
  • Removed the .coveragerc file, possibly to reconfigure or migrate coverage settings.

These changes together modernize the agent content pack system, streamline deployment for the new version and branch structure, and improve the maintainability and security of the CI/CD process.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

TravisHilbert and others added 30 commits May 20, 2026 12:23
- test_agent_template: update mocks for new get/create_version API
  (replaces old list_agents/create_agent pattern), patch
  PromptAgentDefinition and ResourceNotFoundError for full-suite compat
- test_agent_factory: fix create_from_team_config assertions for new
  AgentTemplate constructor signature
- test_team_utils: rewrite tests for refactored load_team_config that
  returns parsed TeamConfig instead of raw dict
- test_cosmosdb: fix expected exception type (CosmosResourceNotFoundError)
- test_orchestration_manager: add get_executors_list mock, wire
  _user_interaction_ctx, set user_responses=False for inner-agent test
- test_response_handlers: fix indentation in sys.modules stubs
- conftest: pre-import backend.app to prevent sys.modules poisoning
…onAgent

- Add clarification_tool.py with approval-gated request_user_clarification tool
- Inject tool into domain agents via agent_factory extra_tools parameter
- Extend AgentTemplate to accept extra_tools list
- Rewrite orchestration_manager to detect function_approval_request events,
  send questions to frontend via WebSocket, and approve after user responds
- Remove UserInteractionAgent proxy pattern from orchestration
- Re-enable tool_history_leak patch (MAF framework bug workaround)
- Fix frontend PlanDataService parser to handle structured JSON format
  with nested .data wrapping from send_status_update_async
- Update orchestration_manager tests for new return format
…omments

- Remove diagnostic per-message cache dump from tool_history_leak patch
- Replace print() with logger.info() in patch application
- Remove unused imports from orchestration_manager.py
- Remove stale diagnostic dump from agent_template.py
- Add type: ignore[attr-defined] on intentional monkey-patch accesses
- Add noqa: ARG001 on by-design unused questions param
- Add capability comments on MagenticBuilder config and request_info events
- Change bare Exception to RuntimeError for plan cancellation

All 681 tests pass.
…erification checklists

- Add RE-INVOCATION CHECK to prevent redundant blueprint calls on resume
- Add explicit VERIFICATION CHECKLIST matching blueprint items exactly
- Separate BLUEPRINT STEP, QUESTION RULE, and EXECUTION phases
- Apply to both HRHelperAgent and TechnicalSupportAgent
Upstream PR #5690 (agent-framework 1.4.0) only fixes the fc_ duplicate
variant, not the orphaned function_call_output variant that triggers
'Progress ledger creation failed' in multi-agent Magentic workflows.
…om AppConfig

- AGENT_TEAM_FILE was never referenced anywhere in the codebase
- REASONING_MODEL_NAME duplicated ORCHESTRATOR_MODEL_NAME (already present)
- azure_config.py: superseded by direct model construction in orchestration_manager
- orchestration/patches.py: superseded by patches/tool_history_leak.py
- Neither module is imported anywhere in the codebase
- agent-framework==1.6.0 (GA umbrella)
- agent-framework-foundry==1.6.0 (Foundry integration)
- All existing imports validated — no breaking changes
…0 upgrade

- Fix agent_template.py: OpenAIChatOptions, cast(PromptAgentDefinition), typed dicts, update.text
- Fix orchestration_manager.py: Optional typing, asyncio.iscoroutine, assert narrowing
- Fix frontend tsconfig.json: add ignoreDeprecations for TS 6.0
- Fix mcp_server lint: factory.py, mcp_server.py, README formatting
- Add pyrightconfig.json (root + mcp_server) for import resolution
- Add/update pylintrc configs to suppress no-name-in-module, import-error
- Fix test_response_handlers.py: type: ignore for Mock .called access
- Collapse duplicate pylint sections in root pyproject.toml
…mework 1.6.0

- Flatten agent_teams JSON to use tool-based config (remove legacy fields)
- Simplify agent_factory.py and agent_template.py for new framework API
- Remove pyrightconfig.json files (consolidated in pyproject.toml)
- Update tests to match simplified agent creation flow
- Add e2e-test pyproject.toml
- Minor lint and type fixes across mcp_server and frontend models
…cess

The MCP image tool was returning direct blob URLs that are inaccessible
from the browser (private container, SAS generation often fails locally).

- Add backend_url config to MCP server settings
- Update image_service to return backend proxy URL when BACKEND_URL is set
- Add BACKEND_URL env var to MCP container in Bicep for deployed scenario

The backend already has a /api/v4/images/{blob_name} proxy endpoint that
fetches from blob storage using its own credential.
…s, upgrade Dockerfiles

- Remove dead Key Vault resource and all references (secret, RBAC, DNS zone)
- Fix circular dependency: BACKEND_URL uses constructed FQDN pattern
- Fix AZURE_OPENAI_IMAGE_DEPLOYMENT: use deployment variable not hardcoded string
- Add 'generated-images' blob container to storage account
- Build SUPPORTED_MODELS dynamically from deployed model names
- Add Cognitive Services OpenAI Contributor role for image generation
- Add gpt5Mini and gptImage params to main.parameters.json
- Add AZURE_OPENAI_IMAGE_DEPLOYMENT to backend container env
- Upgrade all Dockerfiles from EOL Bullseye to Bookworm
- Replace MCP devcontainer base with slim production image
- Remove dead AZURE_AI_SEARCH_API_KEY from app_config.py
- Disable MCP auth by default (runs behind backend Easy Auth)
- Integrate seed_knowledge_bases.py into post-deploy scripts (PS1 + bash)
- azure.yaml now uses main.bicep (pre-built images from public registry)
- azure_custom.yaml explicitly uses main_custom.bicep (build from source)
- Port to main_custom.bicep:
  - Add Cognitive Services OpenAI Contributor role for image generation
  - Build SUPPORTED_MODELS dynamically from deployed model names
  - Add AZURE_OPENAI_IMAGE_DEPLOYMENT to backend container env
  - Add 'generated-images' blob container to storage account
- Suppress no-hardcoded-env-urls on private link DNS zones
- Replace hardcoded login.microsoftonline.com with environment().authentication.loginEndpoint
- Remove unused storageContainerName param
- Remove unused aiSearchIndexName variable (main_custom)
- Remove unnecessary dependsOn on aiFoundryAiServices
- Add non-null assertion on guarded conditional module access
- Suppress BCP318 on unconditional userAssignedIdentity access
- Suppress no-unused-params on azd-injected container image params (main_custom)
- Suppress BCP334 theoretical length warning on container registry name (main_custom)
- Change gptImageModelName from gpt-image-1 to gpt-image-1.5
- Update gptImageModelVersion from 2025-04-15 to 2025-12-16
- Increase gptImageModelCapacity from 1 to 5 RPM (matches main_custom.bicep)
- Add infra/scripts/post_deploy.ps1: interactive use-case menu that seeds
  Cosmos DB teams, uploads blobs, creates search indexes, vector stores,
  and Foundry IQ knowledge bases directly (no backend required)
- Move seed_vector_stores.py and seed_knowledge_bases.py into infra/scripts/
- Remove top-level scripts/ directory (seed_teams.py superseded)
- Update azure.yaml postdeploy hook to invoke post_deploy.ps1
- Update requirements.txt with azure-cosmos, aiohttp, httpx deps
- Fix .gitignore: scope scripts/ rule to top-level only, remove obsolete entry
- Update agent_template.py error message to reflect new script path
- Make APPLICATIONINSIGHTS_CONNECTION_STRING optional in app_config.py
- Fix frontend PlanDataService.tsx TeamAgentBE to Agent mapping
- Remove invalid ignoreDeprecations from tsconfig.json (TS 5.8+)
…s dep

- Add azure-ai-projects to requirements.txt (fixes vector store ModuleNotFoundError)
- Track step failures with $script:hasErrors flag
- Exit with code 1 and report errors when any step fails
- Change WARNING to ERROR with red output for failed steps
- Only print 'ready to use' when all steps succeed
- Detect when toolbox stores outdated project_connection_id for KB tools
- Auto-update toolbox and patch MCPTool at runtime with correct connection
- Add search_connection_name lookup support in mcp_config
- Change AI Search Foundry connection from ApiKey to AAD with managed identity
- Add Search Service Contributor role for user-assigned MI
- Add Cognitive Services OpenAI User role for Search system MI on AI Services
- Add post-deploy step to seed KB MCP RemoteTool connections
…mpts

Domain agents now call request_user_clarification tool directly.
The framework pauses via function_approval_request events and resumes
when the user answers — no intermediary agent routing needed.

- Rewrite clarification_policy to describe tool-based pause/resume
- Remove QUESTION RELAY RULE and relay-based RE-INVOCATION RULE
- Add explicit 'do NOT select UserInteractionAgent' warnings
- Update stale comment in agent_factory.py
…tent gen use case

- Replace Azure OpenAI references with Microsoft Foundry Service
- Add Azure AI Search as a separate pricing line item
- Add Content Generation scenario to use cases table
- Update architecture and agent flow diagrams
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5d45e267-6090-4be3-9a18-eaafa983b38c
Comment thread src/tests/backend/orchestration/test_connection_config.py
Comment thread src/tests/backend/orchestration/test_connection_config.py

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
app.py64789%67, 78–80, 115, 169, 171
agents
   agent_factory.py72198%141
   agent_template.py29512358%101, 136, 141, 163–164, 166, 170, 173, 178, 183–189, 194–196, 209, 213–224, 227–231, 234, 236–238, 242–243, 247, 254, 256, 258, 262, 267, 274, 279, 284, 289, 291, 295, 306, 311, 338–341, 358–360, 365–366, 384–387, 390, 392–402, 407, 411–412, 425, 430, 452–458, 462–464, 499, 515, 520, 531–532, 534, 548, 570–571, 598–599, 658, 663, 670, 684–685, 729, 731, 734–735, 738, 740, 748–749, 752–753
api
   router.py5386887%63–64, 83–84, 93–94, 98, 113, 116, 124–125, 133–134, 363–365, 375, 407–408, 426, 431–432, 434–436, 439, 451–452, 460, 535–536, 624, 626, 629, 749–754, 758, 781, 812–815, 835, 907–908, 917, 980–981, 987, 1091–1092, 1117–1119, 1497–1506
auth
   auth_utils.py300100% 
callbacks
   response_handlers.py910100% 
common/config
   app_config.py116793%166–172
common/database
   cosmosdb.py2561992%337, 340–342, 426–427, 458–459, 508, 510, 515–520, 523–524, 528
   database_base.py1332283%51, 61, 82, 87, 92, 97, 104, 120, 125, 141, 146, 151, 156, 162, 167, 182, 187, 192, 207, 222, 237, 254
common/models
   messages.py1861393%226, 235–236, 238–245, 248–249
common/utils
   agent_utils.py190100% 
   markdown_utils.py48393%25, 42, 46
   otlp_tracing.py110100% 
   team_utils.py116992%130–131, 133–139
config
   agent_registry.py86396%53–54, 106
   mcp_config.py540100% 
models
   messages.py105199%129
   plan_models.py400100% 
orchestration
   connection_config.py1932288%79, 89–94, 97, 134, 142–147, 150, 172–173, 191–192, 298–299
   orchestration_manager.py41115761%132–133, 137, 277–278, 312, 318, 324, 328–332, 338–339, 342–343, 379, 384–385, 391–392, 428, 431, 447, 455, 459, 462, 546–547, 559, 584, 589–596, 598–603, 605, 647, 655, 659–660, 662–664, 668, 670–675, 682, 687, 691, 701–705, 708–718, 731–732, 737–740, 746–747, 763, 765, 770, 772–776, 789–792, 794, 799, 805, 807–810, 823–824, 868–869, 890–891, 899, 921, 923, 925, 927, 929–935, 937, 943, 946, 960–961, 964–965, 969–971, 975, 977, 985–987, 990–991, 993, 1051–1052, 1056, 1060, 1067, 1105–1106, 1140–1141, 1146–1149, 1161
   plan_review_helpers.py1293275%304, 308, 310–311, 317, 321–324, 326–327, 330, 332–339, 341–342, 344–345, 347–352, 525–526
   user_interaction_agent.py160100% 
orchestration/helper
   plan_to_mplan_converter.py93198%189
patches
   magentic_duplicate_fc_id.py21861%39, 54–59, 73
   tool_history_leak.py513531%38–39, 41–43, 45–46, 48–49, 51–52, 54–57, 63, 67, 76–77, 79, 82, 85, 87–89, 95, 97, 110–111, 116–120, 125
services
   base_api_service.py480100% 
   foundry_service.py58591%51–52, 108–109, 112
   mcp_service.py200100% 
   plan_service.py91891%54–55, 65–67, 82, 162–163
   team_service.py278797%73, 296–298, 481–483
TOTAL382455285% 

Tests Skipped Failures Errors Time
834 0 💤 0 ❌ 0 🔥 8.068s ⏱️

Copilot AI review requested due to automatic review settings July 20, 2026 13:51

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings July 20, 2026 14:11
Comment thread src/tests/backend/config/test_agent_registry.py
Comment thread src/tests/backend/models/test_plan_models.py Fixed
Comment thread src/tests/backend/callbacks/test_response_handlers.py Fixed
Comment thread src/tests/backend/callbacks/test_response_handlers.py Fixed
Comment thread src/tests/backend/callbacks/test_response_handlers.py Fixed
Comment thread src/tests/backend/callbacks/test_response_handlers.py Fixed
Comment thread src/tests/backend/services/test_team_service.py Fixed

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings July 21, 2026 08:42

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread src/tests/backend/common/utils/test_team_utils.py Fixed
Comment thread src/tests/backend/common/utils/test_team_utils.py Fixed
Comment thread src/tests/backend/common/utils/test_team_utils.py Fixed
Comment thread infra/scripts/post-provision/upload_team_config.py Fixed
Copilot AI review requested due to automatic review settings July 21, 2026 10:44

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread src/backend/patches/magentic_duplicate_fc_id.py Dismissed
Comment thread src/backend/patches/tool_history_leak.py Dismissed
@Roopan-Microsoft Roopan-Microsoft changed the title feat: Modularity change feat: Modularity Enhancement and New use case for Content Generation Jul 23, 2026
@Roopan-Microsoft
Roopan-Microsoft merged commit 9937162 into main Jul 23, 2026
15 checks passed
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.