Skip to content

Reduce generated model-routing decision steps - #77334

Merged
pelikhan merged 6 commits into
mainfrom
pelikhan/compact-model-routing
Nov 13, 2026
Merged

pelikhan merged 6 commits into
mainfrom
pelikhan/compact-model-routing

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Reduce generated model-routing boilerplate from 16 lines to 5 per workflow. Evaluate whether both model override variables are empty in a boolean Actions expression, then write the existing model-routing output with one command. Nonempty overrides still disable implicit routing; explicit routing is unchanged.

Regenerate workflow locks and compiler golden snapshots. No helper script or workflow source changes are needed.

Validation

  • Passed focused implicit-routing and WASM golden tests, build, and compilation of all 365 workflows.
  • The final validation gate remains blocked by pre-existing custom-lint findings in unchanged code within model_routing_default.go (function length, JSON decoding, and a discarded type-assertion result). The workflow drift found during validation was addressed by regenerating lock files.

Replace repeated shell branches with a boolean Actions expression and one output command. Regenerate workflow locks and compiler snapshots.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 13, 2026 04:02
Copilot AI adaptive review requested due to automatic review settings November 13, 2026 04:02
@github-actions

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

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #77334

@github-actions

github-actions Bot commented Nov 13, 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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Code Quality Reviewer · gpt56 · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 182 · ◷

Generated by Ponytail Reviewer for #77334

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-13T04:07:00Z
review_event: COMMENT
top_themes: [preserve runtime diagnostics when compacting generated workflow steps]
files_reviewed: [pkg/workflow/model_routing_default.go, pkg/workflow/model_routing_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 · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.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.

The compact model-routing step preserves the routing decision but removes useful runtime diagnostics. Please retain a concise decision log line so unexpected routing behavior remains debuggable without restoring the previous boilerplate.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

return fmt.Sprintf(` - name: Resolve model routing
id: %s
env:
GH_AW_MODEL_ROUTING: ${{ vars.%s == '' && vars.%s == '' }}

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 compact step removes the only runtime diagnostics explaining why implicit routing was enabled or disabled, making unexpected routing decisions difficult to investigate from workflow logs.

💡 Preserve a concise decision diagnostic

Please retain a single log line (for example, the resolved boolean and the relevant override state) before writing the output, or otherwise expose equivalent diagnostic context without restoring the full branch boilerplate. This keeps the size reduction while preserving operational observability.

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 activation step now invokes actions/setup/sh/resolve_model_routing.sh, which logs whether routing was enabled or which override disabled it, then writes the existing output. Commit: 1482e2ad.

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.

🟡 Changes recommended

Three nonempty-override test cases fail because the evaluator serializes false as an empty string, producing model-routing= instead of model-routing=false.

1 open issue
What changed in this PR

This PR simplifies gh-aw’s generated implicit model-routing decision step from 16 lines to 5, keeping the existing output contract and model-override precedence.

Changes:

  • Replace shell branching with a boolean Actions expression and one output command.
  • Update compiler assertions and six WebAssembly golden snapshots.
  • Regenerate workflow locks without changing workflow sources or adding helper scripts.
File Description
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​with-imports.golden Refresh routing-step snapshot.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​smoke-copilot.golden Refresh routing-step snapshot.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​playwright-cli-mode.golden Refresh routing-step snapshot.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​custom-safe-output-max-length.golden Refresh routing-step snapshot.
pkg/​workflow/​testdata/​TestWasmGolden_CompileFixtures/​basic-copilot.golden Refresh routing-step snapshot.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​copilot.golden Refresh Copilot routing snapshot.
pkg/​workflow/​model_routing_test.go Update generated-step assertions.
pkg/​workflow/​model_routing_default.go Emit the compact routing decision step.
.github/​workflows/​workflow-skill-extractor.lock.yml Regenerate compact routing step.
.github/​workflows/​workflow-health-manager.lock.yml Regenerate compact routing step.
.github/​workflows/​weekly-editors-health-check.lock.yml Regenerate compact routing step.
.github/​workflows/​weekly-blog-post-writer.lock.yml Regenerate compact routing step.
.github/​workflows/​visual-regression-checker.lock.yml Regenerate compact routing step.
.github/​workflows/​ubuntu-image-analyzer.lock.yml Regenerate compact routing step.
.github/​workflows/​tidy.lock.yml Regenerate compact routing step.
.github/​workflows/​stale-pr-cleanup.lock.yml Regenerate compact routing step.
.github/​workflows/​spec-librarian.lock.yml Regenerate compact routing step.
.github/​workflows/​spec-extractor.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-workflow-call-with-inputs.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-work-queue-worker.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-work-queue-dispatcher.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-update-cross-repo-pr.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-security-alerts.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-project.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-multi-pr.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-issues.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-create-cross-repo-pr.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-copilot-dynamic-workflow.lock.yml Regenerate compact routing step.
.github/​workflows/​smoke-checkout-pr-dispatch.lock.yml Regenerate compact routing step.
.github/​workflows/​slide-deck-maintainer.lock.yml Regenerate compact routing step.
.github/​workflows/​security-compliance.lock.yml Regenerate compact routing step.
.github/​workflows/​repository-quality-improver.lock.yml Regenerate compact routing step.
.github/​workflows/​release.lock.yml Regenerate compact routing step.
.github/​workflows/​refiner.lock.yml Regenerate compact routing step.
.github/​workflows/​pr-nitpick-reviewer.lock.yml Regenerate compact routing step.
.github/​workflows/​pr-finisher.lock.yml Regenerate compact routing step.
.github/​workflows/​plan.lock.yml Regenerate compact routing step.
.github/​workflows/​org-health-report.lock.yml Regenerate compact routing step.
.github/​workflows/​objective-impact-report.lock.yml Regenerate compact routing step.
.github/​workflows/​mergefest.lock.yml Regenerate compact routing step.
.github/​workflows/​mcp-inspector.lock.yml Regenerate compact routing step.
.github/​workflows/​layout-spec-maintainer.lock.yml Regenerate compact routing step.
.github/​workflows/​firewall.lock.yml Regenerate compact routing step.
.github/​workflows/​firewall-escape.lock.yml Regenerate compact routing step.
.github/​workflows/​eslint-miner.lock.yml Regenerate compact routing step.
.github/​workflows/​eslint-factory-dispatcher.lock.yml Regenerate compact routing step.
.github/​workflows/​enterprise-docs-audit.lock.yml Regenerate compact routing step.
.github/​workflows/​engine-conformance-dispatcher.lock.yml Regenerate compact routing step.
.github/​workflows/​engine-conformance-copilot.lock.yml Regenerate compact routing step.
.github/​workflows/​draft-pr-cleanup.lock.yml Regenerate compact routing step.
.github/​workflows/​docs-noob-tester.lock.yml Regenerate compact routing step.
.github/​workflows/​dictation-prompt.lock.yml Regenerate compact routing step.
.github/​workflows/​dev-hawk.lock.yml Regenerate compact routing step.
.github/​workflows/​deployment-incident-monitor.lock.yml Regenerate compact routing step.
.github/​workflows/​delight.lock.yml Regenerate compact routing step.
.github/​workflows/​dead-code-remover.lock.yml Regenerate compact routing step.
.github/​workflows/​dataflow-pr-discussion-dataset.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-workflow-updater.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-workflow-security-model.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-work-queues-report.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-work-queue-formal-verification.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-trajectory-grader-implementer.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-testify-uber-super-expert.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-team-status.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-syntax-error-quality.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-squid-image-scan.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-spec-coverage-kiro.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-spdd-spec-planner.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-security-observability.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-secrets-analysis.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-schema-audit-cursor.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-safe-output-integrator.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-report-dispatcher.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-regression-audit-kiro.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-pr-review-cursor.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-graft-intelligence.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-geo-optimizer.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-formal-spec-verifier.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-experiment-report.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-ecosystem-explorer.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-declarative-engine-improver.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-compiler-threat-spec-optimizer.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-compiler-quality.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-assign-issue-to-user.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-ambient-context-optimizer.lock.yml Regenerate compact routing step.
.github/​workflows/​daily-agent-of-the-day-blog-writer.lock.yml Regenerate compact routing step.
.github/​workflows/​craft.lock.yml Regenerate compact routing step.
.github/​workflows/​copilot-pr-prompt-analysis.lock.yml Regenerate compact routing step.
.github/​workflows/​copilot-pr-nlp-analysis.lock.yml Regenerate compact routing step.
.github/​workflows/​copilot-pr-merged-report.lock.yml Regenerate compact routing step.
.github/​workflows/​copilot-opt.lock.yml Regenerate compact routing step.
.github/​workflows/​cli-consistency-checker.lock.yml Regenerate compact routing step.
.github/​workflows/​ci-coach.lock.yml Regenerate compact routing step.
.github/​workflows/​breaking-change-checker.lock.yml Regenerate compact routing step.
.github/​workflows/​aw-issue-clustering.lock.yml Regenerate compact routing step.
.github/​workflows/​auditor.lock.yml Regenerate compact routing step.
.github/​workflows/​architecture-guardian.lock.yml Regenerate compact routing step.
.github/​workflows/​agentic-token-optimizer.lock.yml Regenerate compact routing step.
.github/​workflows/​agentic-token-audit.lock.yml Regenerate compact routing step.
.github/​workflows/​agent-performance-analyzer.lock.yml Regenerate compact routing step.

Review effort: Balanced (dynamic)

return fmt.Sprintf(` - name: Resolve model routing
id: %s
env:
GH_AW_MODEL_ROUTING: ${{ vars.%s == '' && vars.%s == '' }}

@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 /tdd and /diagnosing-bugs directly, since the diff is small. Requesting changes because one test fails.

📋 Key Themes & Highlights

Blocking issue

  • Failing test (outside this diff): TestDefaultModelRoutingActivationHonorsModelVariables in pkg/workflow/model_env_vars_test.go:892 fails in the agent_variable, default_variable, and both_variables,_agent_wins subtests. The step now emits false through Actions boolean stringification. evaluateTestExpression returns "" for false binary and logical results, but the test expects "false". This test file is not part of the PR, so it was not updated for the new expression.
  • Suggested fix: keep evaluateTestExpression truthiness semantics so if: checks still work. Map an empty result to "false" only at the ${{ }} interpolation boundary, and only when the top-level node is a binary or logical expression. Do not map every empty value, because an unset vars.* also yields "". A blanket mapping inside evaluateTestExpression breaks the neither_variable case.

Verified

  • ✅ gofmt -l is clean on both changed Go files.
  • ✅ TestCompileDefaultModelRouting_RuntimeOverrideGuard passes against the new expression and echo.
  • ✅ The neither_variable subtest passes.
  • ✅ No references to the removed GH_AW_MODEL_AGENT_VAR or GH_AW_DEFAULT_MODEL_VAR remain at head, and the committed .lock.yml files use the new form.
  • ✅ == '' preserves the former -n semantics: unset and empty vars.* both evaluate to '', and whitespace-only values count as set in both versions.

Limits

  • I could not confirm the failure against the parent commit because the worktree fetch failed. I attribute it to this change because the old script emitted a literal false.
  • The PR body says the final lint gate is blocked by pre-existing findings in model_routing_default.go. I did not verify this.

@copilot please address the failing test before merging.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/model_routing_default.go:158): address unresolved feedback - Review comment
  3. Fix failing check impacted-go-tests (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "975779adacb94c31efd9a073c631b3e7d3fd4c9a",
  "kind": "requested",
  "schema_version": "1",
  "state": "5add20967dc6321a3544be1334eb85bf55818d145f3d6039c5d5876284d4d111",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
    "8970a13fb8acb6e86e0b521084fb261586d2a9c7001e9485eb265f089d1566fb"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

…l-routing

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot keep the looging, move to .sh file

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot keep the looging, move to .sh file

Restored the routing decision diagnostics in a dedicated actions/setup/sh/resolve_model_routing.sh helper and updated the generated step to call it. Commit: 1482e2ad.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 The prep is done, but CI needs another taste test. Copilot's assigned task has finished; these checks are still failing: Completed task

Please address the remaining CI failures on this PR's existing branch. No merging or CI triggering.

Structured data
{
  "completed_task": 43371574120,
  "head": "1482e2ad6b0812d7e5ccf9371ebfda0d3fd0d906",
  "kind": "ci-follow-up",
  "schema_version": "1",
  "state": "d600f537123b10fc194747549c3c8e9cd64cc09676fb8c6b85421e2dc9e9969d",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 high · ~1 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 The prep is done, but CI needs another taste test. Copilot's assigned task has finished; these checks are still failing: [Completed task](https://github.com/github/gh-aw/actions/runs/43...

Fixed in commit a3d42b19. The action-mode compilation test now accepts the valid SHA-pinned setup action ref while checking that it corresponds to v1.2.3. TestActionModeCompilation and the impacted Go tests passed. make agent-report-progress reached the impacted tests successfully; its only failure was the three pre-existing custom-lint findings in unchanged pkg/workflow/model_routing_default.go. No CI was triggered.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

…l-routing

# Conflicts:
#	pkg/workflow/compiler_custom_actions_test.go

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

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved the conflict and merged the latest main in two-parent merge commit 30bc70d121. The action-mode test now checks the exact fixture SHA and v1.2.3 annotation. The focused test passed; the final gate reported only three existing custom-lint findings in unchanged code.

@pelikhan
pelikhan merged commit a70c23b into main Nov 13, 2026
65 checks passed
@pelikhan
pelikhan deleted the pelikhan/compact-model-routing branch November 13, 2026 13:49
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

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.

4 participants