fix: missing compliance and triage agents in response in content gen#1072
Merged
Conversation
…ent inclusion in marketing content generation
…messaging for clarity
…ine task execution rules
…nd ensure completion checks for all agents, even without user responses. Update related tests for validation.
…rketing content generation plan for clarity and structure.
…or routing marketing requests to specialist agents.
Contributor
There was a problem hiding this comment.
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 acceptparticipant_namesand inject a “MANDATORY AGENTS” block into the plan prompt. - Apply completion-enforcement rules via
progress_ledger_promptfor 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.
…pletion check documentation for clarity
…ons based on response presence
Avijit-Microsoft
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
TriageAgentandComplianceAgent) 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?
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:
TriageAgentandComplianceAgent) is explicitly required in the generated plan.get_magentic_prompt_kwargsfunction accepts a newparticipant_namesparameter, 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_responsesis 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.pyto support the new test structure.