Repository navigation
Fix Copilot inline-agent metadata during prompt rendering - #78828
Conversation
Preserve compiler-owned metadata before binding author expressions and supply native Copilot agent identity without weakening unified-session assertions. Co-authored-by: Copilot App <[email protected]>
…ion-fix Co-authored-by: Copilot App <[email protected]>
…ion-fix Co-authored-by: Copilot App <[email protected]>
|
✅ This fix is ready for review — thanks for catching and resolving the Copilot agent discovery issue! The PR is focused, well-tested, and thoroughly validated:
All checklist items pass: focused change, tests present, clear description, and proper authorship context for core-team contribution.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Reviewed the changed lines and tests. I found no actionable correctness, regression, performance, or maintainability issues in this diff. The new metadata transformation is backed by the existing compiler metadata helper, and the Copilot identity behavior is covered by the added tests.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
Prompt creation can abort when a workflow body starts with a thematic break or an HTML-commented example contains an unmatched frontmatter fence, because metadata detection misinterprets both cases.
2 open issues
What changed in this PR
This PR fixes inline-agent metadata handling during gh-aw prompt rendering so Copilot can discover generated agents and retain experiment-selected models.
Changes:
- Preserve compiler-approved metadata before author-expression binding.
- Share name and description normalization between Copilot and Claude.
- Add rendering regressions, update identity expectations, and document generated metadata.
| File | Description |
|---|---|
docs/src/content/docs/reference/inline-sub-agents.md |
Documents generated identity and model preservation. |
actions/setup/js/prompt_provenance_regressions.test.cjs |
Expects generated identity for both engines. |
actions/setup/js/markdown_metadata.test.cjs |
Tests document-frontmatter removal boundaries. |
actions/setup/js/markdown_metadata.cjs |
Adds a document-frontmatter removal helper. |
actions/setup/js/interpolate_prompt.test.cjs |
Updates Copilot identity expectations. |
actions/setup/js/extract_inline_sub_agents.test.cjs |
Tests shared identity normalization and unchanged Codex output. |
actions/setup/js/extract_inline_sub_agents.cjs |
Applies shared identity normalization to Copilot. |
actions/setup/js/create_prompt.test.cjs |
Adds author-file regressions for model preservation and frontmatter removal. |
actions/setup/js/create_prompt.cjs |
Uses metadata-aware transforms during author-file rendering. |
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, and /codebase-design. Requesting changes on one correctness regression.
📋 Key Themes & Highlights
Key Themes
- Prompt body regression: author bodies are now parsed as metadata when they start with a
---rule (inline comment oncreate_prompt.cjs:125). This is new because the body path now runs throughtransformMarkdownContent. - Behavior change: Copilot sub-agents now get
descriptionoverwritten with the name (inline comment onextract_inline_sub_agents.cjs:151). The docs describe this, but it may not be intended.
Positive Highlights
- ✅ The
ensureClaudeSubAgentNametoensureSubAgentIdentityrename has no stale references. - ✅ The regression test in
create_prompt.test.cjscovers both small and large paths. - ✅ The docs now explain the compiler-approved name.
Verification Limits
- The JS test suite could not run:
npm cifailed with a self-signed certificate error from the package proxy, so vitest was not executed. The findings come from direct probes oftransformMarkdownContentandensureSubAgentIdentity, not from the test suite. - The PR claims 440 passing tests, which I could not confirm.
@copilot please address the review comments above.
Comments that could not be inline-anchored
actions/setup/js/create_prompt.cjs:125
**[/diagnosing-bugs]** Silent prompt-data loss: the author body now goes through `transformMarkdownContent`, which treats a leading `---` as a metadata fence. A body that opens with a horizontal rule and has a later `---` loses its prose. In a probe, the input `---`, a paragraph, `---`, `End of guide` rendered as `---`, `{}`, `---`, `End of guide`, so the paragraph was dropped. An unterminated leading `---` throws. <details> <summary>💡 Suggested fix</summary> Keep the author body on plain str...
actions/setup/js/extract_inline_sub_agents.cjs:151
**[/codebase-design]** `ensureSubAgentIdentity` sets `description` to the agent name unconditionally, so an authored description is overwritten. Example: `description: Summarizes files` becomes `file-summarizer`. This is new for Copilot, and `create_prompt.test.cjs:59` locks it in. The docs at `inline-sub-agents.md:76` describe a derived description, so this may be intended. <details> <summary>💡 Suggested change</summary> Preserve an authored description and fall back to the name only when no...
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
|
Both metadata-discovery regressions are fixed in follow-up commit 4a1960e1d9e, pushed on The description concern is intentionally unchanged: the compiler approves only |
|
🎉 This pull request is included in a new release. Release: |

Summary
Smoke Copilot run 44142300002 failed the unified-session U4 assertion because activation wrote
file-summarizerwith empty frontmatter. Copilot could not discover it and substituted the built-inexploreagent under the same display name.Preserve compiler-approved metadata before author-expression binding, so experiment-selected models survive activation. Reuse Claude's name/description normalization for Copilot discovery without expanding the compiler metadata projection or weakening U4. Add author-file regressions for both model variants, update identity expectations, and document the generated identity.
Merged the latest
origin/maincleanly; no conflicts required resolution.Validation
make merge-main: build and all 366 workflow recompilations passed.make agent-report-progress-no-test: passed after the merge.npm --prefix actions/setup/js run typecheck --silent: passed.npm --prefix actions/setup/js run test:js -- --no-file-parallelism create_prompt.test.cjs extract_inline_sub_agents.test.cjs interpolate_prompt.test.cjs prompt_provenance_regressions.test.cjs interpolate_prompt_injection.test.cjs smoke_model_routing_assertions.test.cjs: 440 tests passed after the merge.make agent-report-progresscompleted build, schema and impacted-test checks; its initially missing linter dependencies were restored and the failed lint stage rerun successfully.Read-only security review passed with no confirmed vulnerabilities. No live workflow was dispatched or rerun.