Skip to content

Fix Claude persona evaluator registration - #66634

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan-workflow-failure-diagnosis
Oct 7, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan-workflow-failure-diagnosis

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Agent Persona Explorer published a partial-results report without evaluating any scenarios because Claude silently skipped its inline evaluator. The generated definition lacked Claude's required name field and used inherited instead of the native inherit model value.

  • Declare the evaluator's name and correct model inheritance.
  • Explicitly close the inline agent block so extraction preserves the parent's publishing instructions.
  • Add a workflow contract regression, correct the sub-agent guidance, and regenerate the workflow lock file.

Fixes #66615

Validation

  • go test ./pkg/cli -run '^TestAgentPersonaExplorerWorkflowSubAgentContract$' -count=1 passes; the regression failed against the original declaration.
  • Actual JavaScript runtime extraction confirms the generated Claude agent retains its required metadata and the main prompt retains its publishing instructions.
  • make fmt and make recompile pass.
  • PATH="/opt/homebrew/bin:$PATH" make agent-report-progress passes, including impacted Go tests and workflow drift checks.

Strict --dry-run compilation remains blocked by existing experimental-feature warnings for graders and gh-aw-detection. Those settings were not changed, and no live Actions run was dispatched.

Declare the required Claude agent name and use the native inherit model value. Preserve parent publishing instructions with an explicit inline agent boundary, add a workflow contract regression, and correct the sub-agent guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 7, 2026 17:05
Copilot AI balanced review requested due to automatic review settings October 7, 2026 17:05
@pelikhan
pelikhan merged commit 3bfb182 into main Oct 7, 2026
13 of 15 checks passed
@pelikhan
pelikhan deleted the pelikhan-workflow-failure-diagnosis branch October 7, 2026 17:05
Copilot stopped reviewing on behalf of pelikhan due to an error October 7, 2026 17:05
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 7, 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 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.

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

3 open findings
What changed in this PR

Adds a contract test and updates the agent-persona-explorer workflow/docs to ensure Claude sub-agent extraction and frontmatter conform to expected conventions (explicit name, correct inheritance sentinel, and proper block boundaries).

Changes:

  • Added a non-integration Go contract test that validates inline sub-agent extraction and required frontmatter fields.
  • Updated the persona-evaluator sub-agent block to include name:, use model: inherit, and explicitly close the agent block before resuming parent instructions.
  • Updated sub-agent authoring documentation to reflect engine-native frontmatter behavior and Claude requirements.
File Description
pkg/​cli/​agent_persona_explorer_workflow_contract_test.go Adds a contract test asserting sub-agent extraction boundaries and Claude-required frontmatter.
.github/​workflows/​agent-persona-explorer.md Fixes sub-agent frontmatter (name, model) and adds an explicit “end agent” boundary before parent criteria.
.github/​workflows/​agent-persona-explorer.lock.yml Regenerates lock metadata/harness version to match updated workflow body hash.
.github/​aw/​subagents.md Updates documentation on sub-agent boundaries/frontmatter semantics and adds a Claude-specific example.

🧠 Review effort: Lite


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/aw/subagents.md
### Block boundary

The block ends at the next `##` heading (any level-2 heading) or at EOF — no explicit end marker is needed. Place sub-agent blocks **at the bottom** of the file, after all main workflow content.
The block ends at the next `##` heading (any level-2 heading) or at EOF. Place sub-agent blocks **at the bottom** of the file, after all main workflow content. If parent instructions follow a sub-agent, close it with ``## end agent: `name` `` so those instructions remain in the main prompt.
Comment on lines +334 to +335
## end agent: `persona-evaluator`

@@ -0,0 +1,40 @@
//go:build !integration
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #66634

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR #66634 does not have the implementation label (has_implementation_label=false) and has 40 new lines in business logic directories, below the 100-line threshold (4 files changed, no custom .design-gate.yml).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-07T17:08:41Z
review_event: COMMENT
top_themes:
  - runtime-path regression coverage
files_reviewed:
  - .github/aw/subagents.md
  - .github/workflows/agent-persona-explorer.md
  - .github/workflows/agent-persona-explorer.lock.yml
  - pkg/cli/agent_persona_explorer_workflow_contract_test.go
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 68 AIC · ⌖ 5.35 AIC · ⊞ 19.6K · ◷
Comment /review to run again

@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.

Comment

The workflow fix itself looks reasonable, but the new regression coverage is attached to the Go parser instead of the JavaScript runtime extractor that actually writes the Claude sub-agent file, so the failure path that triggered this PR is still only manually verified.

Details

Please add the regression at the runtime extraction layer (actions/setup/js/extract_inline_sub_agents.*) so a future JS-side change cannot reintroduce the missing name/model fields or accidentally pull ## Success Criteria back into the generated agent file without breaking tests.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 68 AIC · ⌖ 5.35 AIC · ⊞ 19.6K
Comment /review to run again

}

content, err := os.ReadFile(filepath.Join(repoRoot, ".github", "workflows", "agent-persona-explorer.md"))
require.NoError(t, err)

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.

The new regression test only exercises the Go parser, so it would still pass if the JavaScript runtime extractor regressed again and wrote a Claude agent without the required name/model fields.

💡 Cover the runtime write path that actually failed

The production failure happened in the interpolate_prompt/extract_inline_sub_agents.cjs path that writes the engine-specific agent file, but this test stops at parser.ExtractInlineSubAgents and ExtractFrontmatterFromContent. That gives you a green test even if the JS extractor starts stripping or rewriting the frontmatter again.

A tighter regression would add a case next to actions/setup/js/extract_inline_sub_agents.test.cjs that runs writeInlineSubAgents(...) for the persona workflow and asserts the generated Claude file still contains name: persona-evaluator and model: inherit, and still excludes ## Success Criteria.

@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 and /grill-with-docs. Fallback classification used (pr-triage agent returned a parseable result, no fallback needed) — bug_fix, high-impact files: .github/workflows/agent-persona-explorer.md, pkg/cli/agent_persona_explorer_workflow_contract_test.go, .github/aw/subagents.md.

Verification performed: Ran go test ./pkg/cli -run '^TestAgentPersonaExplorerWorkflowSubAgentContract$' -count=1 against the PR's actual committed content (clean checkout) — it passes. The regression test correctly exercises the root cause (missing name, wrong inherited value, and marker-boundary extraction) rather than just the symptom.

📋 Key Themes & Highlights

Key Themes

  • Root cause fix, well-tested (/diagnosing-bugs): the new pkg/cli/agent_persona_explorer_workflow_contract_test.go asserts on name, description, model: inherit, and that parent publishing instructions (## Success Criteria) survive extraction — this is exactly the kind of regression test that would have caught the original silent-skip bug.
  • Doc/example drift (/grill-with-docs): the new Claude name: requirement documented in subagents.md isn't reflected in the file's own unchanged examples (dependency-scanner, diff-explainer, etc.), which could mislead a reader copying those patterns for a Claude-engine workflow. Flagged inline.
  • Markdown rendering nit: nested backticks in ## end agent: name will likely render incorrectly — flagged inline (duplicates/reinforces an existing automated review comment, worth fixing before merge since it's user-facing docs).

Positive Highlights

  • ✅ Explicit ## end agent: \name`end marker is a clean, minimal addition that reuses the existingextractInlineSections` boundary-preservation machinery already proven out for skills — no new parsing logic needed.
  • ✅ Lock file regeneration diff is exactly as expected (hash + env var only).
  • ✅ PR description is clear about root cause, fix, and validation scope, including an honest caveat about --dry-run being blocked by unrelated pre-existing warnings.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 74.2 AIC · ⌖ 14.6 AIC · ⊞ 10.1K
Comment /matt to run again

Comment thread .github/aw/subagents.md
### Block boundary

The block ends at the next `##` heading (any level-2 heading) or at EOF — no explicit end marker is needed. Place sub-agent blocks **at the bottom** of the file, after all main workflow content.
The block ends at the next `##` heading (any level-2 heading) or at EOF. Place sub-agent blocks **at the bottom** of the file, after all main workflow content. If parent instructions follow a sub-agent, close it with ``## end agent: `name` `` so those instructions remain in the main prompt.

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.

[/diagnosing-bugs] Nested backtick code span (## end agent: `name` ) will render incorrectly in GitHub-flavored Markdown — GFM closes the span at the first matching double-backtick sequence, so this is likely to display broken.

💡 Suggested fix

Use a single backtick span with the literal name escaped, or switch to a fenced inline example:

close it with `## end agent: \`name\`` so those instructions remain in the main prompt.

or simply drop the inner backticks around name since it is already inside the outer span.

@copilot please address this.

Comment thread .github/aw/subagents.md
|---|---|---|---|
| `description` | No | — | Human-readable summary of the sub-agent's role |
| `model` | No | `"inherited"` | Model override; `"inherited"` uses the parent workflow's model. Prefer model aliases (e.g. `small`, `large`) over specific model IDs for portability. |
| `name` | Claude: yes | — | Claude's registered agent identifier. Use the same name as the inline heading. |

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.

[/grill-with-docs] Good catch documenting Claude's silent-skip behavior and the name requirement. However, the unchanged examples later in this same file (dependency-scanner, test-coverage, secret-scanner, diff-explainer under "When to Use Sub-Agents" / "Full Example") still omit name: in their frontmatter, now contradicting the rule just introduced here.

💡 Suggested fix

Either (a) add name: to all example blocks for consistency, or (b) add a one-line caveat noting those examples target the Copilot engine (which does not require name) so readers don't copy a pattern that silently breaks on Claude.

@copilot please address this.

@github-actions github-actions Bot mentioned this pull request Oct 7, 2026

@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.

Impeccable Review — clarify (docs) / harden (regression test)

Reviewed .github/aw/subagents.md, agent-persona-explorer.md, and the new Go contract test.

Verified correctness:

  • The explicit ## end agent: \persona-evaluator`marker correctly stops the extracted sub-agent content before## Success Criteria, and the marker line itself does **not** leak into the main prompt (confirmed via parser.ExtractInlineSubAgents` against the committed file).
  • model: inherit + name: persona-evaluator match Claude's native frontmatter contract; the regression test (TestAgentPersonaExplorerWorkflowSubAgentContract) passes against this PR's commit.
  • .github/aw/subagents.md is internally consistent (no longer documents the non-existent "inherited" sentinel as a cross-engine default).

No new blocking issues found beyond the existing inline review comments already on this PR (nested-backtick code-span rendering nit in subagents.md:34, and the build-tag question on the new test file) — those are non-blocking style nits, and this repo's convention is (go/redacted):build only (no legacy // +build), so that existing suggestion doesn't apply here.

Note: .github/workflows/dependabot-burner.md still uses model: inherited under engine: copilot — same latent issue this PR fixes for Claude, but out of scope for this change since that file isn't touched here.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 103.4 AIC · ⌖ 13.1 AIC · ⊞ 8.1K

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.5

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.

Agent Persona Exploration - 2026-10-07

2 participants