Skip to content

Centralize slash-command routing#8460

Merged
Evangelink merged 3 commits into
mainfrom
dev/amauryleve/centralize-slash-commands
May 21, 2026
Merged

Centralize slash-command routing#8460
Evangelink merged 3 commits into
mainfrom
dev/amauryleve/centralize-slash-commands

Conversation

@Evangelink
Copy link
Copy Markdown
Member

What

Address the only remaining gh aw compile --strict warning from #8458:

Detected 6 slash_command entries; 6 are not using centralized routing. Consider setting on.slash_command.strategy: centralized to reduce duplicate triggers and route through agentic_commands.yml.

Adds strategy: centralized to the 6 slash-command workflows so the compiler generates a single shared .github/workflows/agentic_commands.yml router that listens to merged slash-command events and dispatches matching target workflows via workflow_dispatch + aw_context.

Source workflow changes (6 files)

File Slash command
add-tests.md /add-tests
autofix.agent.md /autofix
build-failure-analysis-command.md /analyze-build-failure
daily-perf-improver.md /perf-assist
daily-test-improver.md /test-assist
review.agent.md /review

Generated changes

  • New: .github/workflows/agentic_commands.yml — central router emitted by gh aw compile. Its embedded "Routing summary" header documents which slash command dispatches which workflow.
  • 6 corresponding .lock.yml files regenerated — each target now compiles as workflow_dispatch-centric.
  • Minor cleanup in build-failure-analysis.lock.yml and issue-arborist.lock.yml: the compiler now preserves the explicit env-var names from the source .md files (e.g. BINLOG_PATH, GH_AW_GITHUB_REPOSITORY) instead of substituting auto-generated GH_AW_EXPR_* hashed names. No behavior change.

How to verify

gh aw compile --strict
✓ Compiled 21 workflow(s): 0 error(s), 0 warning(s)

Notes

  • See the gh-aw command-triggers docs for the design rationale of centralized routing.
  • Per the docs, with centralized routing, slash commands can now coexist with issues, issue_comment, and pull_request triggers in the same workflow (not exercised here, but enabled for future workflows).

Set `on.slash_command.strategy: centralized` on the 6 workflows that
respond to slash commands:

- add-tests.md (/add-tests)
- autofix.agent.md (/autofix)
- build-failure-analysis-command.md (/analyze-build-failure)
- daily-perf-improver.md (/perf-assist)
- daily-test-improver.md (/test-assist)
- review.agent.md (/review)

With centralized routing, the compiler generates a single
`.github/workflows/agentic_commands.yml` router that listens to merged
slash-command events and dispatches matching target workflows with
`aw_context`. Each target workflow compiles as `workflow_dispatch`-centric
instead of embedding its own slash matching logic, eliminating duplicate
issue/PR/comment event triggers and addressing the only remaining
`gh aw compile --strict` warning from #8458.

Also includes minor regenerations of `build-failure-analysis.lock.yml`
and `issue-arborist.lock.yml`: the compiler now preserves the explicit
env var names from the source `.md` files (e.g. `BINLOG_PATH`,
`GH_AW_GITHUB_REPOSITORY`) instead of substituting auto-generated
`GH_AW_EXPR_*` hashed names. No behavior change.

Verified with `gh aw compile --strict`: 21 workflow(s) compiled,
0 error(s), 0 warning(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 11:32
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 adopts gh-aw’s centralized slash-command routing to eliminate the remaining gh aw compile --strict warning by routing all slash commands through a single generated .github/workflows/agentic_commands.yml dispatcher, while regenerating the affected workflow lock files accordingly.

Changes:

  • Add on.slash_command.strategy: centralized to the 6 slash-command source workflows.
  • Introduce the generated agentic_commands.yml router workflow and regenerate the 6 corresponding *.lock.yml workflows to be workflow_dispatch-centric.
  • Regenerate/update additional lock workflows (build-failure-analysis.lock.yml, issue-arborist.lock.yml) due to compiler output differences.
Show a summary per file
File Description
.github/workflows/add-tests.md Enables centralized slash-command routing for /add-tests.
.github/workflows/add-tests.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/autofix.agent.md Enables centralized slash-command routing for /autofix.
.github/workflows/autofix.agent.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/build-failure-analysis-command.md Enables centralized slash-command routing for /analyze-build-failure.
.github/workflows/build-failure-analysis-command.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/daily-perf-improver.md Enables centralized slash-command routing for /perf-assist.
.github/workflows/daily-perf-improver.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/daily-test-improver.md Enables centralized slash-command routing for /test-assist.
.github/workflows/daily-test-improver.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/review.agent.md Enables centralized slash-command routing for /review.
.github/workflows/review.agent.lock.yml Regenerated lock output for centralized routing / workflow_dispatch invocation.
.github/workflows/agentic_commands.yml New centralized router workflow generated by gh-aw to dispatch slash commands.
.github/workflows/build-failure-analysis.lock.yml Regenerated lock output (includes env-var name preservation changes).
.github/workflows/issue-arborist.lock.yml Regenerated lock output (includes env-var name preservation / formatting changes).

Copilot's findings

  • Files reviewed: 15/15 changed files
  • Comments generated: 1

Comment thread .github/workflows/agentic_commands.yml Outdated
Copy link
Copy Markdown
Member Author

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

21/21 dimensions clean — no findings.


Review Summary

This PR is a clean refactoring of GitHub Actions workflow infrastructure that centralizes slash-command routing. All changes are compiler-generated by gh-aw v0.74.8 and behaviorally equivalent to the original implementation.

What Changed

Architecture improvement:

  • Before: Each workflow listened to issue_comment events directly and parsed slash commands independently (6 duplicate listeners)
  • After: A single agentic_commands.yml router listens to all comment events, parses commands, and dispatches to target workflows via workflow_dispatch with aw_context

File changes:

  • ✅ 6 source .md files: Added strategy: centralized (one line each)
  • ✅ 6 target .lock.yml files: Regenerated with workflow_dispatch triggers
  • ✅ 1 new router: agentic_commands.yml (81 lines, declarative routing configuration)
  • ✅ 2 other .lock.yml files: Minor env var name improvements (BINLOG_PATH vs GH_AW_EXPR_*)

Review Assessment

Applicable dimensions (3):

  1. Algorithmic Correctness — Command-matching logic correctly moved to router; authorization still enforced in pre_activation; operator precedence in complex if conditions is correct
  2. Build Infrastructure & Dependencies — Compiler-generated output validated with gh aw compile --strict (0 errors, 0 warnings per PR description); actions pinned to SHA hashes; permissions properly scoped
  3. Scope & PR Discipline — Single concern (centralize routing), well-documented, addresses #8458 compiler warning

Non-applicable dimensions (18):

  • No production code changes (MSTest/MTP)
  • No test changes
  • No API surface changes
  • No threading/concurrency code
  • No security boundary changes (workflows run in sandboxed environments)
  • No localization, performance, or cross-TFM concerns

Key Observations

Security preserved: The router has minimal permissions and only dispatches workflows; team membership and command authorization remain in each workflow's pre_activation job

Behavioral equivalence: Command matching moved from individual workflows to the router, but the end result is identical — same commands trigger same workflows with same authorization checks

Quality improvement: Env var names now use semantic names (BINLOG_PATH, GH_AW_GITHUB_REPOSITORY) instead of compiler-generated hashes (GH_AW_EXPR_DA06E2FF), making generated workflows more readable

JSON safety: aw_context parsing uses fromJSON(... || '{}') fallback pattern to safely handle empty/missing input

Operator precedence: Complex if conditions correctly rely on && binding tighter than || — e.g., event == 'pull_request' && repo.id == repo_id is properly grouped

Verdict

This is a straightforward, compiler-validated infrastructure refactoring with no behavioral changes to MSTest or MTP runtime code. All dimensions are clean.

Generated by Expert Code Review (on open) for issue #8460 · ● 8.7M

@Evangelink
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…lize-slash-commands

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts are resolved in commit 4795ad4b0 after merging origin/main into this branch and completing conflict resolution for the two generated lock workflow files.

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 15:01
@Evangelink Evangelink review requested due to automatic review settings May 21, 2026 15:01
@Evangelink Evangelink merged commit 52aa5cd into main May 21, 2026
4 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/centralize-slash-commands branch May 21, 2026 15:39
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.

3 participants