Skip to content

fix: missing compliance and triage agents in response in content gen#1072

Merged
Avijit-Microsoft merged 9 commits into
devfrom
FIX_Akhileswar
Jun 29, 2026
Merged

fix: missing compliance and triage agents in response in content gen#1072
Avijit-Microsoft merged 9 commits into
devfrom
FIX_Akhileswar

Conversation

@Akhileswara-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request strengthens the orchestration planning and completion logic to ensure that all required agents are included and invoked in every workflow. It introduces a mechanism to enforce the participation of every team agent in the plan, prevents the orchestrator from skipping mandatory agents, and updates tests to reflect these stricter requirements.

Orchestration enforcement and prompt logic:

  • The orchestration manager now collects all participant agent names and passes them to the prompt builder, ensuring that every agent (including coordinator and validation agents like TriageAgent and ComplianceAgent) is explicitly required in the generated plan.

Testing and validation:

  • Unit tests are updated and expanded to verify that the new enforcement logic is present in the prompt outputs, including checks for the mandatory agents block and completion enforcement in both interactive and non-interactive team scenarios.
    Miscellaneous:

  • Minor test infrastructure improvements, such as adding missing imports in conftest.py.

Does this introduce a breaking change?

  • Yes
  • No

Other Information

This pull request strengthens orchestration plan enforcement by ensuring all required agents are included in the plan and that every plan step is executed before completion. The main changes add a new mechanism to pass participant agent names into the orchestration prompt, enforce mandatory inclusion of these agents in the plan, and require that every plan-step agent actually runs before the workflow is considered complete. Tests are updated to cover these new behaviors.

Orchestration enforcement and prompt improvements:

  • The orchestration manager now collects all participant agent names and passes them to the plan prompt, ensuring that every team agent (such as TriageAgent and ComplianceAgent) is explicitly required in the generated plan.
  • The get_magentic_prompt_kwargs function accepts a new participant_names parameter, and when provided, the prompt includes a "MANDATORY AGENTS" section listing all required agents. The orchestrator will not accept plans that omit any of these agents.* The plan execution rules are updated so that completion is only possible if every plan-step agent has actually run and produced a substantive response. The orchestrator will not finish early if any agent is skipped, even for teams without user interaction.

Testing and validation:

  • Tests are updated and expanded to verify that completion enforcement applies even when user_responses is false, that the "MANDATORY AGENTS" block appears in the plan prompt when participant names are provided, and that the enforcement logic does not leak user-clarification rules into non-interactive teams.
    Test configuration:

  • Minor test configuration changes were made to conftest.py to support the new test structure.

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 pull request tightens orchestration prompt construction so the orchestrator is explicitly required to include all team agents in the plan and to avoid early completion before all planned agents have run, with accompanying unit-test updates.

Changes:

  • Extend get_magentic_prompt_kwargs() to accept participant_names and inject a “MANDATORY AGENTS” block into the plan prompt.
  • Apply completion-enforcement rules via progress_ledger_prompt for both interactive and non-interactive teams.
  • Update orchestration manager to pass participant agent names into the prompt builder; expand tests and minor test config imports.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/backend/orchestration/plan_review_helpers.py Adds participant-aware mandatory-agent enforcement and always-on completion rules in orchestrator prompts.
src/backend/orchestration/orchestration_manager.py Collects participant names from agents and passes them into prompt kwargs.
src/tests/backend/orchestration/test_plan_review_helpers.py Updates/expands unit tests to assert new mandatory-agent and completion-enforcement behaviors.
conftest.py Adds missing imports used for adjusting sys.path in tests.

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

Comment thread src/backend/orchestration/plan_review_helpers.py
Comment thread src/backend/orchestration/plan_review_helpers.py
Comment thread src/backend/orchestration/plan_review_helpers.py Outdated
@Avijit-Microsoft Avijit-Microsoft merged commit 2fee0fc into dev Jun 29, 2026
13 of 16 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.

3 participants