Skip to content

Fix Copilot inline-agent metadata during prompt rendering - #78828

Merged
pelikhan merged 4 commits into
mainfrom
pelikhan/unified-session-fix
Nov 18, 2026
Merged

pelikhan merged 4 commits into
mainfrom
pelikhan/unified-session-fix

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Smoke Copilot run 44142300002 failed the unified-session U4 assertion because activation wrote file-summarizer with empty frontmatter. Copilot could not discover it and substituted the built-in explore agent 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/main cleanly; 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.
  • The full make agent-report-progress completed 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.

pelikhan and others added 3 commits November 17, 2026 11:36
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]>
@github-actions

Copy link
Copy Markdown
Contributor

✅ 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:

  • Problem: Smoke test run 44142300002 revealed Copilot couldn't discover file-summarizer due to empty frontmatter after activation.
  • Solution: Preserves compiler-approved metadata before author-expression binding; extends identity normalization to Copilot (not just Claude).
  • Validation: 366 workflow recompilations, 440 unit tests, and comprehensive regression coverage for both model variants ("small" and "large").

All checklist items pass: focused change, tests present, clear description, and proper authorship context for core-team contribution.

Generated by ✅ Contribution Check · copilot · routed: haiku55 xhigh · ~18 AIC · ⌖ ~2 AIC · ⊞ 5.4K · ◷

Comment thread actions/setup/js/create_prompt.cjs Resolved
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 00:33
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 00:33
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

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.

Generated by PR Specification Reviewer for #78828 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #78828 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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 analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

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.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-c7cd01f6-3c7f-46b1-bb7a-49321215935e","parents":[],"payload":{"id":"ldg-08d83d2e-3056-40c6-9e86-cea57b5a6745","operation":"append","value":{"finding_count":0,"head_sha":"57ef63fa4e0b79709b34321fa681af3ff532e90e","outcome":"incomplete"}},"sha":"sha256:631641109325641b8d2c695d78decd9c15daa1dd02536d86df8e1df84eedf990","timestamp":"2026-11-18T00:40:04.664Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot 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.

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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-3e1123e9-87e1-4a5d-ae28-2674b715b410","parents":[],"payload":{"id":"ldg-1d324b7a-57d5-4249-be8a-1bb94de6eb07","operation":"append","value":{"finding_count":0,"head_sha":"57ef63fa4e0b79709b34321fa681af3ff532e90c","outcome":"no_findings"}},"sha":"sha256:5dfcc73c67cb8db31cbca2e322f67fe6705da5fd1545ecb92deb0c1c5ebcbab8","timestamp":"2026-11-18T00:41:13.451Z","type":"ledger_append","version":1}
History

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.

🟡 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)

Comment thread actions/setup/js/create_prompt.cjs Resolved
Comment thread actions/setup/js/create_prompt.cjs Resolved

@github-actions github-actions Bot 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.

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 on create_prompt.cjs:125). This is new because the body path now runs through transformMarkdownContent.
  • Behavior change: Copilot sub-agents now get description overwritten with the name (inline comment on extract_inline_sub_agents.cjs:151). The docs describe this, but it may not be intended.

Positive Highlights

  • ✅ The ensureClaudeSubAgentName to ensureSubAgentIdentity rename has no stale references.
  • ✅ The regression test in create_prompt.test.cjs covers both small and large paths.
  • ✅ The docs now explain the compiler-approved name.

Verification Limits

  • The JS test suite could not run: npm ci failed with a self-signed certificate error from the package proxy, so vitest was not executed. The findings come from direct probes of transformMarkdownContent and ensureSubAgentIdentity, 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

@pelikhan
pelikhan merged commit 0ffa2f7 into main Nov 18, 2026
43 checks passed
@pelikhan
pelikhan deleted the pelikhan/unified-session-fix branch November 18, 2026 01:02
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Both metadata-discovery regressions are fixed in follow-up commit 4a1960e1d9e, pushed on pelikhan/pr-review-fixes because this PR had already merged. Body-leading thematic breaks remain prose, and commented-out agent/skill fences no longer participate in metadata discovery. Active compiler-digest inputs remain unchanged. The earlier frontmatter-refactoring request is also satisfied; all three inline threads now have replies and are resolved.

The description concern is intentionally unchanged: the compiler approves only name, model, and tools, and Copilot/Claude derive descriptions from the approved agent identity as documented. Preserving arbitrary authored descriptions would expand that metadata contract rather than fix a discovery regression.

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.1

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