Conversation
…d runtime-imports" Agent-Logs-Url: https://github.com/github/gh-aw/sessions/695cc41a-458f-47d5-bc3d-4d944c285ada Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/695cc41a-458f-47d5-bc3d-4d944c285ada Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds best-effort validation for inline sub-agent frontmatter blocks found in imported files and {{#runtime-import}} targets, surfacing unknown-field (and parse) issues as non-fatal warnings.
Changes:
- Introduces
ValidateInlineSubAgentsFrontmatterto scan for inline sub-agents and validate allowed frontmatter keys. - Accumulates and propagates import-traversal warnings via
ImportsResult.Warnings, and prints them during compilation. - Validates runtime-imported files for inline sub-agent frontmatter and emits warnings; adds unit tests for the validator.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/sub_agent_extractor.go | Adds inline sub-agent frontmatter validation + warning generation. |
| pkg/parser/import_field_extractor.go | Invokes validation during import BFS and accumulates warnings. |
| pkg/parser/import_processor.go | Extends ImportsResult to carry collected warnings. |
| pkg/workflow/compiler_orchestrator_tools.go | Emits collected import warnings to stderr and increments warning count. |
| pkg/workflow/runtime_import_validation.go | Validates runtime-imported files for inline sub-agent frontmatter and prints warnings. |
| pkg/parser/sub_agent_validation_test.go | Adds unit tests covering validator behavior across common cases. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 4
| } | ||
|
|
||
| _, subAgents, err := ExtractInlineSubAgents(body) | ||
| if err != nil || len(subAgents) == 0 { |
| // Best-effort: detect and validate inline sub-agent frontmatter in the imported file. | ||
| // Unknown fields in sub-agent frontmatter blocks are surfaced as advisory warnings. | ||
| // Validation failures never abort the import — they are accumulated for later display. | ||
| if agentWarnings := ValidateInlineSubAgentsFrontmatter(rawContent); len(agentWarnings) > 0 { |
| if agentWarnings := parser.ValidateInlineSubAgentsFrontmatter(string(content)); len(agentWarnings) > 0 { | ||
| for _, w := range agentWarnings { | ||
| msg := fmt.Sprintf("runtime-import '%s': %s", filePath, w) | ||
| expressionValidationLog.Printf("%s", msg) | ||
| fmt.Fprintln(os.Stderr, console.FormatWarningMessage(msg)) |
| "sub-agent %q: unknown frontmatter field(s) %v (valid fields: description, model)", | ||
| agent.Name, unknown, |
…validation Captures the decision to validate inline sub-agent frontmatter fields (restricting to 'description' and 'model') as advisory warnings during import BFS traversal and runtime-import resolution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Commit pushed:
|
🧪 Test Quality Sentinel ReportTest Quality Score: 86/100✅ Excellent
Test Classification DetailsView all 8 test classifications
Flagged Tests — Requires ReviewNo tests are flagged for behavioral quality. One informational note below. i️ Test Inflation (informational only)The new test file ( However, the test file also implicitly exercises code paths in The 8 tests are genuinely covering distinct scenarios rather than padded variants. No action required; the high test volume reflects meaningful coverage of a purely new function. Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References:
|
|
@copilot review all comments |
|
@copilot update the instructions file to explain that if a AW plans to modify any top level markdown files, it should exclude them from protected-files in the front matter |
… parse, increment warning counter, comma-join field names Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b194ddc4-3a1a-4f50-9630-f5ac261f3fa8 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed all four reviewer comments in commit a0d521a:
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:
|
Summary
When the Go compiler processes
imports:frontmatter entries or{{#runtime-import}}body directives and detects inline sub-agent syntax (## agent: \name``), it now performs best-effort syntax validation of the sub-agent frontmatter blocks in those files.Changes
pkg/parser/sub_agent_extractor.goValidateInlineSubAgentsFrontmatter(markdown string) []string— strips the top-level frontmatter, scans the body for## agent: \name`sections, parses each sub-agent's frontmatter block, and returns warning messages for any unknown fields (descriptionandmodel` are the only valid fields).validateSubAgentFrontmatterFields(internal helper) that validates a singleInlineSubAgent.pkg/parser/import_field_extractor.goValidateInlineSubAgentsFrontmatterfor every file visited during BFS import traversal.warnings []stringfield toimportAccumulatorto collect advisory messages.pkg/parser/import_processor.goWarnings []stringtoImportsResultso collected warnings propagate to the compiler.pkg/workflow/compiler_orchestrator_tools.goimportsResult.Warningsto stderr as console warnings (best-effort, never fails compilation).pkg/workflow/runtime_import_validation.goparser.ValidateInlineSubAgentsFrontmatterfor each runtime-imported file and emits warnings to stderr.pkg/parser/sub_agent_validation_test.go(new)Behavior
⚠ Warning:messages on stderr; compilation always continues.