Repository navigation
Preserve inline agents and skills in embedded prompts - #76429
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Category: bug | Risk: medium | Score: 55/100 (impact 27 + urgency 16 + quality 12) | Recommended action: batch_review | Notes: preserves inline agents and skills in embedded prompts; cross-cutting compiler correctness fix with real runtime implications.
|
1 similar comment
|
Category: bug | Risk: medium | Score: 55/100 (impact 27 + urgency 16 + quality 12) | Recommended action: batch_review | Notes: preserves inline agents and skills in embedded prompts; cross-cutting compiler correctness fix with real runtime implications.
|
|
Category: bug | Risk: medium | Score: 55/100 (impact 27 + urgency 16 + quality 12) | Recommended action: batch_review | Notes: preserves inline agents and skills in embedded prompts; runtime correctness fix with moderate urgency.
|
1 similar comment
|
Category: bug | Risk: medium | Score: 55/100 (impact 27 + urgency 16 + quality 12) | Recommended action: batch_review | Notes: preserves inline agents and skills in embedded prompts; runtime correctness fix with moderate urgency.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: 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.
|
|
✅ 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.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ 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.
|
There was a problem hiding this comment.
Found one blocking correctness issue: the new prompt content path overwrites mainWorkflowMarkdown, which is also consumed by metadata, validation, and hash/input analysis. This changes behavior beyond the intended prompt embedding. Please preserve the stripped artifact for those consumers and use a separate prompt-only field.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| mainWorkflowMarkdown := markdownContent | ||
| if c.inlinePrompt || resolveInlinedImports(result.Frontmatter) { | ||
| var promptIncludedFiles []string | ||
| mainWorkflowMarkdown, promptIncludedFiles, err = parser.ExpandIncludesWithManifest(result.Markdown, markdownDir, false, c.getSharedImportCache()) |
There was a problem hiding this comment.
mainWorkflowMarkdown is consumed beyond prompt embedding (for example by collectMarkdownMetadata, prompt-tool/runtime-import validation, and compiler hash/input analysis). Replacing it with the re-expanded raw result.Markdown makes inline agent/skill sections flow into those consumers too, contrary to the stated intent to keep stripped Markdown for metadata/tool processing, and can change metadata, validation behavior, and generated hashes for existing workflows. Please preserve the stripped value for these consumers and introduce a separate prompt-only field for the embedded markdown.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design and /tdd. The fix is correct, and the regression test is real: it fails when the 8-line change is reverted. One design point needs a decision before merge.
📋 Key Themes & Highlights
Key Themes
- Shared field now holds unstripped bodies:
MainWorkflowMarkdownalso feeds metadata scanning (compiler_markdown_metadata.go) and tool validation (prompt_tool_validation.go). Those paths previously saw stripped Markdown. I did not verify whether this changes their results. See the inline comment on line 485. - Loose test assertion:
assert.Containson the whole lock file does not prove placement or uniqueness. Compiling the sample workflow shows one start marker and one end marker forgreeter, so the output is correct today.
Positive Highlights
- ✅ Reuses the same
inlined-importsandinlinePromptcondition used elsewhere, so the flags stay consistent. - ✅ Runtime stripping in
extract_inline_sub_agents.cjsreturns the stripped content after writing agent files, so the model prompt does not repeat the definitions. - ✅ The regression test fails without the fix and passes with it.
Test Status
TestCredentialFreePromptEnvironmentfails in this environment becauseGITHUB_TOKENis inherited throughos.Environ(). It also fails with this PR's compiler change reverted, so it is unrelated to the PR.- I could not compare against the base commit because the clone's promisor remote is unreachable. I used a revert of the change instead.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| mainWorkflowMarkdown := markdownContent | ||
| if c.inlinePrompt || resolveInlinedImports(result.Frontmatter) { | ||
| var promptIncludedFiles []string | ||
| mainWorkflowMarkdown, promptIncludedFiles, err = parser.ExpandIncludesWithManifest(result.Markdown, markdownDir, false, c.getSharedImportCache()) |
There was a problem hiding this comment.
[/codebase-design] This sets mainWorkflowMarkdown to the unstripped body, including inline agent and skill blocks. That field also feeds metadata and validation (compiler_markdown_metadata.go, prompt_tool_validation.go, credential_free_prompt.go, compiler_validators.go). The PR description says those paths should keep using stripped Markdown.
💡 Suggested fix
Add a separate field, for example PromptMarkdown, that carries the expanded unstripped body and is used only for prompt chunks and prompt-expression extraction. Keep MainWorkflowMarkdown stripped. If the shared field stays, add a test showing that an inline agent body which mentions a disabled tool gives the same validation result as before.
@copilot please address this.
There was a problem hiding this comment.
| "Use the greeting skill.", | ||
| "## end skill: `greeting`", | ||
| } { | ||
| assert.Contains(t, string(lockContent), expected) |
There was a problem hiding this comment.
[/tdd] assert.Contains over the whole lock file passes if the text appears anywhere in it. It does not prove the definitions reach the prompt, and it does not catch duplicates.
💡 Suggested test
Scope the check to the prompt-generation step and assert an exact count, for example assert.Equal(t, 1, strings.Count(string(lockContent), "## agent: greeter")). I confirmed this test fails without the fix, so it is a valid regression test. Tightening the assertion makes it stronger.
@copilot please address this.
There was a problem hiding this comment.
Addressed in 0554032. The regression decodes the activation job, checks only prompt-content bindings in its prompt-creation step, and asserts exactly one occurrence of each definition marker and body. It also checks extraction-step emission and covers both embedding modes.
There was a problem hiding this comment.
🟡 Changes recommended
The preserved, expanded prompt bypasses expression-validation safeguards, allowing included expressions that serialize the GitHub context to potentially expose the job token.
3 open issues
What changed in this PR
This PR addresses #76317 by preserving inline agent and skill definitions in embedded workflow prompts so runtime extraction can create their files.
Changes:
- Expands original Markdown for embedded prompts while retaining stripped Markdown for compiler processing.
- Adds a regression test checking that agent and skill markers and bodies appear in the generated lock file.
| File | Description |
|---|---|
pkg/workflow/inline_imports_test.go |
Tests preservation of inline definitions with inlined-imports: true. |
pkg/workflow/compiler_orchestrator_tools.go |
Uses original Markdown when assembling embedded prompts and tracks its included files. |
Review effort: Balanced (auto)
| mainWorkflowMarkdown := markdownContent | ||
| if c.inlinePrompt || resolveInlinedImports(result.Frontmatter) { | ||
| var promptIncludedFiles []string | ||
| mainWorkflowMarkdown, promptIncludedFiles, err = parser.ExpandIncludesWithManifest(result.Markdown, markdownDir, false, c.getSharedImportCache()) |
| mainWorkflowMarkdown := markdownContent | ||
| if c.inlinePrompt || resolveInlinedImports(result.Frontmatter) { | ||
| var promptIncludedFiles []string | ||
| mainWorkflowMarkdown, promptIncludedFiles, err = parser.ExpandIncludesWithManifest(result.Markdown, markdownDir, false, c.getSharedImportCache()) |
| mainWorkflowMarkdown := markdownContent | ||
| if c.inlinePrompt || resolveInlinedImports(result.Frontmatter) { | ||
| var promptIncludedFiles []string | ||
| mainWorkflowMarkdown, promptIncludedFiles, err = parser.ExpandIncludesWithManifest(result.Markdown, markdownDir, false, c.getSharedImportCache()) |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "0e3be8e729072b0d1c4dd12f8abd030070e1d491",
"kind": "requested",
"schema_version": "1",
"state": "339efbc554b5b56e6555f77f293dd0eb42b4a9bf1752542a44ceb0887187401a",
"work": [
"0a2db83e213b7018d123019db89ebd16aab3efa940890c7e790929ffd900fb99",
"8ca0b382dc91e1f56824a9e5215efec8e370d90d0280dcaa9a566fe5a43cae20",
"c3fcc8b4a5e90535b6691277f41f0a89462dfc134cea80b97dfd9d89d93b6903"
],
"workflow": "pr-sous-chef"
}
|
…b-agents-issue Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Updated from main using |
|
🎉 This pull request is included in a new release. Release: |


With
inlined-imports: true, the compiler stripped inline sub-agent and skill definitions before embedding the workflow prompt, so runtime extraction could not create their files. This caused tools such as Copilot’staskto fail withUnknown agent_type.## agent:) are dropped wheninlined-imports: true, so the Copilottasktool reports "Unknown agent_type" #76317