Skip to content

Optimize ab-testing-advisor prompt with inline sub-agents#34063

Merged
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer-optimize-ab-testing-advisor
May 22, 2026
Merged

Optimize ab-testing-advisor prompt with inline sub-agents#34063
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer-optimize-ab-testing-advisor

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

Daily A/B Testing Advisor was repeatedly pulling large workflow and experiment-source files into the parent model context. This updates the workflow to delegate the two extractive phases to inline small sub-agents, reducing redundant context load while preserving the existing decision flow.

  • Primary quest: workflow characterization

    • Replaced Step 2’s full-file manual analysis with a workflow-characterizer inline agent.
    • The parent prompt now consumes a compact structured summary: purpose, triggers, engine, prompt_density, tools, outputs, and quality_signals.
    • The selected workflow path is captured once in SELECTED and reused for run-history lookup.
  • Side quest: experiment field verification

    • Removed the duplicated cat pkg/workflow/compiler_experiments.go / cat actions/setup/js/pick_experiment.cjs blocks.
    • Added a field-presence-checker inline agent that returns present/evidence results for analysis_type, tags, and notify.
    • Updated the Area 1 gate to rely on those structured results instead of re-reading both files in the main prompt.
  • Inline sub-agent definitions

    • Added two bottom-of-file ## agent: blocks following repository convention:
      • workflow-characterizer
      • field-presence-checker
    • Both are explicitly scoped as model: small and constrained to factual extraction/classification.
  • Prompt shape

    • Kept the campaign-authoring and side-quest synthesis work in the main prompt.
    • Reduced repeated file-ingestion instructions without changing issue-creation expectations or output constraints.

Example of the new delegation pattern:

Use the `workflow-characterizer` agent with the selected workflow file path. Use the returned characterization (`purpose`, `triggers`, `engine`, `prompt_density`, `tools`, `outputs`, `quality_signals`) as the basis for Step 3.

Use the `field-presence-checker` agent with file paths `pkg/workflow/compiler_experiments.go` and `actions/setup/js/pick_experiment.cjs`, and field names `analysis_type`, `tags`, `notify`.

Copilot AI and others added 2 commits May 22, 2026 16:39
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize Daily A/B Testing Advisor workflow Optimize ab-testing-advisor prompt with inline sub-agents May 22, 2026
Copilot AI requested a review from pelikhan May 22, 2026 16:42
@pelikhan pelikhan marked this pull request as ready for review May 22, 2026 16:45
Copilot AI review requested due to automatic review settings May 22, 2026 16:45
@pelikhan pelikhan merged commit 12859c3 into main May 22, 2026
@pelikhan pelikhan deleted the copilot/subagent-optimizer-optimize-ab-testing-advisor branch May 22, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the A/B Testing Advisor workflow prompt to delegate two extractive steps to inline model: small sub-agents, reducing repeated large-file ingestion in the parent prompt while keeping the existing campaign/issue-creation flow in the main agent.

Changes:

  • Refactors .github/workflows/ab-testing-advisor.md to (a) store a chosen workflow path in SELECTED, (b) delegate workflow characterization to a workflow-characterizer sub-agent, and (c) delegate experiment-field verification to a field-presence-checker sub-agent.
  • Regenerates workflow lock artifacts and action locks to align pinned SHAs / schedules with their sources (e.g., docker/setup-buildx-action pin and developer-docs consolidator schedule).
Show a summary per file
File Description
.github/workflows/ab-testing-advisor.md Introduces SELECTED reuse + adds two inline small sub-agents for workflow characterization and field presence checking.
.github/workflows/developer-docs-consolidator.lock.yml Updates the compiled lock workflow schedule (weekly) and regenerates prompt/config heredocs accordingly.
.github/workflows/release.lock.yml Updates the pinned SHA/version annotation for docker/setup-buildx-action in the compiled workflow.
.github/aw/actions-lock.json Adds a lock entry for docker/setup-buildx-action@v4 matching the updated pin used by the release workflow.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 3

Comment on lines +118 to +129
From the list of workflows **without** an `experiments:` section, pick one at random — **excluding any workflow whose basename appears in the `recently_analyzed` list above** — and store the chosen path in `SELECTED`:

```bash
grep -rL 'experiments:' .github/workflows/*.md 2>/dev/null | grep -v shared | shuf -n 1
SELECTED=$(grep -rL 'experiments:' .github/workflows/*.md 2>/dev/null | grep -v shared | shuf -n 1)
echo "$SELECTED"
```

If after filtering out recently-analyzed workflows the candidate list is empty, fall back to any eligible workflow (the dedup window has been exhausted):

```bash
grep -rL 'experiments:' .github/workflows/*.md 2>/dev/null | grep -v shared | shuf -n 1
SELECTED=$(grep -rL 'experiments:' .github/workflows/*.md 2>/dev/null | grep -v shared | shuf -n 1)
echo "$SELECTED"
gh run list --workflow="$(basename "$SELECTED" .md).lock.yml" --limit 10 --json conclusion,createdAt,displayTitle,durationMS
```
7. **Existing quality signals** — Are there any reported issues, quality labels, or patterns in runs?
Use the `workflow-characterizer` agent with the selected workflow file path. Use the returned characterization (`purpose`, `triggers`, `engine`, `prompt_density`, `tools`, `outputs`, `quality_signals`) as the basis for Step 3.
Comment on lines +424 to +426
"analysis_type": { "present": "yes", "evidence": "" },
"tags": { "present": "yes", "evidence": "" },
"notify": { "present": "yes", "evidence": "" }
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.

[subagent-optimizer] Optimize Daily A/B Testing Advisor — 2026-05-22

3 participants