Skip to content

feat: reimplement tools.qmd as parameterized shared import, remove builtin presets#23366

Merged
pelikhan merged 5 commits intomainfrom
copilot/reimplement-tools-shared-agentic-workflow
Mar 29, 2026
Merged

feat: reimplement tools.qmd as parameterized shared import, remove builtin presets#23366
pelikhan merged 5 commits intomainfrom
copilot/reimplement-tools-shared-agentic-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

tools.qmd was only accessible via two hardcoded non-parameterized shared presets (shared/mcp/qmd.md, shared/mcp/qmd-docs.md). This replaces them with a single parameterized shared/qmd.md using import-schema, making qmd configuration composable and explicitly configurable per workflow.

New shared/qmd.md

Exposes all qmd fields via typed import-schema parameters:

imports:
  - uses: shared/qmd.md
    with:
      gpu: true
      runs-on: aw-gpu-runner-T4
      checkouts:
        - name: docs
          pattern: "docs/src/**/*.{md,mdx}"
          context: "Project documentation"
      searches:
        - name: issues
          type: issues
          max: 500
          github-token: ${{ secrets.GITHUB_TOKEN }}
      cache-key: "qmd-${{ hashFiles('docs/**') }}"

All parameters are optional — unset inputs leave expression placeholders that parseQmdTool now silently ignores.

Changes

  • Removed shared/mcp/qmd.md and shared/mcp/qmd-docs.md
  • Created shared/qmd.md with import-schema for checkouts, searches, cache-key, gpu, runs-on
  • Updated dev.md, smoke-codex.md, and 8 doc workflows to use the new import
  • Schema (main_workflow_schema.json): extended with: to allow arrays of objects, not just primitives — required for passing checkouts/searches as with parameters
  • parseQmdTool: guards cache-key and runs-on against unsubstituted ${{...}} expression strings using strings.Contains to avoid them being treated as literal values when optional inputs are omitted


✨ PR Review Safe Output Test - Run 23698148563

💥 [THE END] — Illustrated by Smoke Claude ·



✨ PR Review Safe Output Test - Run 23699095768

💥 [THE END] — Illustrated by Smoke Claude ·

Copilot AI and others added 2 commits March 28, 2026 17:01
…mport-schema

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/58293861-6689-4b35-a114-76ee2ff1ceb3

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…in parseQmdTool

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/58293861-6689-4b35-a114-76ee2ff1ceb3

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review March 28, 2026 17:57
Copilot AI review requested due to automatic review settings March 28, 2026 17:57
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

Reimplements tools.qmd as a single parameterized shared import (shared/qmd.md) using import-schema, replacing the previous hardcoded shared presets and updating workflows accordingly.

Changes:

  • Added shared/qmd.md with import-schema-driven parameters for checkouts, searches, cache-key, gpu, and runs-on.
  • Updated multiple workflows to import shared/qmd.md (and regenerated corresponding .lock.yml manifests).
  • Extended main_workflow_schema.json to allow with: parameters to include arrays containing object elements; updated parseQmdTool to ignore unexpanded import-schema placeholders.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/tools_parser.go Adds guards for qmd cache-key / runs-on to avoid treating unsubstituted import placeholders as literals.
pkg/parser/schemas/main_workflow_schema.json Allows imports[].with to pass arrays that include objects (needed for qmd checkouts / searches).
.github/workflows/shared/qmd.md New parameterized shared qmd import with import-schema and qmd guidance text.
.github/workflows/shared/mcp/qmd.md Removes legacy hardcoded qmd preset.
.github/workflows/shared/mcp/qmd-docs.md Removes legacy hardcoded qmd-docs preset.
.github/workflows/weekly-blog-post-writer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/weekly-blog-post-writer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/unbloat-docs.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/unbloat-docs.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/technical-doc-writer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/technical-doc-writer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/smoke-codex.md Replaces inline tools.qmd config with shared/qmd.md import parameters.
.github/workflows/smoke-codex.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/glossary-maintainer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/glossary-maintainer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/dictation-prompt.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/dictation-prompt.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/developer-docs-consolidator.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/developer-docs-consolidator.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/dev.md Switches from inline tools.qmd to shared/qmd.md import parameters.
.github/workflows/dev.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/daily-doc-updater.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/daily-doc-updater.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/daily-doc-healer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/daily-doc-healer.lock.yml Regenerated lock manifest reflecting new qmd import.

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

Comment on lines 430 to 435
// Handle cache-key field. Skip values that contain unexpanded import-schema expressions
// (e.g. "${{ github.aw.import-inputs.cache-key }}") which are left as literal strings
// when the caller does not supply the optional input.
if cacheKey, ok := configMap["cache-key"].(string); ok && cacheKey != "" && !strings.Contains(cacheKey, "${{") {
config.CacheKey = cacheKey
toolsParserLog.Printf("qmd tool cache-key: %s", cacheKey)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The new guard skips any cache-key containing "${{", but cache keys commonly (and per qmd.go docs) legitimately include GitHub Actions expressions like qmd-index-${{ hashFiles('docs/**') }}. This will silently drop user-provided cache keys and change behavior. Consider only filtering the specific unexpanded import-schema placeholder (e.g. strings that reference github.aw.import-inputs.cache-key, or exact-match the placeholder), while allowing other ${{ ... }} expressions through unchanged.

Copilot uses AI. Check for mistakes.
Comment on lines +446 to 452
// Handle runs-on field (override runner image for the indexing job). Skip values that
// contain unexpanded import-schema expressions which are left as literal strings when
// the caller does not supply the optional input.
if runsOnVal, exists := configMap["runs-on"]; exists {
if runsOnStr, ok := runsOnVal.(string); ok && runsOnStr != "" {
if runsOnStr, ok := runsOnVal.(string); ok && runsOnStr != "" && !strings.Contains(runsOnStr, "${{") {
config.RunsOn = runsOnStr
toolsParserLog.Printf("qmd tool runs-on: %s", runsOnStr)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

Same issue as cache-key: skipping any runs-on value containing "${{" will also drop legitimate GitHub Actions expressions (e.g. matrix/inputs-based runner selection). If the intent is to ignore only unexpanded import-schema placeholders, narrow the check to github.aw.import-inputs.runs-on (or exact placeholder matching) rather than all expressions.

Copilot uses AI. Check for mistakes.
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review comments

…rt-inputs. prefix

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/501188f0-c734-4ea3-8f94-7657e08f0135

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 28, 2026

@copilot review comments

Fixed in 859cb0a. Replaced the over-broad strings.Contains(val, "${{") check with a targeted isUnexpandedImportInput helper that only skips values containing github.aw.import-inputs. — so legitimate expressions like qmd-index-${{ hashFiles('docs/**') }} pass through unchanged.

Copilot AI requested a review from pelikhan March 28, 2026 18:18
@pelikhan pelikhan added the smoke label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

❌ Tool validation failed! Agent Container Smoke Test detected missing tools: failed

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions bot removed the smoke label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

@@ -50,7 +50,17 @@ timeout-minutes: 45

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 shared/qmd.md import with runs-on: aw-gpu-runner-T4 looks good. Consider documenting why GPU is required for this doc healer workflow to help future maintainers understand the requirement.

- uses: shared/qmd.md
with:
runs-on: aw-gpu-runner-T4
gpu: true
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 ignore patterns for .git/** and node_modules/** are sensible defaults. If these become commonly needed across workflows, consider centralizing them as defaults in the shared qmd.md import schema to reduce repetition.

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.

Agreed — centralizing ignore defaults in shared/qmd.md would reduce boilerplate across workflows. Worth a follow-up once the import schema pattern stabilizes.

📰 BREAKING: Report filed by Smoke Copilot

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…ools-shared-agentic-workflow

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@copilot merge main and recompile

Done in 5080790 — merged origin/main and recompiled all 178 workflows successfully.

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:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0 --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@copilot Fix wasm https://github.com/github/gh-aw/actions/runs/23698513157/job/69038830448

Fixed in abada22 — updated the three WASM golden files (basic-copilot, smoke-copilot, with-imports) that drifted after the main merge. TestWasmGolden_CompileFixtures now passes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions bot removed the smoke label Mar 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq 4.52.4
curl 8.5.0
gh 2.88.1
node 20.20.1
python3 3.12.3
go 1.24.13
java 21.0.10
dotnet 10.0.201

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Copilot - 23699095779

Test Status
GitHub MCP
MCP Scripts GH CLI
Serena MCP
Playwright
Web Fetch
File Writing + Bash
Discussion Comment
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: ⚠️ PARTIAL PASS (Serena MCP tools not available)

PR Author: @Copilot | Assignees: @pelikhan, @Copilot

📰 BREAKING: Report filed by Smoke Copilot ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Quick smoke-test review pass. The isUnexpandedImportInput helper is a clean approach to guard against unexpanded import-schema placeholders. The existing review comments on the broader ${{ checks are valid — using the specific placeholder guard is the right fix.

📰 BREAKING: Report filed by Smoke Copilot

// (exactly "${{ github.aw.import-inputs.cache-key }}") left as literal strings when
// the caller does not supply the optional input. Legitimate GitHub Actions expressions
// such as "qmd-${{ hashFiles('docs/**') }}" are kept as-is.
if cacheKey, ok := configMap["cache-key"].(string); ok && cacheKey != "" && !isUnexpandedImportInput(cacheKey) {
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.

Using !isUnexpandedImportInput(cacheKey) here is the correct fix, but the previous broader check (strings.Contains(s, "$\{\{")) would have incorrectly dropped valid expressions like qmd-$\{\{ hashFiles('docs/**') }}. Good that this narrower guard is already in place.

// because the caller did not supply the optional input. It returns false for any other
// value, including legitimate GitHub Actions expressions like "${{ hashFiles('...') }}".
func isUnexpandedImportInput(s string) bool {
return strings.Contains(s, "github.aw.import-inputs.")
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 isUnexpandedImportInput helper is a clean, focused guard for detecting unexpanded github.aw.import-inputs.* placeholders. This is the right approach — narrow check, avoids the over-broad strings.Contains(s, "$\{\{") pattern flagged in the sibling cache-key/runs-on checks.

@github-actions
Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — Run §23699095768

Overall: PARTIAL (core tests ✅, some PR tests ⚠️ skipped)

Core Tests #1–11 PR Review Tests #12–18
1 GitHub MCP ✅ 12 Update PR ✅
2 GH CLI ✅ 13 Review Comments ✅
3 Serena ⚠️ (EOF) 14 Submit Review ✅
4 Make Build ✅ 15 Resolve Thread ⚠️
5 Playwright ✅ 16 Add Reviewer ✅
6 Tavily Search ✅ 17 Push Branch ⚠️
7 File Write ✅ 18 Close PR ⚠️
8 Bash ✅
9 Discussion ✅
10 AW MCP ✅
11 Slack ✅

💥 [THE END] — Illustrated by Smoke Claude ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

@@ -50,7 +50,17 @@ timeout-minutes: 45

imports:
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 uses: shared/qmd.md import syntax with with: block is a nice improvement over the flat - shared/mcp/qmd-docs.md form. The explicit GPU runner and checkout configuration makes the intent clearer.

- shared/mcp/qmd-docs.md
- uses: shared/qmd.md
with:
runs-on: aw-gpu-runner-T4
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.

Good use of checkouts config with a targeted glob pattern **/*.{md,mdx}. The context field describing the purpose of the checkout will help the QMD search tool understand what's indexed.

@github-actions github-actions bot mentioned this pull request Mar 29, 2026
@pelikhan pelikhan merged commit eb5fe1d into main Mar 29, 2026
213 of 216 checks passed
@pelikhan pelikhan deleted the copilot/reimplement-tools-shared-agentic-workflow branch March 29, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants