Python: add Magentic custom manager prompts sample - #7876
Open
NekoPunch (orangeCatDeveloper) wants to merge 2 commits into
Open
Python: add Magentic custom manager prompts sample#7876NekoPunch (orangeCatDeveloper) wants to merge 2 commits into
NekoPunch (orangeCatDeveloper) wants to merge 2 commits into
Conversation
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 05:48 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 05:48 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 05:48 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 05:49 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
NekoPunch (orangeCatDeveloper)
August 26, 2026 05:49
View session
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 05:49 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Python sample demonstrating custom Magentic manager prompts for an incident-review workflow.
Changes:
- Overrides six planning, replanning, ledger, and final-answer prompts.
- Streams participant and task-ledger output.
- Adds the sample to the orchestration README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
python/samples/03-workflows/orchestrations/README.md |
Links the new sample. |
python/samples/03-workflows/orchestrations/magentic_custom_prompts.py |
Implements and documents custom manager prompts. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 06:19 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 06:20 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 26, 2026 06:25 — with
GitHub Actions
Active
NekoPunch (orangeCatDeveloper)
force-pushed
the
python/magentic-custom-prompts-sample
branch
from
August 27, 2026 09:48
f9bb5f4 to
b34c8ca
Compare
NekoPunch (orangeCatDeveloper)
deployed
to
github-app-auth
August 27, 2026 09:48 — with
GitHub Actions
Active
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.
Motivation & Context
MagenticBuilderaccepts an override for each ofStandardMagenticManager's seven built-in prompts, but no sample shows it, so users with a required report format have to read_magentic.pyto find the knobs and the placeholders available to each prompt.Description & Review Guide
What are the major changes?
A new sample,
python/samples/03-workflows/orchestrations/magentic_custom_prompts.py, runs an incident review board and overrides six of the seven prompts. Two design points:The replan prompts are overridden alongside the initial ones because a stall makes the manager rebuild both the fact sheet and the plan — overriding only the initial prompts would silently drop the custom format mid-run.
progress_ledger_promptis deliberately left at its default: its response is parsed as JSON, so an override must reproduce the built-in schema. The docstring says so, along with a table of every overridable prompt and its available placeholders. Overrides may omit placeholders they do not need.What is the impact of these changes?
Samples only, plus one README row.
What do you want reviewers to focus on?
Whether the prompt/placeholder table still matches the
StandardMagenticManagercontract.Ruff and targeted Pyright checks are clean.
To exercise the same path a sample user follows, I created a temporary Foundry V2 project in East US 2, deployed
gpt-4.1-mini, and authenticated withAzureCliCredential. I then ran:The process exited successfully after emitting
PLAN_CREATEDwith the customINCIDENT REVIEW BRIEF, streaming participant responses, and producing a final report with the requestedSUMMARY,FINDINGS, andRECOMMENDATIONsections. The temporary deployment, project, and resource group were deleted afterward.The nightly
validate-03-workflowsjob is currently disabled, so this was a manual end-to-end run.Related Issue
Fixes #7298
Contribution Checklist
breaking changelabel or put[BREAKING]in the title prefix — a workflow keeps the label and title prefix in sync automatically.