Conversation
Body-level {{#import filepath}} directives were never resolved —
they appeared as raw literal text in the agent's prompt. The fix
normalizes {{#import}} (and its variants: with ?, with colon, with
both) to {{#runtime-import}} at the start of processRuntimeImports,
and updates the recursive check to also detect {{#import}} in
imported file content.
Fixes the bug where {{#import shared/broken.md}} in a workflow body
was listed as an 'Include' in the lock file manifest but its content
was never injected into the agent's prompt.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/cba000e1-4909-4342-8c90-ecfd5788a601
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/cba000e1-4909-4342-8c90-ecfd5788a601 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Create .github/shared/editorial.md with a short newspaper editorial tone
prompt. Use {{#import: .github/shared/editorial.md}} in daily-news.md,
daily-issues-report.md, and daily-team-status.md to exercise the
body-level {{#import}} directive fix.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b42f35fb-511d-4d63-a077-72511fa7397c
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit
This also serves as a real-world test of the body-level Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot review the lock file with imports:
|
When an included file lives in a sibling .github/ subdirectory (e.g. .github/shared/editorial.md when baseDir is .github/workflows/), filepath.Rel returns ../shared/editorial.md which starts with ".." and was stored as an absolute path. Fix include_expander.go to fall back to a repo-root-relative path (found by walking up to the parent of the .github directory) before resorting to the absolute path. This ensures editorial.md appears as .github/shared/editorial.md in the Includes: header. Add TestManifestIncludePathRelativeToRepoRoot to verify this behavior. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7475afe9-3b87-4bca-a04f-8c226cf82113 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit File names in header now relative: Editorial content: The Also added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7475afe9-3b87-4bca-a04f-8c226cf82113 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot recompile and make sure the editorial content is imported in the prompt. |
…mport macros in compiled prompt
Body-level {{#import: path}} directives were inlined into mainWorkflowMarkdown
at compile time but the compiled lock file prompt only showed
{{#runtime-import .github/workflows/daily-team-status.md}} — the editorial
content was invisible until the agent ran.
Add ExtractBodyLevelImportPaths to pkg/parser/include_expander.go.
It scans the markdown body for {{#import:}} directives (non-legacy) and
returns their paths converted to workspace-root-relative form.
In compiler_orchestrator_tools.go, call it and append the results to
importPaths. This causes generatePrompt to emit an explicit
{{#runtime-import .github/shared/editorial.md}} macro BEFORE
{{#runtime-import .github/workflows/daily-team-status.md}}.
At runtime, runtime_import.cjs's importedFiles Set prevents the editorial
file from being imported a second time when the workflow body is processed.
Recompile all 201 workflows — daily-news, daily-issues-report, and
daily-team-status now show:
{{#runtime-import .github/shared/editorial.md}}
{{#runtime-import .github/workflows/<workflow>.md}}
Add TestBodyLevelImportPromotedToRuntimeImport to verify behavior.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6f08bfc3-56a4-46d4-895b-c901d8fd9844
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit The fix adds Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot review the documentation |
…n imports reference Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bf7d018a-567c-4c22-bded-12bf26d3de44 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in commit
|
|
@copilot compare runtime-imports and imports |
…ecursion limitation Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8ed078fd-f77f-4893-9be9-f4f919413189 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in commit
Changes:
|
|
Hey The PR looks well-structured: tests are included for both the JS runtime layer and the Go parser/compiler, the new This PR is currently a draft — once you're ready for review, marking it ready and requesting a review from the assigned reviewers should be all that's needed. ✅
|
🧪 Test Quality Sentinel ReportTest Quality Score: 80/100✅ Excellent test quality
Test Classification DetailsView All Test Classifications (11 tests)
Flagged Tests — Minor NotesNo tests are flagged for quality concerns. Two minor observations: i️
|
…tion
Generated by the Design Decision Gate workflow to document the architectural
decision for promoting {{#import}} directives to runtime-import macros at
both compile time (Go) and runtime (JS).
|
Commit pushed:
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (279 new lines in AI has analyzed the PR diff and generated a draft ADR to help you get started: 📄 Draft ADR: The draft captures the key architectural decision: resolving body-level What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
References: §24919963187
|
There was a problem hiding this comment.
Pull request overview
Fixes body-level {{#import ...}} directives so their referenced content is injected into the runtime prompt (and made visible in compiled lockfile prompts), while also improving include-path recording in lockfile manifests to avoid absolute filesystem paths.
Changes:
- Normalize
{{#import ...}}→{{#runtime-import ...}}inruntime_import.cjs(including nested imports) and add JS tests for the supported variants. - Enhance Go compiler/parser to (a) record sibling
.github/includes as repo-root-relative paths and (b) promote body-level imports to explicit{{#runtime-import}}macros in compiled prompts; add Go tests. - Add shared editorial prompt snippet and update select workflows + regenerated lockfiles to import shared snippets / noop reminder.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/manifest_test.go |
Adds tests for repo-root-relative include paths and body-import promotion behavior |
pkg/workflow/compiler_orchestrator_tools.go |
Promotes body-level imports into runtime-import macro generation list |
pkg/parser/include_expander.go |
Adds repo-root-relative include path recording + body-import extraction helper |
docs/src/content/docs/reference/templating.md |
Documents relationship between {{#import}} and {{#runtime-import}} |
docs/src/content/docs/reference/imports.md |
Expands docs/examples for body-level {{#import}} usage and optional form |
actions/setup/js/runtime_import.cjs |
Normalizes body-level {{#import}} to runtime-import and recurses through nested imports |
actions/setup/js/runtime_import.test.cjs |
Adds test coverage for body-level import variants and nested scenario |
.github/shared/editorial.md |
New shared prompt snippet for editorial tone |
.github/workflows/daily-news.md |
Adds body-level import of shared editorial snippet |
.github/workflows/daily-issues-report.md |
Adds body-level import of shared editorial snippet |
.github/workflows/daily-team-status.md |
Adds body-level import of shared editorial snippet |
.github/workflows/daily-news.lock.yml |
Regenerated lockfile prompt/includes reflecting new runtime-imports |
.github/workflows/daily-issues-report.lock.yml |
Regenerated lockfile prompt/includes reflecting new runtime-imports |
.github/workflows/daily-team-status.lock.yml |
Regenerated lockfile prompt/includes reflecting new runtime-imports |
.github/workflows/workflow-skill-extractor.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/workflow-normalizer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/workflow-health-manager.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/workflow-generator.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/weekly-safe-outputs-spec-review.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/weekly-issue-summary.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/weekly-editors-health-check.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/video-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/unbloat-docs.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/ubuntu-image-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/typist.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/tidy.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/test-project-url-default.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/test-dispatcher.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/test-create-pr-error-handling.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/terminal-stylist.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/technical-doc-writer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/super-linter.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/sub-issue-closer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/step-name-alignment.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/static-analysis-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/stale-repo-identifier.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/spec-librarian.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/spec-extractor.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/spec-enforcer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-workflow-call.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-test-tools.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-temporary-id.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-project.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-opencode.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-multi-pr.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-gemini.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-crush.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-copilot.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-copilot-arm.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/smoke-codex.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import (plus regenerated heredoc IDs) |
.github/workflows/smoke-claude.lock.yml |
Updates compiled prompt content with explicit noop reminder block |
.github/workflows/sergo.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/semantic-function-refactor.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/security-review.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/security-compliance.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/scout.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/schema-consistency-checker.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/safe-output-health.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/research.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/repository-quality-improver.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/repo-tree-map.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/repo-audit-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/release.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/refiner.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/q.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/python-data-charts.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/prompt-clustering-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/pr-triage-agent.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/pr-nitpick-reviewer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/poem-bot.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/plan.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/pdf-summary.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/org-health-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/mergefest.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/mcp-inspector.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/lockfile-stats.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/layout-spec-maintainer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/jsweep.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/issue-triage-agent.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/issue-arborist.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import (plus regenerated heredoc IDs) |
.github/workflows/instructions-janitor.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/grumpy-reviewer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import (plus regenerated heredoc IDs) |
.github/workflows/gpclean.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/go-pattern-detector.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/go-logger.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/go-fan.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/glossary-maintainer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/github-remote-mcp-auth-test.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/github-mcp-tools-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/github-mcp-structural-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/functional-pragmatist.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/firewall-escape.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/example-workflow-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/draft-pr-cleanup.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/docs-noob-tester.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/discussion-task-miner.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/dictation-prompt.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/developer-docs-consolidator.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/dev.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/dev-hawk.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/dependabot-go-checker.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/dependabot-burner.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/delight.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/deep-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-workflow-updater.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-token-consumption-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-testify-uber-super-expert.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-team-evolution-insights.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-syntax-error-quality.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-semgrep-scan.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-secrets-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-safe-output-optimizer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-repo-chronicle.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-rendering-scripts-verifier.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-regulatory.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-performance-summary.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-observability-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import (plus regenerated heredoc IDs) |
.github/workflows/daily-firewall-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-file-diet.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-fact.lock.yml |
Updates compiled prompt content with explicit noop reminder block (plus regenerated heredoc IDs) |
.github/workflows/daily-doc-updater.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-compiler-quality.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-code-metrics.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-cli-performance.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-choice-test.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/daily-assign-issue-to-user.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/craft.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-session-insights.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-pr-prompt-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-pr-nlp-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-pr-merged-report.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-opt.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-cli-deep-research.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/copilot-agent-analysis.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/contribution-check.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/commit-changes-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/code-simplifier.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/code-scanning-fixer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/cloclo.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/cli-version-checker.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/cli-consistency-checker.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/claude-code-user-docs-review.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/ci-coach.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/brave.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/bot-detection.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/blog-auditor.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/auto-triage-issues.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/audit-workflows.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/artifacts-summary.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/architecture-guardian.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/archie.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/ai-moderator.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
.github/workflows/agent-performance-analyzer.lock.yml |
Regenerated lockfile prompt to include noop-reminder runtime-import |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 154/154 changed files
- Comments generated: 5
| ### Relationship to `{{#import}}` | ||
|
|
||
| `{{#import filepath}}` (without `runtime-`) is a simpler body-level shorthand that normalizes to `{{#runtime-import filepath}}` at runtime. It supports local files only and accepts the optional colon form (`{{#import: filepath}}`), but does not support URLs, line ranges, or the auto `.github/` prefix. Use it when you only need to inject a local file's content; use `{{#runtime-import}}` directly for URLs or line-range extraction. See [Imports](/gh-aw/reference/imports/) for details. |
There was a problem hiding this comment.
This section says {{#import ...}} does not support URLs, line ranges, or the .github/ prefix, but the runtime implementation now normalizes {{#import ...}} to {{#runtime-import ...}}, which does support those features. Please update the docs to avoid understating what {{#import}} can do (or explicitly document any intentional restrictions if you plan to enforce them).
| // Extract body-level {{#import:}} directives and append them to importPaths so they | ||
| // appear as explicit {{#runtime-import}} macros in the compiled lock file (before the | ||
| // main workflow-file macro). At runtime, runtime_import.cjs deduplicates via an | ||
| // importedFiles Set, so files imported here won't be imported a second time when | ||
| // the main workflow file body is processed. | ||
| bodyImports := parser.ExtractBodyLevelImportPaths(result.Markdown, markdownDir) | ||
| if len(bodyImports) > 0 { | ||
| orchestratorToolsLog.Printf("Found %d body-level import directive(s) to promote to runtime-import macros", len(bodyImports)) | ||
| for _, bi := range bodyImports { | ||
| importPaths = append(importPaths, bi.Path) | ||
| } | ||
| } |
There was a problem hiding this comment.
ExtractBodyLevelImportPaths returns an Optional flag, but this promotion logic drops it by appending only bi.Path. That means {{#import? ...}} / {{#import?: ...}} directives will be promoted into required {{#runtime-import ...}} macros in the compiled prompt, changing behavior and potentially failing runs when an optional file is missing. Preserve optionality when generating the runtime-import macros (e.g., emit the optional form when bi.Optional is true).
| // Convert relative paths to workspace-root-relative. | ||
| // Paths already starting with ".github/" are workspace-root-relative. | ||
| // Absolute "/" paths are also used as-is. | ||
| if !strings.HasPrefix(importPath, ".github/") && !strings.HasPrefix(importPath, "/") { | ||
| if repoRoot != "" { | ||
| fullPath := filepath.Join(baseDir, importPath) | ||
| if rel, err := filepath.Rel(repoRoot, fullPath); err == nil && !strings.HasPrefix(rel, "..") { | ||
| importPath = rel | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
ExtractBodyLevelImportPaths treats paths as absolute only when they start with "/". On Windows, absolute paths like "C:/..." won't match and will be incorrectly treated as relative, leading to malformed workspace-root-relative paths in promoted runtime-import macros. Use filepath.IsAbs(importPath) (and/or handle volume names) instead of the string prefix check.
| // Recursively process any runtime-import or body-level {{#import}} macros in the | ||
| // imported content. The recursive call to processRuntimeImports will normalize | ||
| // any {{#import}} directives before processing them. | ||
| if (importedContent && /\{\{#(?:runtime-import|import)/.test(importedContent)) { | ||
| core.info(`Recursively processing imports in ${filepathWithRange}`); | ||
| importedContent = await processRuntimeImports(importedContent, workspaceDir, importedFiles, importCache, [...importStack]); |
There was a problem hiding this comment.
The recursion trigger /\{\{#(?:runtime-import|import)/ is broad enough to match non-import macros like {{#importantthing}} (since it starts with {{#import), causing an unnecessary recursive processRuntimeImports pass and misleading "Recursively processing imports" logs. Tighten the detection to only match valid {{#runtime-import...}} or {{#import...}} directives (including the required separator), or reuse the same regexes used for normalization/matching.
| // Verify no absolute path appears in the Includes section | ||
| for line := range strings.SplitSeq(lockContent, "\n") { | ||
| if strings.HasPrefix(line, "# - /") { | ||
| t.Errorf("Found absolute path in lock file Includes section: %q", line) | ||
| } | ||
| } |
There was a problem hiding this comment.
This test’s absolute-path guard only checks for # - /..., which won’t catch Windows absolute paths once they’ve been normalized with forward slashes (e.g. # - C:/Users/...). Since CI runs on windows-latest, consider checking for drive-letter prefixes (e.g. ^[A-Za-z]:/) or parsing the path portion and using filepath.IsAbs to make the assertion cross-platform.
|
@copilot the #import syntax should be deprecated. The use should use runtime-import or the frontmatter imports. |
…d imports: frontmatter Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b24faaf7-1ce1-4f73-a6f5-46d36515ae8b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…oid duplicate macros in lock file Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b24faaf7-1ce1-4f73-a6f5-46d36515ae8b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit
The old Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
{{#import filepath}}directives placed directly in the workflow markdown body were recorded as "Includes" in the lock file manifest but their content was never injected into the agent prompt — the agent received the raw literal string instead.Root cause: In normal (non-inline) mode, the compiled prompt references the original workflow file via
{{#runtime-import .github/workflows/my-workflow.md}}. At runtime,runtime_import.cjsreads that file and handles nested{{#runtime-import}}macros recursively — but{{#import}}directives were not recognized and passed through as-is. Additionally, the compiled lock file gave no visibility into which body-level files would be imported.Changes
actions/setup/js/runtime_import.cjsprocessRuntimeImports, normalize all{{#import}}variants to{{#runtime-import}}before the main processing loop (backward-compat shim for the now-deprecated syntax). Supports all syntax forms:core.warningdeprecation notice when any{{#import}}directive is encountered.{{#import}}in imported file content, enabling proper resolution of nested body-level imports.actions/setup/js/runtime_import.test.cjs{{#import}}inside a file loaded via{{#runtime-import}}), and negative test ensuring{{#importantthing}}(no separator) is not matched.core.warningis emitted..github/shared/editorial.md(new)Daily agentic workflows
daily-news.md,daily-issues-report.md, anddaily-team-status.mdto use{{#runtime-import .github/shared/editorial.md}}(the recommended form) instead of the now-deprecated{{#import:}}syntax.pkg/parser/import_directive.go{{#import}}forms are now markedIsLegacy: true, making them deprecated alongside@include/@import.pkg/parser/include_processor.go{{#import}}directives to recommend{{#runtime-import}}for content injection or theimports:frontmatter field for configuration merging.pkg/parser/include_expander.goIncludes:header so that files in sibling.github/subdirectories are recorded with a repo-root-relative path instead of an absolute system path.findGitHubRepoRoothelper that walks up frombaseDirto the parent of.github/.ExtractBodyLevelImportPathsto scan the markdown body for{{#runtime-import}}directives (the recommended form) instead of the deprecated{{#import}}directives. Only required (non-optional) non-URL file paths are promoted. Usesfilepath.IsAbs()for cross-platform absolute-path detection.pkg/workflow/compiler_orchestrator_tools.go{{#runtime-import}}directives are now promoted to explicit macros in the compiled lock file prompt — the same treatment as frontmatterimports:entries. Optional{{#runtime-import?}}directives are excluded from promotion to prevent them being emitted as required macros.The compiled prompt for the daily workflows now shows:
pkg/workflow/manifest_test.goTestManifestIncludePathRelativeToRepoRootto verify that files in sibling.github/subdirectories are recorded with repo-root-relative paths (not absolute) in the lock fileIncludes:header.TestBodyLevelRuntimeImportPromotedToMacro(previouslyTestBodyLevelImportPromotedToRuntimeImport) to use{{#runtime-import}}directly, verifying that body-level{{#runtime-import}}macros are promoted before the main workflow file macro in the compiled prompt.Documentation
docs/src/content/docs/reference/imports.md: Updated body-level imports section to show{{#runtime-import}}as the primary recommended syntax. Added a[!WARNING]callout documenting the{{#import}}deprecation and migration path.docs/src/content/docs/reference/templating.md: Updated comparison section to note that{{#import}}is deprecated and normalizes to{{#runtime-import}}at runtime for backward compatibility; removed the incorrect "No recursion" limitation.