Skip to content

Prevent dispatch_workflow schema probes - #1766

Merged
bradygaster merged 2 commits into
devfrom
squad/fix-dispatch-schema-probe
Aug 20, 2026
Merged

Prevent dispatch_workflow schema probes#1766
bradygaster merged 2 commits into
devfrom
squad/fix-dispatch-schema-probe

Conversation

@bradygaster

@bradygaster bradygaster commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Closes #1765

Summary

  • Add WRITE-ONCE guidance to the implement worker's merge-continuation dispatch_workflow instruction.
  • Add a contract assertion that the worker prompt forbids empty/schema-probe dispatch calls and names noop as the alternative.

Context

Live run 32324473906 in bradygaster/aspiregregator-squad-e2e produced two safe-output calls: first an empty dispatch_workflow schema-discovery probe, then the correct { workflow_name: "squad", inputs: { command: "implement", issue_number: "5" } } payload. gh-aw safe-output collection for this item is max: 1, so the first matching item won and the real payload was silently discarded.

This PR is a workaround in our own prompt for a gh-aw collection behavior we do not control. The #1752 safety net worked as intended: it surfaced the missing command as a visible failure instead of letting Squad silently default to cast.

Validation

  • npx vitest run test/gh-aw-quality.test.ts
  • npx vitest run test/gh-aw-implement-workflow.test.ts

Document dispatch_workflow as write-once in the implement worker prompt so schema discovery probes cannot consume the single safe-output slot before the real continuation payload.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26891f18-3f78-4cda-801b-ee668fecae33
Copilot AI lite review requested due to automatic review settings August 20, 2026 07:58
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1766

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 2
Files added 0
Files modified 2
Files deleted 0
Modules touched 2

🎯 Risk Factors

  • 2 files changed (≤5 → LOW)
  • 2 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • workflows/squad-implement-worker.md
tests (1 file)
  • test/gh-aw-quality.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 5ba613b

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 2 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 1 unresolved Copilot thread(s) — fix and resolve before merging
CI passing All checks passing

Files Changed (2 files, +27 −5)

File +/−
test/gh-aw-quality.test.ts +14 −0
workflows/squad-implement-worker.md +13 −5

Total: +27 −5


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Keep the test focused on the stable contract: dispatch_workflow must not be probed with empty or placeholder arguments, and noop is the alternative when there is nothing to dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 26891f18-3f78-4cda-801b-ee668fecae33

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.

Pull request overview

This PR hardens the merge-continuation worker prompt to prevent “schema probe” dispatch_workflow calls that can consume gh-aw’s write-once safe-output budget and discard the real dispatch payload.

Changes:

  • Adds explicit WRITE-ONCE guidance forbidding empty/placeholder dispatch_workflow calls and explaining the “first call wins” consequence.
  • Names noop as the alternative when no dispatch should occur.
  • Adds a Vitest contract asserting the worker prompt contains the anti-probe / write-once guidance.
Show a summary per file
File Description
workflows/squad-implement-worker.md Adds write-once / no-schema-probe dispatch guidance for merge continuation.
test/gh-aw-quality.test.ts Adds a contract test asserting the worker prompt includes the new guidance.

Review details

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +229 to +233
discover its schema. The full schema is already given in this prompt; there
is nothing to discover. If you are not ready to dispatch, or there is no next
wave to dispatch, call `noop` instead of `dispatch_workflow`. The FIRST
`dispatch_workflow` call wins and all later calls are silently discarded, so
a probe destroys the real dispatch. When dispatching, nest the workflow
@bradygaster
bradygaster merged commit b680430 into dev Aug 20, 2026
17 of 18 checks passed
bradygaster added a commit that referenced this pull request Aug 20, 2026
- workflows/squad-implement-worker.md: raise dispatch-workflow max from 1 to 2
  so the real dispatch survives an LLM probe. With max:1, the empty probe consumed
  the only slot and the real payload was silently discarded (confirmed 3 live runs
  in aspiregregator-squad-e2e). Raising to 2 gives the real dispatch a second slot.

- scripts/check-workflow-input-interpolation.mjs: extend static gate with
  checkDispatchWorkflowSchemas() that validates every JSON code block adjacent to a
  dispatch_workflow reference. Catches: missing workflow_name (failure shape 3 from
  run 32316227601), missing inputs object (top-level keys are silently dropped by
  gh-aw), missing inputs.issue_number, and top-level command/issue_number.
  Supports SQUAD_GATE_SCAN_OVERRIDE env var for fixture-based testing.

- test/gh-aw-quality.test.ts: add 6 tests
  - 'worker dispatch-workflow max is at least 2': fails against old max:1 state,
    passes after fix. This is the structural test the prompt-wording approach lacked.
  - 4 gate failure tests: missing workflow_name, top-level inputs, missing
    issue_number, valid schema passes.
  - Regression guard: gate passes against current workflow files.

Closes #1772. Supersedes failed prompt-only approach in #1766.

Coordination needed: Procedures to add squad.md empty-command guard (separate PR) —
when workflow_dispatch fires with no command/issue_number, squad should detect and
report failure immediately rather than running in undefined mode.

Co-authored-by: brady gaster <bradygaster@github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster
bradygaster deleted the squad/fix-dispatch-schema-probe branch September 9, 2026 19:44
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.

dispatch_workflow schema probe swallows the real payload, stalling epic continuation

2 participants